diff --git a/admin/api_service_accounts.go b/admin/api_service_accounts.go new file mode 100644 index 000000000..00948ef58 --- /dev/null +++ b/admin/api_service_accounts.go @@ -0,0 +1,3412 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +import ( + "context" + "io" + "net/http" + "net/url" + "strings" +) + +type ServiceAccountsApi interface { + + /* + AddProjectServiceAccount Assign One Service Account to One Project + + Assigns the specified Service Account to the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param groupServiceAccountRoleAssignment The Project permissions for the Service Account in the specified Project. + @return AddProjectServiceAccountApiRequest + */ + AddProjectServiceAccount(ctx context.Context, clientId string, groupId string, groupServiceAccountRoleAssignment *[]GroupServiceAccountRoleAssignment) AddProjectServiceAccountApiRequest + /* + AddProjectServiceAccount Assign One Service Account to One Project + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param AddProjectServiceAccountApiParams - Parameters for the request + @return AddProjectServiceAccountApiRequest + */ + AddProjectServiceAccountWithParams(ctx context.Context, args *AddProjectServiceAccountApiParams) AddProjectServiceAccountApiRequest + + // Method available only for mocking purposes + AddProjectServiceAccountExecute(r AddProjectServiceAccountApiRequest) (*GroupServiceAccount, *http.Response, error) + + /* + CreateProjectServiceAccount Create and Assign one Service Account to one Project + + Creates one Service Account for the specified Project. The Service Account will automatically be added as an Organization Member to the Organization that the specified Project is a part of. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param groupServiceAccountRequest Details of the new Service Account. + @return CreateProjectServiceAccountApiRequest + */ + CreateProjectServiceAccount(ctx context.Context, groupId string, groupServiceAccountRequest *GroupServiceAccountRequest) CreateProjectServiceAccountApiRequest + /* + CreateProjectServiceAccount Create and Assign one Service Account to one Project + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param CreateProjectServiceAccountApiParams - Parameters for the request + @return CreateProjectServiceAccountApiRequest + */ + CreateProjectServiceAccountWithParams(ctx context.Context, args *CreateProjectServiceAccountApiParams) CreateProjectServiceAccountApiRequest + + // Method available only for mocking purposes + CreateProjectServiceAccountExecute(r CreateProjectServiceAccountApiRequest) (*GroupServiceAccount, *http.Response, error) + + /* + CreateProjectServiceAccountAccessList Add Access List entries for one Project Service Account + + Add Access List Entries for the specified Service Account for the project. Resources require all API requests to originate from IP addresses on the API access list. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @param serviceAccountIPAccessListEntry A list of access list entries to add to the access list of the specified Service Account for the project. + @return CreateProjectServiceAccountAccessListApiRequest + */ + CreateProjectServiceAccountAccessList(ctx context.Context, groupId string, clientId string, serviceAccountIPAccessListEntry *[]ServiceAccountIPAccessListEntry) CreateProjectServiceAccountAccessListApiRequest + /* + CreateProjectServiceAccountAccessList Add Access List entries for one Project Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param CreateProjectServiceAccountAccessListApiParams - Parameters for the request + @return CreateProjectServiceAccountAccessListApiRequest + */ + CreateProjectServiceAccountAccessListWithParams(ctx context.Context, args *CreateProjectServiceAccountAccessListApiParams) CreateProjectServiceAccountAccessListApiRequest + + // Method available only for mocking purposes + CreateProjectServiceAccountAccessListExecute(r CreateProjectServiceAccountAccessListApiRequest) (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) + + /* + CreateProjectServiceAccountSecret Create one Project Service Account Secret + + Create a secret for the specified Service Account in the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @param serviceAccountSecretRequest Details for the new secret. + @return CreateProjectServiceAccountSecretApiRequest + */ + CreateProjectServiceAccountSecret(ctx context.Context, groupId string, clientId string, serviceAccountSecretRequest *ServiceAccountSecretRequest) CreateProjectServiceAccountSecretApiRequest + /* + CreateProjectServiceAccountSecret Create one Project Service Account Secret + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param CreateProjectServiceAccountSecretApiParams - Parameters for the request + @return CreateProjectServiceAccountSecretApiRequest + */ + CreateProjectServiceAccountSecretWithParams(ctx context.Context, args *CreateProjectServiceAccountSecretApiParams) CreateProjectServiceAccountSecretApiRequest + + // Method available only for mocking purposes + CreateProjectServiceAccountSecretExecute(r CreateProjectServiceAccountSecretApiRequest) (*ServiceAccountSecret, *http.Response, error) + + /* + CreateServiceAccount Create one Organization Service Account + + Creates one Service Account for the specified Organization. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param orgServiceAccountRequest Details of the new Service Account. + @return CreateServiceAccountApiRequest + */ + CreateServiceAccount(ctx context.Context, orgId string, orgServiceAccountRequest *OrgServiceAccountRequest) CreateServiceAccountApiRequest + /* + CreateServiceAccount Create one Organization Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param CreateServiceAccountApiParams - Parameters for the request + @return CreateServiceAccountApiRequest + */ + CreateServiceAccountWithParams(ctx context.Context, args *CreateServiceAccountApiParams) CreateServiceAccountApiRequest + + // Method available only for mocking purposes + CreateServiceAccountExecute(r CreateServiceAccountApiRequest) (*OrgServiceAccount, *http.Response, error) + + /* + CreateServiceAccountAccessList Add Access List entries for one Organization Service Account + + Add Access List Entries for the specified Service Account for the organization. Resources require all API requests to originate from IP addresses on the API access list. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @param serviceAccountIPAccessListEntry A list of access list entries to add to the access list of the specified Service Account for the organization. + @return CreateServiceAccountAccessListApiRequest + */ + CreateServiceAccountAccessList(ctx context.Context, orgId string, clientId string, serviceAccountIPAccessListEntry *[]ServiceAccountIPAccessListEntry) CreateServiceAccountAccessListApiRequest + /* + CreateServiceAccountAccessList Add Access List entries for one Organization Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param CreateServiceAccountAccessListApiParams - Parameters for the request + @return CreateServiceAccountAccessListApiRequest + */ + CreateServiceAccountAccessListWithParams(ctx context.Context, args *CreateServiceAccountAccessListApiParams) CreateServiceAccountAccessListApiRequest + + // Method available only for mocking purposes + CreateServiceAccountAccessListExecute(r CreateServiceAccountAccessListApiRequest) (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) + + /* + CreateServiceAccountSecret Create one Organization Service Account Secret + + Create a secret for the specified Service Account. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @param serviceAccountSecretRequest Details for the new secret. + @return CreateServiceAccountSecretApiRequest + */ + CreateServiceAccountSecret(ctx context.Context, orgId string, clientId string, serviceAccountSecretRequest *ServiceAccountSecretRequest) CreateServiceAccountSecretApiRequest + /* + CreateServiceAccountSecret Create one Organization Service Account Secret + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param CreateServiceAccountSecretApiParams - Parameters for the request + @return CreateServiceAccountSecretApiRequest + */ + CreateServiceAccountSecretWithParams(ctx context.Context, args *CreateServiceAccountSecretApiParams) CreateServiceAccountSecretApiRequest + + // Method available only for mocking purposes + CreateServiceAccountSecretExecute(r CreateServiceAccountSecretApiRequest) (*ServiceAccountSecret, *http.Response, error) + + /* + DeleteProjectServiceAccount Unassign One Service Account from One Project + + Removes the specified Service Account from the specified project. The Service Account will still be a part of the Organization it was created in, and the credentials will remain active until expired or manually revoked. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @return DeleteProjectServiceAccountApiRequest + */ + DeleteProjectServiceAccount(ctx context.Context, clientId string, groupId string) DeleteProjectServiceAccountApiRequest + /* + DeleteProjectServiceAccount Unassign One Service Account from One Project + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param DeleteProjectServiceAccountApiParams - Parameters for the request + @return DeleteProjectServiceAccountApiRequest + */ + DeleteProjectServiceAccountWithParams(ctx context.Context, args *DeleteProjectServiceAccountApiParams) DeleteProjectServiceAccountApiRequest + + // Method available only for mocking purposes + DeleteProjectServiceAccountExecute(r DeleteProjectServiceAccountApiRequest) (any, *http.Response, error) + + /* + DeleteProjectServiceAccountAccessListEntry Remove One Access List entry from one Project Service Account + + Removes the specified access list entry from the specified Service Account for the project. You can't remove the requesting IP address from the access list. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @param ipAddress One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + @return DeleteProjectServiceAccountAccessListEntryApiRequest + */ + DeleteProjectServiceAccountAccessListEntry(ctx context.Context, groupId string, clientId string, ipAddress string) DeleteProjectServiceAccountAccessListEntryApiRequest + /* + DeleteProjectServiceAccountAccessListEntry Remove One Access List entry from one Project Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param DeleteProjectServiceAccountAccessListEntryApiParams - Parameters for the request + @return DeleteProjectServiceAccountAccessListEntryApiRequest + */ + DeleteProjectServiceAccountAccessListEntryWithParams(ctx context.Context, args *DeleteProjectServiceAccountAccessListEntryApiParams) DeleteProjectServiceAccountAccessListEntryApiRequest + + // Method available only for mocking purposes + DeleteProjectServiceAccountAccessListEntryExecute(r DeleteProjectServiceAccountAccessListEntryApiRequest) (*http.Response, error) + + /* + DeleteProjectServiceAccountSecret Delete one Project Service Account Secret + + Deletes the specified Service Account secret. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param secretId Unique 24-hexadecimal digit string that identifies the secret. + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @return DeleteProjectServiceAccountSecretApiRequest + */ + DeleteProjectServiceAccountSecret(ctx context.Context, clientId string, secretId string, groupId string) DeleteProjectServiceAccountSecretApiRequest + /* + DeleteProjectServiceAccountSecret Delete one Project Service Account Secret + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param DeleteProjectServiceAccountSecretApiParams - Parameters for the request + @return DeleteProjectServiceAccountSecretApiRequest + */ + DeleteProjectServiceAccountSecretWithParams(ctx context.Context, args *DeleteProjectServiceAccountSecretApiParams) DeleteProjectServiceAccountSecretApiRequest + + // Method available only for mocking purposes + DeleteProjectServiceAccountSecretExecute(r DeleteProjectServiceAccountSecretApiRequest) (*http.Response, error) + + /* + DeleteServiceAccount Delete one Organization Service Account + + Deletes the specified Service Account. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @return DeleteServiceAccountApiRequest + */ + DeleteServiceAccount(ctx context.Context, clientId string, orgId string) DeleteServiceAccountApiRequest + /* + DeleteServiceAccount Delete one Organization Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param DeleteServiceAccountApiParams - Parameters for the request + @return DeleteServiceAccountApiRequest + */ + DeleteServiceAccountWithParams(ctx context.Context, args *DeleteServiceAccountApiParams) DeleteServiceAccountApiRequest + + // Method available only for mocking purposes + DeleteServiceAccountExecute(r DeleteServiceAccountApiRequest) (*http.Response, error) + + /* + DeleteServiceAccountAccessListEntry Remove One Access List entry from one Organization Service Account + + Removes the specified access list entry from the specified Service Account for the organization. You can't remove the requesting IP address from the access list. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @param ipAddress One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + @return DeleteServiceAccountAccessListEntryApiRequest + */ + DeleteServiceAccountAccessListEntry(ctx context.Context, orgId string, clientId string, ipAddress string) DeleteServiceAccountAccessListEntryApiRequest + /* + DeleteServiceAccountAccessListEntry Remove One Access List entry from one Organization Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param DeleteServiceAccountAccessListEntryApiParams - Parameters for the request + @return DeleteServiceAccountAccessListEntryApiRequest + */ + DeleteServiceAccountAccessListEntryWithParams(ctx context.Context, args *DeleteServiceAccountAccessListEntryApiParams) DeleteServiceAccountAccessListEntryApiRequest + + // Method available only for mocking purposes + DeleteServiceAccountAccessListEntryExecute(r DeleteServiceAccountAccessListEntryApiRequest) (*http.Response, error) + + /* + DeleteServiceAccountSecret Delete a Organization Service Account Secret + + Deletes the specified Service Account secret. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param secretId Unique 24-hexadecimal digit string that identifies the secret. + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @return DeleteServiceAccountSecretApiRequest + */ + DeleteServiceAccountSecret(ctx context.Context, clientId string, secretId string, orgId string) DeleteServiceAccountSecretApiRequest + /* + DeleteServiceAccountSecret Delete a Organization Service Account Secret + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param DeleteServiceAccountSecretApiParams - Parameters for the request + @return DeleteServiceAccountSecretApiRequest + */ + DeleteServiceAccountSecretWithParams(ctx context.Context, args *DeleteServiceAccountSecretApiParams) DeleteServiceAccountSecretApiRequest + + // Method available only for mocking purposes + DeleteServiceAccountSecretExecute(r DeleteServiceAccountSecretApiRequest) (*http.Response, error) + + /* + GetProjectServiceAccount Get one Project Service Account + + Returns one Service Account in the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @return GetProjectServiceAccountApiRequest + */ + GetProjectServiceAccount(ctx context.Context, groupId string, clientId string) GetProjectServiceAccountApiRequest + /* + GetProjectServiceAccount Get one Project Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param GetProjectServiceAccountApiParams - Parameters for the request + @return GetProjectServiceAccountApiRequest + */ + GetProjectServiceAccountWithParams(ctx context.Context, args *GetProjectServiceAccountApiParams) GetProjectServiceAccountApiRequest + + // Method available only for mocking purposes + GetProjectServiceAccountExecute(r GetProjectServiceAccountApiRequest) (*GroupServiceAccount, *http.Response, error) + + /* + GetServiceAccount Get one Organization Service Account + + Returns the specified Service Account. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @return GetServiceAccountApiRequest + */ + GetServiceAccount(ctx context.Context, orgId string, clientId string) GetServiceAccountApiRequest + /* + GetServiceAccount Get one Organization Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param GetServiceAccountApiParams - Parameters for the request + @return GetServiceAccountApiRequest + */ + GetServiceAccountWithParams(ctx context.Context, args *GetServiceAccountApiParams) GetServiceAccountApiRequest + + // Method available only for mocking purposes + GetServiceAccountExecute(r GetServiceAccountApiRequest) (*OrgServiceAccount, *http.Response, error) + + /* + ListProjectServiceAccountAccessList Return All Access List entries for one Project Service Account + + Returns all access list entries that you configured for the specified Service Account for the project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @return ListProjectServiceAccountAccessListApiRequest + */ + ListProjectServiceAccountAccessList(ctx context.Context, groupId string, clientId string) ListProjectServiceAccountAccessListApiRequest + /* + ListProjectServiceAccountAccessList Return All Access List entries for one Project Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ListProjectServiceAccountAccessListApiParams - Parameters for the request + @return ListProjectServiceAccountAccessListApiRequest + */ + ListProjectServiceAccountAccessListWithParams(ctx context.Context, args *ListProjectServiceAccountAccessListApiParams) ListProjectServiceAccountAccessListApiRequest + + // Method available only for mocking purposes + ListProjectServiceAccountAccessListExecute(r ListProjectServiceAccountAccessListApiRequest) (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) + + /* + ListProjectServiceAccounts List All Project Service Accounts + + Returns all Service Accounts for the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @return ListProjectServiceAccountsApiRequest + */ + ListProjectServiceAccounts(ctx context.Context, groupId string) ListProjectServiceAccountsApiRequest + /* + ListProjectServiceAccounts List All Project Service Accounts + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ListProjectServiceAccountsApiParams - Parameters for the request + @return ListProjectServiceAccountsApiRequest + */ + ListProjectServiceAccountsWithParams(ctx context.Context, args *ListProjectServiceAccountsApiParams) ListProjectServiceAccountsApiRequest + + // Method available only for mocking purposes + ListProjectServiceAccountsExecute(r ListProjectServiceAccountsApiRequest) (*PaginatedGroupServiceAccounts, *http.Response, error) + + /* + ListServiceAccountAccessList Return All Access List entries for one Organization Service Account + + Returns all access list entries that you configured for the specified Service Account for the organization. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @return ListServiceAccountAccessListApiRequest + */ + ListServiceAccountAccessList(ctx context.Context, orgId string, clientId string) ListServiceAccountAccessListApiRequest + /* + ListServiceAccountAccessList Return All Access List entries for one Organization Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ListServiceAccountAccessListApiParams - Parameters for the request + @return ListServiceAccountAccessListApiRequest + */ + ListServiceAccountAccessListWithParams(ctx context.Context, args *ListServiceAccountAccessListApiParams) ListServiceAccountAccessListApiRequest + + // Method available only for mocking purposes + ListServiceAccountAccessListExecute(r ListServiceAccountAccessListApiRequest) (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) + + /* + ListServiceAccountProjects Return All Service Account Project assignments + + Returns a list of all projects the specified Service Account is a part of. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @return ListServiceAccountProjectsApiRequest + */ + ListServiceAccountProjects(ctx context.Context, orgId string, clientId string) ListServiceAccountProjectsApiRequest + /* + ListServiceAccountProjects Return All Service Account Project assignments + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ListServiceAccountProjectsApiParams - Parameters for the request + @return ListServiceAccountProjectsApiRequest + */ + ListServiceAccountProjectsWithParams(ctx context.Context, args *ListServiceAccountProjectsApiParams) ListServiceAccountProjectsApiRequest + + // Method available only for mocking purposes + ListServiceAccountProjectsExecute(r ListServiceAccountProjectsApiRequest) (*PaginatedServiceAccountGroup, *http.Response, error) + + /* + ListServiceAccounts List All Organization Service Accounts + + Returns all Service Accounts for the specified Organization. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @return ListServiceAccountsApiRequest + */ + ListServiceAccounts(ctx context.Context, orgId string) ListServiceAccountsApiRequest + /* + ListServiceAccounts List All Organization Service Accounts + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ListServiceAccountsApiParams - Parameters for the request + @return ListServiceAccountsApiRequest + */ + ListServiceAccountsWithParams(ctx context.Context, args *ListServiceAccountsApiParams) ListServiceAccountsApiRequest + + // Method available only for mocking purposes + ListServiceAccountsExecute(r ListServiceAccountsApiRequest) (*PaginatedOrgServiceAccounts, *http.Response, error) + + /* + UpdateProjectServiceAccount Update one Project Service Account + + Updates one Service Account in the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param groupServiceAccountUpdateRequest The new details for the Service Account. + @return UpdateProjectServiceAccountApiRequest + */ + UpdateProjectServiceAccount(ctx context.Context, clientId string, groupId string, groupServiceAccountUpdateRequest *GroupServiceAccountUpdateRequest) UpdateProjectServiceAccountApiRequest + /* + UpdateProjectServiceAccount Update one Project Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param UpdateProjectServiceAccountApiParams - Parameters for the request + @return UpdateProjectServiceAccountApiRequest + */ + UpdateProjectServiceAccountWithParams(ctx context.Context, args *UpdateProjectServiceAccountApiParams) UpdateProjectServiceAccountApiRequest + + // Method available only for mocking purposes + UpdateProjectServiceAccountExecute(r UpdateProjectServiceAccountApiRequest) (*GroupServiceAccount, *http.Response, error) + + /* + UpdateServiceAccount Update one Organization Service Account + + Updates the specified Service Account in the specified Organization. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param orgServiceAccountUpdateRequest The new details for the Service Account. + @return UpdateServiceAccountApiRequest + */ + UpdateServiceAccount(ctx context.Context, clientId string, orgId string, orgServiceAccountUpdateRequest *OrgServiceAccountUpdateRequest) UpdateServiceAccountApiRequest + /* + UpdateServiceAccount Update one Organization Service Account + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param UpdateServiceAccountApiParams - Parameters for the request + @return UpdateServiceAccountApiRequest + */ + UpdateServiceAccountWithParams(ctx context.Context, args *UpdateServiceAccountApiParams) UpdateServiceAccountApiRequest + + // Method available only for mocking purposes + UpdateServiceAccountExecute(r UpdateServiceAccountApiRequest) (*OrgServiceAccount, *http.Response, error) +} + +// ServiceAccountsApiService ServiceAccountsApi service +type ServiceAccountsApiService service + +type AddProjectServiceAccountApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + clientId string + groupId string + groupServiceAccountRoleAssignment *[]GroupServiceAccountRoleAssignment +} + +type AddProjectServiceAccountApiParams struct { + ClientId string + GroupId string + GroupServiceAccountRoleAssignment *[]GroupServiceAccountRoleAssignment +} + +func (a *ServiceAccountsApiService) AddProjectServiceAccountWithParams(ctx context.Context, args *AddProjectServiceAccountApiParams) AddProjectServiceAccountApiRequest { + return AddProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: args.ClientId, + groupId: args.GroupId, + groupServiceAccountRoleAssignment: args.GroupServiceAccountRoleAssignment, + } +} + +func (r AddProjectServiceAccountApiRequest) Execute() (*GroupServiceAccount, *http.Response, error) { + return r.ApiService.AddProjectServiceAccountExecute(r) +} + +/* +AddProjectServiceAccount Assign One Service Account to One Project + +Assigns the specified Service Account to the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @return AddProjectServiceAccountApiRequest +*/ +func (a *ServiceAccountsApiService) AddProjectServiceAccount(ctx context.Context, clientId string, groupId string, groupServiceAccountRoleAssignment *[]GroupServiceAccountRoleAssignment) AddProjectServiceAccountApiRequest { + return AddProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + groupId: groupId, + groupServiceAccountRoleAssignment: groupServiceAccountRoleAssignment, + } +} + +// AddProjectServiceAccountExecute executes the request +// +// @return GroupServiceAccount +func (a *ServiceAccountsApiService) AddProjectServiceAccountExecute(r AddProjectServiceAccountApiRequest) (*GroupServiceAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *GroupServiceAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.AddProjectServiceAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupServiceAccountRoleAssignment == nil { + return localVarReturnValue, nil, reportError("groupServiceAccountRoleAssignment is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-08-05+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupServiceAccountRoleAssignment + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type CreateProjectServiceAccountApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + groupId string + groupServiceAccountRequest *GroupServiceAccountRequest +} + +type CreateProjectServiceAccountApiParams struct { + GroupId string + GroupServiceAccountRequest *GroupServiceAccountRequest +} + +func (a *ServiceAccountsApiService) CreateProjectServiceAccountWithParams(ctx context.Context, args *CreateProjectServiceAccountApiParams) CreateProjectServiceAccountApiRequest { + return CreateProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + groupServiceAccountRequest: args.GroupServiceAccountRequest, + } +} + +func (r CreateProjectServiceAccountApiRequest) Execute() (*GroupServiceAccount, *http.Response, error) { + return r.ApiService.CreateProjectServiceAccountExecute(r) +} + +/* +CreateProjectServiceAccount Create and Assign one Service Account to one Project + +Creates one Service Account for the specified Project. The Service Account will automatically be added as an Organization Member to the Organization that the specified Project is a part of. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @return CreateProjectServiceAccountApiRequest +*/ +func (a *ServiceAccountsApiService) CreateProjectServiceAccount(ctx context.Context, groupId string, groupServiceAccountRequest *GroupServiceAccountRequest) CreateProjectServiceAccountApiRequest { + return CreateProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + groupServiceAccountRequest: groupServiceAccountRequest, + } +} + +// CreateProjectServiceAccountExecute executes the request +// +// @return GroupServiceAccount +func (a *ServiceAccountsApiService) CreateProjectServiceAccountExecute(r CreateProjectServiceAccountApiRequest) (*GroupServiceAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *GroupServiceAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.CreateProjectServiceAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupServiceAccountRequest == nil { + return localVarReturnValue, nil, reportError("groupServiceAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-08-05+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupServiceAccountRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type CreateProjectServiceAccountAccessListApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + groupId string + clientId string + serviceAccountIPAccessListEntry *[]ServiceAccountIPAccessListEntry + includeCount *bool + itemsPerPage *int + pageNum *int +} + +type CreateProjectServiceAccountAccessListApiParams struct { + GroupId string + ClientId string + ServiceAccountIPAccessListEntry *[]ServiceAccountIPAccessListEntry + IncludeCount *bool + ItemsPerPage *int + PageNum *int +} + +func (a *ServiceAccountsApiService) CreateProjectServiceAccountAccessListWithParams(ctx context.Context, args *CreateProjectServiceAccountAccessListApiParams) CreateProjectServiceAccountAccessListApiRequest { + return CreateProjectServiceAccountAccessListApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + clientId: args.ClientId, + serviceAccountIPAccessListEntry: args.ServiceAccountIPAccessListEntry, + includeCount: args.IncludeCount, + itemsPerPage: args.ItemsPerPage, + pageNum: args.PageNum, + } +} + +// Flag that indicates whether the response returns the total number of items (**totalCount**) in the response. +func (r CreateProjectServiceAccountAccessListApiRequest) IncludeCount(includeCount bool) CreateProjectServiceAccountAccessListApiRequest { + r.includeCount = &includeCount + return r +} + +// Number of items that the response returns per page. +func (r CreateProjectServiceAccountAccessListApiRequest) ItemsPerPage(itemsPerPage int) CreateProjectServiceAccountAccessListApiRequest { + r.itemsPerPage = &itemsPerPage + return r +} + +// Number of the page that displays the current set of the total objects that the response returns. +func (r CreateProjectServiceAccountAccessListApiRequest) PageNum(pageNum int) CreateProjectServiceAccountAccessListApiRequest { + r.pageNum = &pageNum + return r +} + +func (r CreateProjectServiceAccountAccessListApiRequest) Execute() (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + return r.ApiService.CreateProjectServiceAccountAccessListExecute(r) +} + +/* +CreateProjectServiceAccountAccessList Add Access List entries for one Project Service Account + +Add Access List Entries for the specified Service Account for the project. Resources require all API requests to originate from IP addresses on the API access list. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @return CreateProjectServiceAccountAccessListApiRequest +*/ +func (a *ServiceAccountsApiService) CreateProjectServiceAccountAccessList(ctx context.Context, groupId string, clientId string, serviceAccountIPAccessListEntry *[]ServiceAccountIPAccessListEntry) CreateProjectServiceAccountAccessListApiRequest { + return CreateProjectServiceAccountAccessListApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + clientId: clientId, + serviceAccountIPAccessListEntry: serviceAccountIPAccessListEntry, + } +} + +// CreateProjectServiceAccountAccessListExecute executes the request +// +// @return PaginatedServiceAccountIPAccessEntry +func (a *ServiceAccountsApiService) CreateProjectServiceAccountAccessListExecute(r CreateProjectServiceAccountAccessListApiRequest) (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *PaginatedServiceAccountIPAccessEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.CreateProjectServiceAccountAccessList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceAccountIPAccessListEntry == nil { + return localVarReturnValue, nil, reportError("serviceAccountIPAccessListEntry is required and must be specified") + } + + if r.includeCount != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "includeCount", r.includeCount, "") + } else { + var defaultValue bool = true + r.includeCount = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "includeCount", r.includeCount, "") + } + if r.itemsPerPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } else { + var defaultValue int = 100 + r.itemsPerPage = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } + if r.pageNum != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } else { + var defaultValue int = 1 + r.pageNum = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-08-05+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceAccountIPAccessListEntry + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type CreateProjectServiceAccountSecretApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + groupId string + clientId string + serviceAccountSecretRequest *ServiceAccountSecretRequest +} + +type CreateProjectServiceAccountSecretApiParams struct { + GroupId string + ClientId string + ServiceAccountSecretRequest *ServiceAccountSecretRequest +} + +func (a *ServiceAccountsApiService) CreateProjectServiceAccountSecretWithParams(ctx context.Context, args *CreateProjectServiceAccountSecretApiParams) CreateProjectServiceAccountSecretApiRequest { + return CreateProjectServiceAccountSecretApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + clientId: args.ClientId, + serviceAccountSecretRequest: args.ServiceAccountSecretRequest, + } +} + +func (r CreateProjectServiceAccountSecretApiRequest) Execute() (*ServiceAccountSecret, *http.Response, error) { + return r.ApiService.CreateProjectServiceAccountSecretExecute(r) +} + +/* +CreateProjectServiceAccountSecret Create one Project Service Account Secret + +Create a secret for the specified Service Account in the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @return CreateProjectServiceAccountSecretApiRequest +*/ +func (a *ServiceAccountsApiService) CreateProjectServiceAccountSecret(ctx context.Context, groupId string, clientId string, serviceAccountSecretRequest *ServiceAccountSecretRequest) CreateProjectServiceAccountSecretApiRequest { + return CreateProjectServiceAccountSecretApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + clientId: clientId, + serviceAccountSecretRequest: serviceAccountSecretRequest, + } +} + +// CreateProjectServiceAccountSecretExecute executes the request +// +// @return ServiceAccountSecret +func (a *ServiceAccountsApiService) CreateProjectServiceAccountSecretExecute(r CreateProjectServiceAccountSecretApiRequest) (*ServiceAccountSecret, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *ServiceAccountSecret + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.CreateProjectServiceAccountSecret") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceAccountSecretRequest == nil { + return localVarReturnValue, nil, reportError("serviceAccountSecretRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-08-05+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceAccountSecretRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type CreateServiceAccountApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + orgId string + orgServiceAccountRequest *OrgServiceAccountRequest +} + +type CreateServiceAccountApiParams struct { + OrgId string + OrgServiceAccountRequest *OrgServiceAccountRequest +} + +func (a *ServiceAccountsApiService) CreateServiceAccountWithParams(ctx context.Context, args *CreateServiceAccountApiParams) CreateServiceAccountApiRequest { + return CreateServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + orgServiceAccountRequest: args.OrgServiceAccountRequest, + } +} + +func (r CreateServiceAccountApiRequest) Execute() (*OrgServiceAccount, *http.Response, error) { + return r.ApiService.CreateServiceAccountExecute(r) +} + +/* +CreateServiceAccount Create one Organization Service Account + +Creates one Service Account for the specified Organization. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @return CreateServiceAccountApiRequest +*/ +func (a *ServiceAccountsApiService) CreateServiceAccount(ctx context.Context, orgId string, orgServiceAccountRequest *OrgServiceAccountRequest) CreateServiceAccountApiRequest { + return CreateServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + orgServiceAccountRequest: orgServiceAccountRequest, + } +} + +// CreateServiceAccountExecute executes the request +// +// @return OrgServiceAccount +func (a *ServiceAccountsApiService) CreateServiceAccountExecute(r CreateServiceAccountApiRequest) (*OrgServiceAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *OrgServiceAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.CreateServiceAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.orgServiceAccountRequest == nil { + return localVarReturnValue, nil, reportError("orgServiceAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-08-05+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.orgServiceAccountRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type CreateServiceAccountAccessListApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + orgId string + clientId string + serviceAccountIPAccessListEntry *[]ServiceAccountIPAccessListEntry + includeCount *bool + itemsPerPage *int + pageNum *int +} + +type CreateServiceAccountAccessListApiParams struct { + OrgId string + ClientId string + ServiceAccountIPAccessListEntry *[]ServiceAccountIPAccessListEntry + IncludeCount *bool + ItemsPerPage *int + PageNum *int +} + +func (a *ServiceAccountsApiService) CreateServiceAccountAccessListWithParams(ctx context.Context, args *CreateServiceAccountAccessListApiParams) CreateServiceAccountAccessListApiRequest { + return CreateServiceAccountAccessListApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + clientId: args.ClientId, + serviceAccountIPAccessListEntry: args.ServiceAccountIPAccessListEntry, + includeCount: args.IncludeCount, + itemsPerPage: args.ItemsPerPage, + pageNum: args.PageNum, + } +} + +// Flag that indicates whether the response returns the total number of items (**totalCount**) in the response. +func (r CreateServiceAccountAccessListApiRequest) IncludeCount(includeCount bool) CreateServiceAccountAccessListApiRequest { + r.includeCount = &includeCount + return r +} + +// Number of items that the response returns per page. +func (r CreateServiceAccountAccessListApiRequest) ItemsPerPage(itemsPerPage int) CreateServiceAccountAccessListApiRequest { + r.itemsPerPage = &itemsPerPage + return r +} + +// Number of the page that displays the current set of the total objects that the response returns. +func (r CreateServiceAccountAccessListApiRequest) PageNum(pageNum int) CreateServiceAccountAccessListApiRequest { + r.pageNum = &pageNum + return r +} + +func (r CreateServiceAccountAccessListApiRequest) Execute() (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + return r.ApiService.CreateServiceAccountAccessListExecute(r) +} + +/* +CreateServiceAccountAccessList Add Access List entries for one Organization Service Account + +Add Access List Entries for the specified Service Account for the organization. Resources require all API requests to originate from IP addresses on the API access list. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @return CreateServiceAccountAccessListApiRequest +*/ +func (a *ServiceAccountsApiService) CreateServiceAccountAccessList(ctx context.Context, orgId string, clientId string, serviceAccountIPAccessListEntry *[]ServiceAccountIPAccessListEntry) CreateServiceAccountAccessListApiRequest { + return CreateServiceAccountAccessListApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + clientId: clientId, + serviceAccountIPAccessListEntry: serviceAccountIPAccessListEntry, + } +} + +// CreateServiceAccountAccessListExecute executes the request +// +// @return PaginatedServiceAccountIPAccessEntry +func (a *ServiceAccountsApiService) CreateServiceAccountAccessListExecute(r CreateServiceAccountAccessListApiRequest) (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *PaginatedServiceAccountIPAccessEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.CreateServiceAccountAccessList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceAccountIPAccessListEntry == nil { + return localVarReturnValue, nil, reportError("serviceAccountIPAccessListEntry is required and must be specified") + } + + if r.includeCount != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "includeCount", r.includeCount, "") + } else { + var defaultValue bool = true + r.includeCount = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "includeCount", r.includeCount, "") + } + if r.itemsPerPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } else { + var defaultValue int = 100 + r.itemsPerPage = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } + if r.pageNum != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } else { + var defaultValue int = 1 + r.pageNum = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-08-05+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceAccountIPAccessListEntry + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type CreateServiceAccountSecretApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + orgId string + clientId string + serviceAccountSecretRequest *ServiceAccountSecretRequest +} + +type CreateServiceAccountSecretApiParams struct { + OrgId string + ClientId string + ServiceAccountSecretRequest *ServiceAccountSecretRequest +} + +func (a *ServiceAccountsApiService) CreateServiceAccountSecretWithParams(ctx context.Context, args *CreateServiceAccountSecretApiParams) CreateServiceAccountSecretApiRequest { + return CreateServiceAccountSecretApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + clientId: args.ClientId, + serviceAccountSecretRequest: args.ServiceAccountSecretRequest, + } +} + +func (r CreateServiceAccountSecretApiRequest) Execute() (*ServiceAccountSecret, *http.Response, error) { + return r.ApiService.CreateServiceAccountSecretExecute(r) +} + +/* +CreateServiceAccountSecret Create one Organization Service Account Secret + +Create a secret for the specified Service Account. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @return CreateServiceAccountSecretApiRequest +*/ +func (a *ServiceAccountsApiService) CreateServiceAccountSecret(ctx context.Context, orgId string, clientId string, serviceAccountSecretRequest *ServiceAccountSecretRequest) CreateServiceAccountSecretApiRequest { + return CreateServiceAccountSecretApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + clientId: clientId, + serviceAccountSecretRequest: serviceAccountSecretRequest, + } +} + +// CreateServiceAccountSecretExecute executes the request +// +// @return ServiceAccountSecret +func (a *ServiceAccountsApiService) CreateServiceAccountSecretExecute(r CreateServiceAccountSecretApiRequest) (*ServiceAccountSecret, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *ServiceAccountSecret + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.CreateServiceAccountSecret") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.serviceAccountSecretRequest == nil { + return localVarReturnValue, nil, reportError("serviceAccountSecretRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-08-05+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.serviceAccountSecretRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type DeleteProjectServiceAccountApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + clientId string + groupId string +} + +type DeleteProjectServiceAccountApiParams struct { + ClientId string + GroupId string +} + +func (a *ServiceAccountsApiService) DeleteProjectServiceAccountWithParams(ctx context.Context, args *DeleteProjectServiceAccountApiParams) DeleteProjectServiceAccountApiRequest { + return DeleteProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: args.ClientId, + groupId: args.GroupId, + } +} + +func (r DeleteProjectServiceAccountApiRequest) Execute() (any, *http.Response, error) { + return r.ApiService.DeleteProjectServiceAccountExecute(r) +} + +/* +DeleteProjectServiceAccount Unassign One Service Account from One Project + +Removes the specified Service Account from the specified project. The Service Account will still be a part of the Organization it was created in, and the credentials will remain active until expired or manually revoked. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @return DeleteProjectServiceAccountApiRequest +*/ +func (a *ServiceAccountsApiService) DeleteProjectServiceAccount(ctx context.Context, clientId string, groupId string) DeleteProjectServiceAccountApiRequest { + return DeleteProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + groupId: groupId, + } +} + +// DeleteProjectServiceAccountExecute executes the request +// +// @return any +func (a *ServiceAccountsApiService) DeleteProjectServiceAccountExecute(r DeleteProjectServiceAccountApiRequest) (any, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + localVarReturnValue any + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.DeleteProjectServiceAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type DeleteProjectServiceAccountAccessListEntryApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + groupId string + clientId string + ipAddress string +} + +type DeleteProjectServiceAccountAccessListEntryApiParams struct { + GroupId string + ClientId string + IpAddress string +} + +func (a *ServiceAccountsApiService) DeleteProjectServiceAccountAccessListEntryWithParams(ctx context.Context, args *DeleteProjectServiceAccountAccessListEntryApiParams) DeleteProjectServiceAccountAccessListEntryApiRequest { + return DeleteProjectServiceAccountAccessListEntryApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + clientId: args.ClientId, + ipAddress: args.IpAddress, + } +} + +func (r DeleteProjectServiceAccountAccessListEntryApiRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteProjectServiceAccountAccessListEntryExecute(r) +} + +/* +DeleteProjectServiceAccountAccessListEntry Remove One Access List entry from one Project Service Account + +Removes the specified access list entry from the specified Service Account for the project. You can't remove the requesting IP address from the access list. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @param ipAddress One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + @return DeleteProjectServiceAccountAccessListEntryApiRequest +*/ +func (a *ServiceAccountsApiService) DeleteProjectServiceAccountAccessListEntry(ctx context.Context, groupId string, clientId string, ipAddress string) DeleteProjectServiceAccountAccessListEntryApiRequest { + return DeleteProjectServiceAccountAccessListEntryApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + clientId: clientId, + ipAddress: ipAddress, + } +} + +// DeleteProjectServiceAccountAccessListEntryExecute executes the request +func (a *ServiceAccountsApiService) DeleteProjectServiceAccountAccessListEntryExecute(r DeleteProjectServiceAccountAccessListEntryApiRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.DeleteProjectServiceAccountAccessListEntry") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress}" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"ipAddress"+"}", url.PathEscape(r.ipAddress), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type DeleteProjectServiceAccountSecretApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + clientId string + secretId string + groupId string +} + +type DeleteProjectServiceAccountSecretApiParams struct { + ClientId string + SecretId string + GroupId string +} + +func (a *ServiceAccountsApiService) DeleteProjectServiceAccountSecretWithParams(ctx context.Context, args *DeleteProjectServiceAccountSecretApiParams) DeleteProjectServiceAccountSecretApiRequest { + return DeleteProjectServiceAccountSecretApiRequest{ + ApiService: a, + ctx: ctx, + clientId: args.ClientId, + secretId: args.SecretId, + groupId: args.GroupId, + } +} + +func (r DeleteProjectServiceAccountSecretApiRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteProjectServiceAccountSecretExecute(r) +} + +/* +DeleteProjectServiceAccountSecret Delete one Project Service Account Secret + +Deletes the specified Service Account secret. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param secretId Unique 24-hexadecimal digit string that identifies the secret. + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @return DeleteProjectServiceAccountSecretApiRequest +*/ +func (a *ServiceAccountsApiService) DeleteProjectServiceAccountSecret(ctx context.Context, clientId string, secretId string, groupId string) DeleteProjectServiceAccountSecretApiRequest { + return DeleteProjectServiceAccountSecretApiRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + secretId: secretId, + groupId: groupId, + } +} + +// DeleteProjectServiceAccountSecretExecute executes the request +func (a *ServiceAccountsApiService) DeleteProjectServiceAccountSecretExecute(r DeleteProjectServiceAccountSecretApiRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.DeleteProjectServiceAccountSecret") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"secretId"+"}", url.PathEscape(r.secretId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type DeleteServiceAccountApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + clientId string + orgId string +} + +type DeleteServiceAccountApiParams struct { + ClientId string + OrgId string +} + +func (a *ServiceAccountsApiService) DeleteServiceAccountWithParams(ctx context.Context, args *DeleteServiceAccountApiParams) DeleteServiceAccountApiRequest { + return DeleteServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: args.ClientId, + orgId: args.OrgId, + } +} + +func (r DeleteServiceAccountApiRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteServiceAccountExecute(r) +} + +/* +DeleteServiceAccount Delete one Organization Service Account + +Deletes the specified Service Account. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @return DeleteServiceAccountApiRequest +*/ +func (a *ServiceAccountsApiService) DeleteServiceAccount(ctx context.Context, clientId string, orgId string) DeleteServiceAccountApiRequest { + return DeleteServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + orgId: orgId, + } +} + +// DeleteServiceAccountExecute executes the request +func (a *ServiceAccountsApiService) DeleteServiceAccountExecute(r DeleteServiceAccountApiRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.DeleteServiceAccount") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type DeleteServiceAccountAccessListEntryApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + orgId string + clientId string + ipAddress string +} + +type DeleteServiceAccountAccessListEntryApiParams struct { + OrgId string + ClientId string + IpAddress string +} + +func (a *ServiceAccountsApiService) DeleteServiceAccountAccessListEntryWithParams(ctx context.Context, args *DeleteServiceAccountAccessListEntryApiParams) DeleteServiceAccountAccessListEntryApiRequest { + return DeleteServiceAccountAccessListEntryApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + clientId: args.ClientId, + ipAddress: args.IpAddress, + } +} + +func (r DeleteServiceAccountAccessListEntryApiRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteServiceAccountAccessListEntryExecute(r) +} + +/* +DeleteServiceAccountAccessListEntry Remove One Access List entry from one Organization Service Account + +Removes the specified access list entry from the specified Service Account for the organization. You can't remove the requesting IP address from the access list. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @param ipAddress One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + @return DeleteServiceAccountAccessListEntryApiRequest +*/ +func (a *ServiceAccountsApiService) DeleteServiceAccountAccessListEntry(ctx context.Context, orgId string, clientId string, ipAddress string) DeleteServiceAccountAccessListEntryApiRequest { + return DeleteServiceAccountAccessListEntryApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + clientId: clientId, + ipAddress: ipAddress, + } +} + +// DeleteServiceAccountAccessListEntryExecute executes the request +func (a *ServiceAccountsApiService) DeleteServiceAccountAccessListEntryExecute(r DeleteServiceAccountAccessListEntryApiRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.DeleteServiceAccountAccessListEntry") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress}" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"ipAddress"+"}", url.PathEscape(r.ipAddress), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type DeleteServiceAccountSecretApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + clientId string + secretId string + orgId string +} + +type DeleteServiceAccountSecretApiParams struct { + ClientId string + SecretId string + OrgId string +} + +func (a *ServiceAccountsApiService) DeleteServiceAccountSecretWithParams(ctx context.Context, args *DeleteServiceAccountSecretApiParams) DeleteServiceAccountSecretApiRequest { + return DeleteServiceAccountSecretApiRequest{ + ApiService: a, + ctx: ctx, + clientId: args.ClientId, + secretId: args.SecretId, + orgId: args.OrgId, + } +} + +func (r DeleteServiceAccountSecretApiRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteServiceAccountSecretExecute(r) +} + +/* +DeleteServiceAccountSecret Delete a Organization Service Account Secret + +Deletes the specified Service Account secret. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param secretId Unique 24-hexadecimal digit string that identifies the secret. + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @return DeleteServiceAccountSecretApiRequest +*/ +func (a *ServiceAccountsApiService) DeleteServiceAccountSecret(ctx context.Context, clientId string, secretId string, orgId string) DeleteServiceAccountSecretApiRequest { + return DeleteServiceAccountSecretApiRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + secretId: secretId, + orgId: orgId, + } +} + +// DeleteServiceAccountSecretExecute executes the request +func (a *ServiceAccountsApiService) DeleteServiceAccountSecretExecute(r DeleteServiceAccountSecretApiRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.DeleteServiceAccountSecret") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"secretId"+"}", url.PathEscape(r.secretId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type GetProjectServiceAccountApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + groupId string + clientId string +} + +type GetProjectServiceAccountApiParams struct { + GroupId string + ClientId string +} + +func (a *ServiceAccountsApiService) GetProjectServiceAccountWithParams(ctx context.Context, args *GetProjectServiceAccountApiParams) GetProjectServiceAccountApiRequest { + return GetProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + clientId: args.ClientId, + } +} + +func (r GetProjectServiceAccountApiRequest) Execute() (*GroupServiceAccount, *http.Response, error) { + return r.ApiService.GetProjectServiceAccountExecute(r) +} + +/* +GetProjectServiceAccount Get one Project Service Account + +Returns one Service Account in the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @return GetProjectServiceAccountApiRequest +*/ +func (a *ServiceAccountsApiService) GetProjectServiceAccount(ctx context.Context, groupId string, clientId string) GetProjectServiceAccountApiRequest { + return GetProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + clientId: clientId, + } +} + +// GetProjectServiceAccountExecute executes the request +// +// @return GroupServiceAccount +func (a *ServiceAccountsApiService) GetProjectServiceAccountExecute(r GetProjectServiceAccountApiRequest) (*GroupServiceAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *GroupServiceAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.GetProjectServiceAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type GetServiceAccountApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + orgId string + clientId string +} + +type GetServiceAccountApiParams struct { + OrgId string + ClientId string +} + +func (a *ServiceAccountsApiService) GetServiceAccountWithParams(ctx context.Context, args *GetServiceAccountApiParams) GetServiceAccountApiRequest { + return GetServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + clientId: args.ClientId, + } +} + +func (r GetServiceAccountApiRequest) Execute() (*OrgServiceAccount, *http.Response, error) { + return r.ApiService.GetServiceAccountExecute(r) +} + +/* +GetServiceAccount Get one Organization Service Account + +Returns the specified Service Account. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @return GetServiceAccountApiRequest +*/ +func (a *ServiceAccountsApiService) GetServiceAccount(ctx context.Context, orgId string, clientId string) GetServiceAccountApiRequest { + return GetServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + clientId: clientId, + } +} + +// GetServiceAccountExecute executes the request +// +// @return OrgServiceAccount +func (a *ServiceAccountsApiService) GetServiceAccountExecute(r GetServiceAccountApiRequest) (*OrgServiceAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *OrgServiceAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.GetServiceAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ListProjectServiceAccountAccessListApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + groupId string + clientId string + includeCount *bool + itemsPerPage *int + pageNum *int +} + +type ListProjectServiceAccountAccessListApiParams struct { + GroupId string + ClientId string + IncludeCount *bool + ItemsPerPage *int + PageNum *int +} + +func (a *ServiceAccountsApiService) ListProjectServiceAccountAccessListWithParams(ctx context.Context, args *ListProjectServiceAccountAccessListApiParams) ListProjectServiceAccountAccessListApiRequest { + return ListProjectServiceAccountAccessListApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + clientId: args.ClientId, + includeCount: args.IncludeCount, + itemsPerPage: args.ItemsPerPage, + pageNum: args.PageNum, + } +} + +// Flag that indicates whether the response returns the total number of items (**totalCount**) in the response. +func (r ListProjectServiceAccountAccessListApiRequest) IncludeCount(includeCount bool) ListProjectServiceAccountAccessListApiRequest { + r.includeCount = &includeCount + return r +} + +// Number of items that the response returns per page. +func (r ListProjectServiceAccountAccessListApiRequest) ItemsPerPage(itemsPerPage int) ListProjectServiceAccountAccessListApiRequest { + r.itemsPerPage = &itemsPerPage + return r +} + +// Number of the page that displays the current set of the total objects that the response returns. +func (r ListProjectServiceAccountAccessListApiRequest) PageNum(pageNum int) ListProjectServiceAccountAccessListApiRequest { + r.pageNum = &pageNum + return r +} + +func (r ListProjectServiceAccountAccessListApiRequest) Execute() (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + return r.ApiService.ListProjectServiceAccountAccessListExecute(r) +} + +/* +ListProjectServiceAccountAccessList Return All Access List entries for one Project Service Account + +Returns all access list entries that you configured for the specified Service Account for the project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @param clientId The Client ID of the Service Account. + @return ListProjectServiceAccountAccessListApiRequest +*/ +func (a *ServiceAccountsApiService) ListProjectServiceAccountAccessList(ctx context.Context, groupId string, clientId string) ListProjectServiceAccountAccessListApiRequest { + return ListProjectServiceAccountAccessListApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + clientId: clientId, + } +} + +// ListProjectServiceAccountAccessListExecute executes the request +// +// @return PaginatedServiceAccountIPAccessEntry +func (a *ServiceAccountsApiService) ListProjectServiceAccountAccessListExecute(r ListProjectServiceAccountAccessListApiRequest) (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *PaginatedServiceAccountIPAccessEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.ListProjectServiceAccountAccessList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.includeCount != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "includeCount", r.includeCount, "") + } else { + var defaultValue bool = true + r.includeCount = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "includeCount", r.includeCount, "") + } + if r.itemsPerPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } else { + var defaultValue int = 100 + r.itemsPerPage = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } + if r.pageNum != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } else { + var defaultValue int = 1 + r.pageNum = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ListProjectServiceAccountsApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + groupId string + itemsPerPage *int + pageNum *int +} + +type ListProjectServiceAccountsApiParams struct { + GroupId string + ItemsPerPage *int + PageNum *int +} + +func (a *ServiceAccountsApiService) ListProjectServiceAccountsWithParams(ctx context.Context, args *ListProjectServiceAccountsApiParams) ListProjectServiceAccountsApiRequest { + return ListProjectServiceAccountsApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + itemsPerPage: args.ItemsPerPage, + pageNum: args.PageNum, + } +} + +// Number of items that the response returns per page. +func (r ListProjectServiceAccountsApiRequest) ItemsPerPage(itemsPerPage int) ListProjectServiceAccountsApiRequest { + r.itemsPerPage = &itemsPerPage + return r +} + +// Number of the page that displays the current set of the total objects that the response returns. +func (r ListProjectServiceAccountsApiRequest) PageNum(pageNum int) ListProjectServiceAccountsApiRequest { + r.pageNum = &pageNum + return r +} + +func (r ListProjectServiceAccountsApiRequest) Execute() (*PaginatedGroupServiceAccounts, *http.Response, error) { + return r.ApiService.ListProjectServiceAccountsExecute(r) +} + +/* +ListProjectServiceAccounts List All Project Service Accounts + +Returns all Service Accounts for the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @return ListProjectServiceAccountsApiRequest +*/ +func (a *ServiceAccountsApiService) ListProjectServiceAccounts(ctx context.Context, groupId string) ListProjectServiceAccountsApiRequest { + return ListProjectServiceAccountsApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + } +} + +// ListProjectServiceAccountsExecute executes the request +// +// @return PaginatedGroupServiceAccounts +func (a *ServiceAccountsApiService) ListProjectServiceAccountsExecute(r ListProjectServiceAccountsApiRequest) (*PaginatedGroupServiceAccounts, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *PaginatedGroupServiceAccounts + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.ListProjectServiceAccounts") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.itemsPerPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } else { + var defaultValue int = 100 + r.itemsPerPage = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } + if r.pageNum != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } else { + var defaultValue int = 1 + r.pageNum = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ListServiceAccountAccessListApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + orgId string + clientId string + includeCount *bool + itemsPerPage *int + pageNum *int +} + +type ListServiceAccountAccessListApiParams struct { + OrgId string + ClientId string + IncludeCount *bool + ItemsPerPage *int + PageNum *int +} + +func (a *ServiceAccountsApiService) ListServiceAccountAccessListWithParams(ctx context.Context, args *ListServiceAccountAccessListApiParams) ListServiceAccountAccessListApiRequest { + return ListServiceAccountAccessListApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + clientId: args.ClientId, + includeCount: args.IncludeCount, + itemsPerPage: args.ItemsPerPage, + pageNum: args.PageNum, + } +} + +// Flag that indicates whether the response returns the total number of items (**totalCount**) in the response. +func (r ListServiceAccountAccessListApiRequest) IncludeCount(includeCount bool) ListServiceAccountAccessListApiRequest { + r.includeCount = &includeCount + return r +} + +// Number of items that the response returns per page. +func (r ListServiceAccountAccessListApiRequest) ItemsPerPage(itemsPerPage int) ListServiceAccountAccessListApiRequest { + r.itemsPerPage = &itemsPerPage + return r +} + +// Number of the page that displays the current set of the total objects that the response returns. +func (r ListServiceAccountAccessListApiRequest) PageNum(pageNum int) ListServiceAccountAccessListApiRequest { + r.pageNum = &pageNum + return r +} + +func (r ListServiceAccountAccessListApiRequest) Execute() (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + return r.ApiService.ListServiceAccountAccessListExecute(r) +} + +/* +ListServiceAccountAccessList Return All Access List entries for one Organization Service Account + +Returns all access list entries that you configured for the specified Service Account for the organization. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @return ListServiceAccountAccessListApiRequest +*/ +func (a *ServiceAccountsApiService) ListServiceAccountAccessList(ctx context.Context, orgId string, clientId string) ListServiceAccountAccessListApiRequest { + return ListServiceAccountAccessListApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + clientId: clientId, + } +} + +// ListServiceAccountAccessListExecute executes the request +// +// @return PaginatedServiceAccountIPAccessEntry +func (a *ServiceAccountsApiService) ListServiceAccountAccessListExecute(r ListServiceAccountAccessListApiRequest) (*PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *PaginatedServiceAccountIPAccessEntry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.ListServiceAccountAccessList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.includeCount != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "includeCount", r.includeCount, "") + } else { + var defaultValue bool = true + r.includeCount = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "includeCount", r.includeCount, "") + } + if r.itemsPerPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } else { + var defaultValue int = 100 + r.itemsPerPage = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } + if r.pageNum != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } else { + var defaultValue int = 1 + r.pageNum = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ListServiceAccountProjectsApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + orgId string + clientId string + itemsPerPage *int + pageNum *int +} + +type ListServiceAccountProjectsApiParams struct { + OrgId string + ClientId string + ItemsPerPage *int + PageNum *int +} + +func (a *ServiceAccountsApiService) ListServiceAccountProjectsWithParams(ctx context.Context, args *ListServiceAccountProjectsApiParams) ListServiceAccountProjectsApiRequest { + return ListServiceAccountProjectsApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + clientId: args.ClientId, + itemsPerPage: args.ItemsPerPage, + pageNum: args.PageNum, + } +} + +// Number of items that the response returns per page. +func (r ListServiceAccountProjectsApiRequest) ItemsPerPage(itemsPerPage int) ListServiceAccountProjectsApiRequest { + r.itemsPerPage = &itemsPerPage + return r +} + +// Number of the page that displays the current set of the total objects that the response returns. +func (r ListServiceAccountProjectsApiRequest) PageNum(pageNum int) ListServiceAccountProjectsApiRequest { + r.pageNum = &pageNum + return r +} + +func (r ListServiceAccountProjectsApiRequest) Execute() (*PaginatedServiceAccountGroup, *http.Response, error) { + return r.ApiService.ListServiceAccountProjectsExecute(r) +} + +/* +ListServiceAccountProjects Return All Service Account Project assignments + +Returns a list of all projects the specified Service Account is a part of. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @param clientId The Client ID of the Service Account. + @return ListServiceAccountProjectsApiRequest +*/ +func (a *ServiceAccountsApiService) ListServiceAccountProjects(ctx context.Context, orgId string, clientId string) ListServiceAccountProjectsApiRequest { + return ListServiceAccountProjectsApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + clientId: clientId, + } +} + +// ListServiceAccountProjectsExecute executes the request +// +// @return PaginatedServiceAccountGroup +func (a *ServiceAccountsApiService) ListServiceAccountProjectsExecute(r ListServiceAccountProjectsApiRequest) (*PaginatedServiceAccountGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *PaginatedServiceAccountGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.ListServiceAccountProjects") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.itemsPerPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } else { + var defaultValue int = 100 + r.itemsPerPage = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } + if r.pageNum != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } else { + var defaultValue int = 1 + r.pageNum = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ListServiceAccountsApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + orgId string + itemsPerPage *int + pageNum *int +} + +type ListServiceAccountsApiParams struct { + OrgId string + ItemsPerPage *int + PageNum *int +} + +func (a *ServiceAccountsApiService) ListServiceAccountsWithParams(ctx context.Context, args *ListServiceAccountsApiParams) ListServiceAccountsApiRequest { + return ListServiceAccountsApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + itemsPerPage: args.ItemsPerPage, + pageNum: args.PageNum, + } +} + +// Number of items that the response returns per page. +func (r ListServiceAccountsApiRequest) ItemsPerPage(itemsPerPage int) ListServiceAccountsApiRequest { + r.itemsPerPage = &itemsPerPage + return r +} + +// Number of the page that displays the current set of the total objects that the response returns. +func (r ListServiceAccountsApiRequest) PageNum(pageNum int) ListServiceAccountsApiRequest { + r.pageNum = &pageNum + return r +} + +func (r ListServiceAccountsApiRequest) Execute() (*PaginatedOrgServiceAccounts, *http.Response, error) { + return r.ApiService.ListServiceAccountsExecute(r) +} + +/* +ListServiceAccounts List All Organization Service Accounts + +Returns all Service Accounts for the specified Organization. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @return ListServiceAccountsApiRequest +*/ +func (a *ServiceAccountsApiService) ListServiceAccounts(ctx context.Context, orgId string) ListServiceAccountsApiRequest { + return ListServiceAccountsApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + } +} + +// ListServiceAccountsExecute executes the request +// +// @return PaginatedOrgServiceAccounts +func (a *ServiceAccountsApiService) ListServiceAccountsExecute(r ListServiceAccountsApiRequest) (*PaginatedOrgServiceAccounts, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *PaginatedOrgServiceAccounts + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.ListServiceAccounts") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.itemsPerPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } else { + var defaultValue int = 100 + r.itemsPerPage = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "itemsPerPage", r.itemsPerPage, "") + } + if r.pageNum != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } else { + var defaultValue int = 1 + r.pageNum = &defaultValue + parameterAddToHeaderOrQuery(localVarQueryParams, "pageNum", r.pageNum, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type UpdateProjectServiceAccountApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + clientId string + groupId string + groupServiceAccountUpdateRequest *GroupServiceAccountUpdateRequest +} + +type UpdateProjectServiceAccountApiParams struct { + ClientId string + GroupId string + GroupServiceAccountUpdateRequest *GroupServiceAccountUpdateRequest +} + +func (a *ServiceAccountsApiService) UpdateProjectServiceAccountWithParams(ctx context.Context, args *UpdateProjectServiceAccountApiParams) UpdateProjectServiceAccountApiRequest { + return UpdateProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: args.ClientId, + groupId: args.GroupId, + groupServiceAccountUpdateRequest: args.GroupServiceAccountUpdateRequest, + } +} + +func (r UpdateProjectServiceAccountApiRequest) Execute() (*GroupServiceAccount, *http.Response, error) { + return r.ApiService.UpdateProjectServiceAccountExecute(r) +} + +/* +UpdateProjectServiceAccount Update one Project Service Account + +Updates one Service Account in the specified Project. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param groupId Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + @return UpdateProjectServiceAccountApiRequest +*/ +func (a *ServiceAccountsApiService) UpdateProjectServiceAccount(ctx context.Context, clientId string, groupId string, groupServiceAccountUpdateRequest *GroupServiceAccountUpdateRequest) UpdateProjectServiceAccountApiRequest { + return UpdateProjectServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + groupId: groupId, + groupServiceAccountUpdateRequest: groupServiceAccountUpdateRequest, + } +} + +// UpdateProjectServiceAccountExecute executes the request +// +// @return GroupServiceAccount +func (a *ServiceAccountsApiService) UpdateProjectServiceAccountExecute(r UpdateProjectServiceAccountApiRequest) (*GroupServiceAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody any + formFiles []formFile + localVarReturnValue *GroupServiceAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.UpdateProjectServiceAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupServiceAccountUpdateRequest == nil { + return localVarReturnValue, nil, reportError("groupServiceAccountUpdateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-08-05+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupServiceAccountUpdateRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type UpdateServiceAccountApiRequest struct { + ctx context.Context + ApiService ServiceAccountsApi + clientId string + orgId string + orgServiceAccountUpdateRequest *OrgServiceAccountUpdateRequest +} + +type UpdateServiceAccountApiParams struct { + ClientId string + OrgId string + OrgServiceAccountUpdateRequest *OrgServiceAccountUpdateRequest +} + +func (a *ServiceAccountsApiService) UpdateServiceAccountWithParams(ctx context.Context, args *UpdateServiceAccountApiParams) UpdateServiceAccountApiRequest { + return UpdateServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: args.ClientId, + orgId: args.OrgId, + orgServiceAccountUpdateRequest: args.OrgServiceAccountUpdateRequest, + } +} + +func (r UpdateServiceAccountApiRequest) Execute() (*OrgServiceAccount, *http.Response, error) { + return r.ApiService.UpdateServiceAccountExecute(r) +} + +/* +UpdateServiceAccount Update one Organization Service Account + +Updates the specified Service Account in the specified Organization. Available as a preview feature. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId The Client ID of the Service Account. + @param orgId Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + @return UpdateServiceAccountApiRequest +*/ +func (a *ServiceAccountsApiService) UpdateServiceAccount(ctx context.Context, clientId string, orgId string, orgServiceAccountUpdateRequest *OrgServiceAccountUpdateRequest) UpdateServiceAccountApiRequest { + return UpdateServiceAccountApiRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + orgId: orgId, + orgServiceAccountUpdateRequest: orgServiceAccountUpdateRequest, + } +} + +// UpdateServiceAccountExecute executes the request +// +// @return OrgServiceAccount +func (a *ServiceAccountsApiService) UpdateServiceAccountExecute(r UpdateServiceAccountApiRequest) (*OrgServiceAccount, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody any + formFiles []formFile + localVarReturnValue *OrgServiceAccount + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ServiceAccountsApiService.UpdateServiceAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(r.clientId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.orgServiceAccountUpdateRequest == nil { + return localVarReturnValue, nil, reportError("orgServiceAccountUpdateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-08-05+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.orgServiceAccountUpdateRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarHTTPResponse.Body, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + defer localVarHTTPResponse.Body.Close() + buf, readErr := io.ReadAll(localVarHTTPResponse.Body) + if readErr != nil { + err = readErr + } + newErr := &GenericOpenAPIError{ + body: buf, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/admin/client.go b/admin/client.go index 60f0a57fa..4392641f1 100644 --- a/admin/client.go +++ b/admin/client.go @@ -119,6 +119,8 @@ type APIClient struct { ServerlessPrivateEndpointsApi ServerlessPrivateEndpointsApi + ServiceAccountsApi ServiceAccountsApi + SharedTierRestoreJobsApi SharedTierRestoreJobsApi SharedTierSnapshotsApi SharedTierSnapshotsApi @@ -188,6 +190,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.RootApi = (*RootApiService)(&c.common) c.ServerlessInstancesApi = (*ServerlessInstancesApiService)(&c.common) c.ServerlessPrivateEndpointsApi = (*ServerlessPrivateEndpointsApiService)(&c.common) + c.ServiceAccountsApi = (*ServiceAccountsApiService)(&c.common) c.SharedTierRestoreJobsApi = (*SharedTierRestoreJobsApiService)(&c.common) c.SharedTierSnapshotsApi = (*SharedTierSnapshotsApiService)(&c.common) c.StreamsApi = (*StreamsApiService)(&c.common) diff --git a/admin/model_group_service_account.go b/admin/model_group_service_account.go new file mode 100644 index 000000000..161af3401 --- /dev/null +++ b/admin/model_group_service_account.go @@ -0,0 +1,238 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +import ( + "time" +) + +// GroupServiceAccount struct for GroupServiceAccount +type GroupServiceAccount struct { + // The Client ID of the Service Account. + ClientId *string `json:"clientId,omitempty"` + // The date that the Service Account was created on. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Human readable description for the Service Account. + Description *string `json:"description,omitempty"` + // Human-readable name for the Service Account. + Name *string `json:"name,omitempty"` + // A list of Project roles associated with the Service Account. + Roles *[]string `json:"roles,omitempty"` + // A list of secrets associated with the specified Service Account. + Secrets *[]ServiceAccountSecret `json:"secrets,omitempty"` +} + +// NewGroupServiceAccount instantiates a new GroupServiceAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupServiceAccount() *GroupServiceAccount { + this := GroupServiceAccount{} + return &this +} + +// NewGroupServiceAccountWithDefaults instantiates a new GroupServiceAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupServiceAccountWithDefaults() *GroupServiceAccount { + this := GroupServiceAccount{} + return &this +} + +// GetClientId returns the ClientId field value if set, zero value otherwise +func (o *GroupServiceAccount) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupServiceAccount) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *GroupServiceAccount) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *GroupServiceAccount) SetClientId(v string) { + o.ClientId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise +func (o *GroupServiceAccount) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupServiceAccount) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *GroupServiceAccount) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *GroupServiceAccount) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise +func (o *GroupServiceAccount) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupServiceAccount) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *GroupServiceAccount) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *GroupServiceAccount) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise +func (o *GroupServiceAccount) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupServiceAccount) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GroupServiceAccount) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GroupServiceAccount) SetName(v string) { + o.Name = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise +func (o *GroupServiceAccount) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return *o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupServiceAccount) GetRolesOk() (*[]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *GroupServiceAccount) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *GroupServiceAccount) SetRoles(v []string) { + o.Roles = &v +} + +// GetSecrets returns the Secrets field value if set, zero value otherwise +func (o *GroupServiceAccount) GetSecrets() []ServiceAccountSecret { + if o == nil || IsNil(o.Secrets) { + var ret []ServiceAccountSecret + return ret + } + return *o.Secrets +} + +// GetSecretsOk returns a tuple with the Secrets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupServiceAccount) GetSecretsOk() (*[]ServiceAccountSecret, bool) { + if o == nil || IsNil(o.Secrets) { + return nil, false + } + + return o.Secrets, true +} + +// HasSecrets returns a boolean if a field has been set. +func (o *GroupServiceAccount) HasSecrets() bool { + if o != nil && !IsNil(o.Secrets) { + return true + } + + return false +} + +// SetSecrets gets a reference to the given []ServiceAccountSecret and assigns it to the Secrets field. +func (o *GroupServiceAccount) SetSecrets(v []ServiceAccountSecret) { + o.Secrets = &v +} diff --git a/admin/model_group_service_account_request.go b/admin/model_group_service_account_request.go new file mode 100644 index 000000000..9e2175edf --- /dev/null +++ b/admin/model_group_service_account_request.go @@ -0,0 +1,132 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// GroupServiceAccountRequest struct for GroupServiceAccountRequest +type GroupServiceAccountRequest struct { + // Human readable description for the Service Account. + Description string `json:"description"` + // Human-readable name for the Service Account. The name is modifiable and does not have to be unique. + Name string `json:"name"` + // A list of project-level roles for the Service Account. + Roles []string `json:"roles"` + // The expiration time of the new Service Account secret. The expiration is provided in hours. + SecretExpiresAfterHours int `json:"secretExpiresAfterHours"` +} + +// NewGroupServiceAccountRequest instantiates a new GroupServiceAccountRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupServiceAccountRequest(description string, name string, roles []string, secretExpiresAfterHours int) *GroupServiceAccountRequest { + this := GroupServiceAccountRequest{} + this.Description = description + this.Name = name + this.Roles = roles + this.SecretExpiresAfterHours = secretExpiresAfterHours + return &this +} + +// NewGroupServiceAccountRequestWithDefaults instantiates a new GroupServiceAccountRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupServiceAccountRequestWithDefaults() *GroupServiceAccountRequest { + this := GroupServiceAccountRequest{} + return &this +} + +// GetDescription returns the Description field value +func (o *GroupServiceAccountRequest) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *GroupServiceAccountRequest) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *GroupServiceAccountRequest) SetDescription(v string) { + o.Description = v +} + +// GetName returns the Name field value +func (o *GroupServiceAccountRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GroupServiceAccountRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GroupServiceAccountRequest) SetName(v string) { + o.Name = v +} + +// GetRoles returns the Roles field value +func (o *GroupServiceAccountRequest) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *GroupServiceAccountRequest) GetRolesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Roles, true +} + +// SetRoles sets field value +func (o *GroupServiceAccountRequest) SetRoles(v []string) { + o.Roles = v +} + +// GetSecretExpiresAfterHours returns the SecretExpiresAfterHours field value +func (o *GroupServiceAccountRequest) GetSecretExpiresAfterHours() int { + if o == nil { + var ret int + return ret + } + + return o.SecretExpiresAfterHours +} + +// GetSecretExpiresAfterHoursOk returns a tuple with the SecretExpiresAfterHours field value +// and a boolean to check if the value has been set. +func (o *GroupServiceAccountRequest) GetSecretExpiresAfterHoursOk() (*int, bool) { + if o == nil { + return nil, false + } + return &o.SecretExpiresAfterHours, true +} + +// SetSecretExpiresAfterHours sets field value +func (o *GroupServiceAccountRequest) SetSecretExpiresAfterHours(v int) { + o.SecretExpiresAfterHours = v +} diff --git a/admin/model_group_service_account_role_assignment.go b/admin/model_group_service_account_role_assignment.go new file mode 100644 index 000000000..9c340600d --- /dev/null +++ b/admin/model_group_service_account_role_assignment.go @@ -0,0 +1,51 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// GroupServiceAccountRoleAssignment struct for GroupServiceAccountRoleAssignment +type GroupServiceAccountRoleAssignment struct { + // The Project permissions for the Service Account in the specified Project. + Roles []string `json:"roles"` +} + +// NewGroupServiceAccountRoleAssignment instantiates a new GroupServiceAccountRoleAssignment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupServiceAccountRoleAssignment(roles []string) *GroupServiceAccountRoleAssignment { + this := GroupServiceAccountRoleAssignment{} + this.Roles = roles + return &this +} + +// NewGroupServiceAccountRoleAssignmentWithDefaults instantiates a new GroupServiceAccountRoleAssignment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupServiceAccountRoleAssignmentWithDefaults() *GroupServiceAccountRoleAssignment { + this := GroupServiceAccountRoleAssignment{} + return &this +} + +// GetRoles returns the Roles field value +func (o *GroupServiceAccountRoleAssignment) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *GroupServiceAccountRoleAssignment) GetRolesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Roles, true +} + +// SetRoles sets field value +func (o *GroupServiceAccountRoleAssignment) SetRoles(v []string) { + o.Roles = v +} diff --git a/admin/model_group_service_account_update_request.go b/admin/model_group_service_account_update_request.go new file mode 100644 index 000000000..214e4bf94 --- /dev/null +++ b/admin/model_group_service_account_update_request.go @@ -0,0 +1,129 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// GroupServiceAccountUpdateRequest struct for GroupServiceAccountUpdateRequest +type GroupServiceAccountUpdateRequest struct { + // Human readable description for the Service Account. + Description *string `json:"description,omitempty"` + // Human-readable name for the Service Account. The name is modifiable and does not have to be unique. + Name *string `json:"name,omitempty"` + // A list of Project roles associated with the Service Account. + Roles *[]string `json:"roles,omitempty"` +} + +// NewGroupServiceAccountUpdateRequest instantiates a new GroupServiceAccountUpdateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupServiceAccountUpdateRequest() *GroupServiceAccountUpdateRequest { + this := GroupServiceAccountUpdateRequest{} + return &this +} + +// NewGroupServiceAccountUpdateRequestWithDefaults instantiates a new GroupServiceAccountUpdateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupServiceAccountUpdateRequestWithDefaults() *GroupServiceAccountUpdateRequest { + this := GroupServiceAccountUpdateRequest{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise +func (o *GroupServiceAccountUpdateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupServiceAccountUpdateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *GroupServiceAccountUpdateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *GroupServiceAccountUpdateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise +func (o *GroupServiceAccountUpdateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupServiceAccountUpdateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GroupServiceAccountUpdateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GroupServiceAccountUpdateRequest) SetName(v string) { + o.Name = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise +func (o *GroupServiceAccountUpdateRequest) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return *o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupServiceAccountUpdateRequest) GetRolesOk() (*[]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *GroupServiceAccountUpdateRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *GroupServiceAccountUpdateRequest) SetRoles(v []string) { + o.Roles = &v +} diff --git a/admin/model_org_service_account.go b/admin/model_org_service_account.go new file mode 100644 index 000000000..29edf21fc --- /dev/null +++ b/admin/model_org_service_account.go @@ -0,0 +1,238 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +import ( + "time" +) + +// OrgServiceAccount struct for OrgServiceAccount +type OrgServiceAccount struct { + // The Client ID of the Service Account. + ClientId *string `json:"clientId,omitempty"` + // The date that the Service Account was created on. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Human readable description for the Service Account. + Description *string `json:"description,omitempty"` + // Human-readable name for the Service Account. + Name *string `json:"name,omitempty"` + // A list of Organization roles associated with the Service Account. + Roles *[]string `json:"roles,omitempty"` + // A list of secrets associated with the specified Service Account. + Secrets *[]ServiceAccountSecret `json:"secrets,omitempty"` +} + +// NewOrgServiceAccount instantiates a new OrgServiceAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrgServiceAccount() *OrgServiceAccount { + this := OrgServiceAccount{} + return &this +} + +// NewOrgServiceAccountWithDefaults instantiates a new OrgServiceAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrgServiceAccountWithDefaults() *OrgServiceAccount { + this := OrgServiceAccount{} + return &this +} + +// GetClientId returns the ClientId field value if set, zero value otherwise +func (o *OrgServiceAccount) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgServiceAccount) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *OrgServiceAccount) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *OrgServiceAccount) SetClientId(v string) { + o.ClientId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise +func (o *OrgServiceAccount) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgServiceAccount) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *OrgServiceAccount) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *OrgServiceAccount) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise +func (o *OrgServiceAccount) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgServiceAccount) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *OrgServiceAccount) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *OrgServiceAccount) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise +func (o *OrgServiceAccount) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgServiceAccount) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *OrgServiceAccount) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *OrgServiceAccount) SetName(v string) { + o.Name = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise +func (o *OrgServiceAccount) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return *o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgServiceAccount) GetRolesOk() (*[]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *OrgServiceAccount) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *OrgServiceAccount) SetRoles(v []string) { + o.Roles = &v +} + +// GetSecrets returns the Secrets field value if set, zero value otherwise +func (o *OrgServiceAccount) GetSecrets() []ServiceAccountSecret { + if o == nil || IsNil(o.Secrets) { + var ret []ServiceAccountSecret + return ret + } + return *o.Secrets +} + +// GetSecretsOk returns a tuple with the Secrets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgServiceAccount) GetSecretsOk() (*[]ServiceAccountSecret, bool) { + if o == nil || IsNil(o.Secrets) { + return nil, false + } + + return o.Secrets, true +} + +// HasSecrets returns a boolean if a field has been set. +func (o *OrgServiceAccount) HasSecrets() bool { + if o != nil && !IsNil(o.Secrets) { + return true + } + + return false +} + +// SetSecrets gets a reference to the given []ServiceAccountSecret and assigns it to the Secrets field. +func (o *OrgServiceAccount) SetSecrets(v []ServiceAccountSecret) { + o.Secrets = &v +} diff --git a/admin/model_org_service_account_request.go b/admin/model_org_service_account_request.go new file mode 100644 index 000000000..83bc2aa07 --- /dev/null +++ b/admin/model_org_service_account_request.go @@ -0,0 +1,132 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// OrgServiceAccountRequest struct for OrgServiceAccountRequest +type OrgServiceAccountRequest struct { + // Human readable description for the Service Account. + Description string `json:"description"` + // Human-readable name for the Service Account. The name is modifiable and does not have to be unique. + Name string `json:"name"` + // A list of organization-level roles for the Service Account. + Roles []string `json:"roles"` + // The expiration time of the new Service Account secret. The expiration is provided in hours. + SecretExpiresAfterHours int `json:"secretExpiresAfterHours"` +} + +// NewOrgServiceAccountRequest instantiates a new OrgServiceAccountRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrgServiceAccountRequest(description string, name string, roles []string, secretExpiresAfterHours int) *OrgServiceAccountRequest { + this := OrgServiceAccountRequest{} + this.Description = description + this.Name = name + this.Roles = roles + this.SecretExpiresAfterHours = secretExpiresAfterHours + return &this +} + +// NewOrgServiceAccountRequestWithDefaults instantiates a new OrgServiceAccountRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrgServiceAccountRequestWithDefaults() *OrgServiceAccountRequest { + this := OrgServiceAccountRequest{} + return &this +} + +// GetDescription returns the Description field value +func (o *OrgServiceAccountRequest) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *OrgServiceAccountRequest) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *OrgServiceAccountRequest) SetDescription(v string) { + o.Description = v +} + +// GetName returns the Name field value +func (o *OrgServiceAccountRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *OrgServiceAccountRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *OrgServiceAccountRequest) SetName(v string) { + o.Name = v +} + +// GetRoles returns the Roles field value +func (o *OrgServiceAccountRequest) GetRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *OrgServiceAccountRequest) GetRolesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Roles, true +} + +// SetRoles sets field value +func (o *OrgServiceAccountRequest) SetRoles(v []string) { + o.Roles = v +} + +// GetSecretExpiresAfterHours returns the SecretExpiresAfterHours field value +func (o *OrgServiceAccountRequest) GetSecretExpiresAfterHours() int { + if o == nil { + var ret int + return ret + } + + return o.SecretExpiresAfterHours +} + +// GetSecretExpiresAfterHoursOk returns a tuple with the SecretExpiresAfterHours field value +// and a boolean to check if the value has been set. +func (o *OrgServiceAccountRequest) GetSecretExpiresAfterHoursOk() (*int, bool) { + if o == nil { + return nil, false + } + return &o.SecretExpiresAfterHours, true +} + +// SetSecretExpiresAfterHours sets field value +func (o *OrgServiceAccountRequest) SetSecretExpiresAfterHours(v int) { + o.SecretExpiresAfterHours = v +} diff --git a/admin/model_org_service_account_update_request.go b/admin/model_org_service_account_update_request.go new file mode 100644 index 000000000..77a2af67e --- /dev/null +++ b/admin/model_org_service_account_update_request.go @@ -0,0 +1,129 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// OrgServiceAccountUpdateRequest struct for OrgServiceAccountUpdateRequest +type OrgServiceAccountUpdateRequest struct { + // Human readable description for the Service Account. + Description *string `json:"description,omitempty"` + // Human-readable name for the Service Account. The name is modifiable and does not have to be unique. + Name *string `json:"name,omitempty"` + // A list of organization-level roles for the Service Account. + Roles *[]string `json:"roles,omitempty"` +} + +// NewOrgServiceAccountUpdateRequest instantiates a new OrgServiceAccountUpdateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrgServiceAccountUpdateRequest() *OrgServiceAccountUpdateRequest { + this := OrgServiceAccountUpdateRequest{} + return &this +} + +// NewOrgServiceAccountUpdateRequestWithDefaults instantiates a new OrgServiceAccountUpdateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrgServiceAccountUpdateRequestWithDefaults() *OrgServiceAccountUpdateRequest { + this := OrgServiceAccountUpdateRequest{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise +func (o *OrgServiceAccountUpdateRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgServiceAccountUpdateRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *OrgServiceAccountUpdateRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *OrgServiceAccountUpdateRequest) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise +func (o *OrgServiceAccountUpdateRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgServiceAccountUpdateRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *OrgServiceAccountUpdateRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *OrgServiceAccountUpdateRequest) SetName(v string) { + o.Name = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise +func (o *OrgServiceAccountUpdateRequest) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return *o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgServiceAccountUpdateRequest) GetRolesOk() (*[]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *OrgServiceAccountUpdateRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *OrgServiceAccountUpdateRequest) SetRoles(v []string) { + o.Roles = &v +} diff --git a/admin/model_organization_settings.go b/admin/model_organization_settings.go index d6bb26a87..6a55dbc1f 100644 --- a/admin/model_organization_settings.go +++ b/admin/model_organization_settings.go @@ -6,6 +6,8 @@ package admin type OrganizationSettings struct { // Flag that indicates whether to require API operations to originate from an IP Address added to the API access list for the specified organization. ApiAccessListRequired *bool `json:"apiAccessListRequired,omitempty"` + // Number that represents the maximum period before expiry in hours for new Atlas Admin API Service Account secrets within the specified organization. + MaxServiceAccountSecretValidityInHours *int `json:"maxServiceAccountSecretValidityInHours,omitempty"` // Flag that indicates whether to require users to set up Multi-Factor Authentication (MFA) before accessing the specified organization. To learn more, see: https://www.mongodb.com/docs/atlas/security-multi-factor-authentication/. MultiFactorAuthRequired *bool `json:"multiFactorAuthRequired,omitempty"` // Flag that indicates whether to block MongoDB Support from accessing Atlas infrastructure and cluster logs for any deployment in the specified organization without explicit permission. Once this setting is turned on, you can grant MongoDB Support a 24-hour bypass access to the Atlas deployment to resolve support issues. To learn more, see: https://www.mongodb.com/docs/atlas/security-restrict-support-access/. @@ -64,6 +66,39 @@ func (o *OrganizationSettings) SetApiAccessListRequired(v bool) { o.ApiAccessListRequired = &v } +// GetMaxServiceAccountSecretValidityInHours returns the MaxServiceAccountSecretValidityInHours field value if set, zero value otherwise +func (o *OrganizationSettings) GetMaxServiceAccountSecretValidityInHours() int { + if o == nil || IsNil(o.MaxServiceAccountSecretValidityInHours) { + var ret int + return ret + } + return *o.MaxServiceAccountSecretValidityInHours +} + +// GetMaxServiceAccountSecretValidityInHoursOk returns a tuple with the MaxServiceAccountSecretValidityInHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationSettings) GetMaxServiceAccountSecretValidityInHoursOk() (*int, bool) { + if o == nil || IsNil(o.MaxServiceAccountSecretValidityInHours) { + return nil, false + } + + return o.MaxServiceAccountSecretValidityInHours, true +} + +// HasMaxServiceAccountSecretValidityInHours returns a boolean if a field has been set. +func (o *OrganizationSettings) HasMaxServiceAccountSecretValidityInHours() bool { + if o != nil && !IsNil(o.MaxServiceAccountSecretValidityInHours) { + return true + } + + return false +} + +// SetMaxServiceAccountSecretValidityInHours gets a reference to the given int and assigns it to the MaxServiceAccountSecretValidityInHours field. +func (o *OrganizationSettings) SetMaxServiceAccountSecretValidityInHours(v int) { + o.MaxServiceAccountSecretValidityInHours = &v +} + // GetMultiFactorAuthRequired returns the MultiFactorAuthRequired field value if set, zero value otherwise func (o *OrganizationSettings) GetMultiFactorAuthRequired() bool { if o == nil || IsNil(o.MultiFactorAuthRequired) { diff --git a/admin/model_paginated_group_service_accounts.go b/admin/model_paginated_group_service_accounts.go new file mode 100644 index 000000000..7ecf20e54 --- /dev/null +++ b/admin/model_paginated_group_service_accounts.go @@ -0,0 +1,132 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// PaginatedGroupServiceAccounts A list of Project Service Accounts. +type PaginatedGroupServiceAccounts struct { + // List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + // Read only field. + Links *[]Link `json:"links,omitempty"` + // List of returned documents that MongoDB Cloud provides when completing this request. + // Read only field. + Results *[]GroupServiceAccount `json:"results,omitempty"` + // Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. + // Read only field. + TotalCount *int `json:"totalCount,omitempty"` +} + +// NewPaginatedGroupServiceAccounts instantiates a new PaginatedGroupServiceAccounts object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupServiceAccounts() *PaginatedGroupServiceAccounts { + this := PaginatedGroupServiceAccounts{} + return &this +} + +// NewPaginatedGroupServiceAccountsWithDefaults instantiates a new PaginatedGroupServiceAccounts object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupServiceAccountsWithDefaults() *PaginatedGroupServiceAccounts { + this := PaginatedGroupServiceAccounts{} + return &this +} + +// GetLinks returns the Links field value if set, zero value otherwise +func (o *PaginatedGroupServiceAccounts) GetLinks() []Link { + if o == nil || IsNil(o.Links) { + var ret []Link + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedGroupServiceAccounts) GetLinksOk() (*[]Link, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *PaginatedGroupServiceAccounts) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given []Link and assigns it to the Links field. +func (o *PaginatedGroupServiceAccounts) SetLinks(v []Link) { + o.Links = &v +} + +// GetResults returns the Results field value if set, zero value otherwise +func (o *PaginatedGroupServiceAccounts) GetResults() []GroupServiceAccount { + if o == nil || IsNil(o.Results) { + var ret []GroupServiceAccount + return ret + } + return *o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedGroupServiceAccounts) GetResultsOk() (*[]GroupServiceAccount, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedGroupServiceAccounts) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []GroupServiceAccount and assigns it to the Results field. +func (o *PaginatedGroupServiceAccounts) SetResults(v []GroupServiceAccount) { + o.Results = &v +} + +// GetTotalCount returns the TotalCount field value if set, zero value otherwise +func (o *PaginatedGroupServiceAccounts) GetTotalCount() int { + if o == nil || IsNil(o.TotalCount) { + var ret int + return ret + } + return *o.TotalCount +} + +// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedGroupServiceAccounts) GetTotalCountOk() (*int, bool) { + if o == nil || IsNil(o.TotalCount) { + return nil, false + } + + return o.TotalCount, true +} + +// HasTotalCount returns a boolean if a field has been set. +func (o *PaginatedGroupServiceAccounts) HasTotalCount() bool { + if o != nil && !IsNil(o.TotalCount) { + return true + } + + return false +} + +// SetTotalCount gets a reference to the given int and assigns it to the TotalCount field. +func (o *PaginatedGroupServiceAccounts) SetTotalCount(v int) { + o.TotalCount = &v +} diff --git a/admin/model_paginated_org_service_accounts.go b/admin/model_paginated_org_service_accounts.go new file mode 100644 index 000000000..8b4f2d797 --- /dev/null +++ b/admin/model_paginated_org_service_accounts.go @@ -0,0 +1,132 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// PaginatedOrgServiceAccounts A list of Organization Service Accounts. +type PaginatedOrgServiceAccounts struct { + // List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + // Read only field. + Links *[]Link `json:"links,omitempty"` + // List of returned documents that MongoDB Cloud provides when completing this request. + // Read only field. + Results *[]OrgServiceAccount `json:"results,omitempty"` + // Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. + // Read only field. + TotalCount *int `json:"totalCount,omitempty"` +} + +// NewPaginatedOrgServiceAccounts instantiates a new PaginatedOrgServiceAccounts object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedOrgServiceAccounts() *PaginatedOrgServiceAccounts { + this := PaginatedOrgServiceAccounts{} + return &this +} + +// NewPaginatedOrgServiceAccountsWithDefaults instantiates a new PaginatedOrgServiceAccounts object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedOrgServiceAccountsWithDefaults() *PaginatedOrgServiceAccounts { + this := PaginatedOrgServiceAccounts{} + return &this +} + +// GetLinks returns the Links field value if set, zero value otherwise +func (o *PaginatedOrgServiceAccounts) GetLinks() []Link { + if o == nil || IsNil(o.Links) { + var ret []Link + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedOrgServiceAccounts) GetLinksOk() (*[]Link, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *PaginatedOrgServiceAccounts) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given []Link and assigns it to the Links field. +func (o *PaginatedOrgServiceAccounts) SetLinks(v []Link) { + o.Links = &v +} + +// GetResults returns the Results field value if set, zero value otherwise +func (o *PaginatedOrgServiceAccounts) GetResults() []OrgServiceAccount { + if o == nil || IsNil(o.Results) { + var ret []OrgServiceAccount + return ret + } + return *o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedOrgServiceAccounts) GetResultsOk() (*[]OrgServiceAccount, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedOrgServiceAccounts) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []OrgServiceAccount and assigns it to the Results field. +func (o *PaginatedOrgServiceAccounts) SetResults(v []OrgServiceAccount) { + o.Results = &v +} + +// GetTotalCount returns the TotalCount field value if set, zero value otherwise +func (o *PaginatedOrgServiceAccounts) GetTotalCount() int { + if o == nil || IsNil(o.TotalCount) { + var ret int + return ret + } + return *o.TotalCount +} + +// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedOrgServiceAccounts) GetTotalCountOk() (*int, bool) { + if o == nil || IsNil(o.TotalCount) { + return nil, false + } + + return o.TotalCount, true +} + +// HasTotalCount returns a boolean if a field has been set. +func (o *PaginatedOrgServiceAccounts) HasTotalCount() bool { + if o != nil && !IsNil(o.TotalCount) { + return true + } + + return false +} + +// SetTotalCount gets a reference to the given int and assigns it to the TotalCount field. +func (o *PaginatedOrgServiceAccounts) SetTotalCount(v int) { + o.TotalCount = &v +} diff --git a/admin/model_paginated_service_account_group.go b/admin/model_paginated_service_account_group.go new file mode 100644 index 000000000..41d687b64 --- /dev/null +++ b/admin/model_paginated_service_account_group.go @@ -0,0 +1,132 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// PaginatedServiceAccountGroup A list of projects associated with the Service Account. +type PaginatedServiceAccountGroup struct { + // List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + // Read only field. + Links *[]Link `json:"links,omitempty"` + // List of returned documents that MongoDB Cloud provides when completing this request. + // Read only field. + Results *[]ServiceAccountGroup `json:"results,omitempty"` + // Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. + // Read only field. + TotalCount *int `json:"totalCount,omitempty"` +} + +// NewPaginatedServiceAccountGroup instantiates a new PaginatedServiceAccountGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedServiceAccountGroup() *PaginatedServiceAccountGroup { + this := PaginatedServiceAccountGroup{} + return &this +} + +// NewPaginatedServiceAccountGroupWithDefaults instantiates a new PaginatedServiceAccountGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedServiceAccountGroupWithDefaults() *PaginatedServiceAccountGroup { + this := PaginatedServiceAccountGroup{} + return &this +} + +// GetLinks returns the Links field value if set, zero value otherwise +func (o *PaginatedServiceAccountGroup) GetLinks() []Link { + if o == nil || IsNil(o.Links) { + var ret []Link + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceAccountGroup) GetLinksOk() (*[]Link, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *PaginatedServiceAccountGroup) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given []Link and assigns it to the Links field. +func (o *PaginatedServiceAccountGroup) SetLinks(v []Link) { + o.Links = &v +} + +// GetResults returns the Results field value if set, zero value otherwise +func (o *PaginatedServiceAccountGroup) GetResults() []ServiceAccountGroup { + if o == nil || IsNil(o.Results) { + var ret []ServiceAccountGroup + return ret + } + return *o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceAccountGroup) GetResultsOk() (*[]ServiceAccountGroup, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedServiceAccountGroup) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ServiceAccountGroup and assigns it to the Results field. +func (o *PaginatedServiceAccountGroup) SetResults(v []ServiceAccountGroup) { + o.Results = &v +} + +// GetTotalCount returns the TotalCount field value if set, zero value otherwise +func (o *PaginatedServiceAccountGroup) GetTotalCount() int { + if o == nil || IsNil(o.TotalCount) { + var ret int + return ret + } + return *o.TotalCount +} + +// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceAccountGroup) GetTotalCountOk() (*int, bool) { + if o == nil || IsNil(o.TotalCount) { + return nil, false + } + + return o.TotalCount, true +} + +// HasTotalCount returns a boolean if a field has been set. +func (o *PaginatedServiceAccountGroup) HasTotalCount() bool { + if o != nil && !IsNil(o.TotalCount) { + return true + } + + return false +} + +// SetTotalCount gets a reference to the given int and assigns it to the TotalCount field. +func (o *PaginatedServiceAccountGroup) SetTotalCount(v int) { + o.TotalCount = &v +} diff --git a/admin/model_paginated_service_account_ip_access_entry.go b/admin/model_paginated_service_account_ip_access_entry.go new file mode 100644 index 000000000..2de216f22 --- /dev/null +++ b/admin/model_paginated_service_account_ip_access_entry.go @@ -0,0 +1,132 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// PaginatedServiceAccountIPAccessEntry struct for PaginatedServiceAccountIPAccessEntry +type PaginatedServiceAccountIPAccessEntry struct { + // List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + // Read only field. + Links *[]Link `json:"links,omitempty"` + // List of returned documents that MongoDB Cloud provides when completing this request. + // Read only field. + Results *[]ServiceAccountIPAccessListEntry `json:"results,omitempty"` + // Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. + // Read only field. + TotalCount *int `json:"totalCount,omitempty"` +} + +// NewPaginatedServiceAccountIPAccessEntry instantiates a new PaginatedServiceAccountIPAccessEntry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedServiceAccountIPAccessEntry() *PaginatedServiceAccountIPAccessEntry { + this := PaginatedServiceAccountIPAccessEntry{} + return &this +} + +// NewPaginatedServiceAccountIPAccessEntryWithDefaults instantiates a new PaginatedServiceAccountIPAccessEntry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedServiceAccountIPAccessEntryWithDefaults() *PaginatedServiceAccountIPAccessEntry { + this := PaginatedServiceAccountIPAccessEntry{} + return &this +} + +// GetLinks returns the Links field value if set, zero value otherwise +func (o *PaginatedServiceAccountIPAccessEntry) GetLinks() []Link { + if o == nil || IsNil(o.Links) { + var ret []Link + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceAccountIPAccessEntry) GetLinksOk() (*[]Link, bool) { + if o == nil || IsNil(o.Links) { + return nil, false + } + + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *PaginatedServiceAccountIPAccessEntry) HasLinks() bool { + if o != nil && !IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given []Link and assigns it to the Links field. +func (o *PaginatedServiceAccountIPAccessEntry) SetLinks(v []Link) { + o.Links = &v +} + +// GetResults returns the Results field value if set, zero value otherwise +func (o *PaginatedServiceAccountIPAccessEntry) GetResults() []ServiceAccountIPAccessListEntry { + if o == nil || IsNil(o.Results) { + var ret []ServiceAccountIPAccessListEntry + return ret + } + return *o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceAccountIPAccessEntry) GetResultsOk() (*[]ServiceAccountIPAccessListEntry, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *PaginatedServiceAccountIPAccessEntry) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ServiceAccountIPAccessListEntry and assigns it to the Results field. +func (o *PaginatedServiceAccountIPAccessEntry) SetResults(v []ServiceAccountIPAccessListEntry) { + o.Results = &v +} + +// GetTotalCount returns the TotalCount field value if set, zero value otherwise +func (o *PaginatedServiceAccountIPAccessEntry) GetTotalCount() int { + if o == nil || IsNil(o.TotalCount) { + var ret int + return ret + } + return *o.TotalCount +} + +// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaginatedServiceAccountIPAccessEntry) GetTotalCountOk() (*int, bool) { + if o == nil || IsNil(o.TotalCount) { + return nil, false + } + + return o.TotalCount, true +} + +// HasTotalCount returns a boolean if a field has been set. +func (o *PaginatedServiceAccountIPAccessEntry) HasTotalCount() bool { + if o != nil && !IsNil(o.TotalCount) { + return true + } + + return false +} + +// SetTotalCount gets a reference to the given int and assigns it to the TotalCount field. +func (o *PaginatedServiceAccountIPAccessEntry) SetTotalCount(v int) { + o.TotalCount = &v +} diff --git a/admin/model_service_account_group.go b/admin/model_service_account_group.go new file mode 100644 index 000000000..4cf1c3442 --- /dev/null +++ b/admin/model_service_account_group.go @@ -0,0 +1,60 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// ServiceAccountGroup struct for ServiceAccountGroup +type ServiceAccountGroup struct { + // Unique 24-hexadecimal digit string that identifies your project. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + // Read only field. + GroupId *string `json:"groupId,omitempty"` +} + +// NewServiceAccountGroup instantiates a new ServiceAccountGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceAccountGroup() *ServiceAccountGroup { + this := ServiceAccountGroup{} + return &this +} + +// NewServiceAccountGroupWithDefaults instantiates a new ServiceAccountGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceAccountGroupWithDefaults() *ServiceAccountGroup { + this := ServiceAccountGroup{} + return &this +} + +// GetGroupId returns the GroupId field value if set, zero value otherwise +func (o *ServiceAccountGroup) GetGroupId() string { + if o == nil || IsNil(o.GroupId) { + var ret string + return ret + } + return *o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountGroup) GetGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.GroupId) { + return nil, false + } + + return o.GroupId, true +} + +// HasGroupId returns a boolean if a field has been set. +func (o *ServiceAccountGroup) HasGroupId() bool { + if o != nil && !IsNil(o.GroupId) { + return true + } + + return false +} + +// SetGroupId gets a reference to the given string and assigns it to the GroupId field. +func (o *ServiceAccountGroup) SetGroupId(v string) { + o.GroupId = &v +} diff --git a/admin/model_service_account_ip_access_list_entry.go b/admin/model_service_account_ip_access_list_entry.go new file mode 100644 index 000000000..79ad14139 --- /dev/null +++ b/admin/model_service_account_ip_access_list_entry.go @@ -0,0 +1,242 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +import ( + "time" +) + +// ServiceAccountIPAccessListEntry struct for ServiceAccountIPAccessListEntry +type ServiceAccountIPAccessListEntry struct { + // Range of network addresses in the access list for the Service Account. This parameter requires the range to be expressed in Classless Inter-Domain Routing (CIDR) notation of Internet Protocol version 4 or version 6 addresses. You can set a value for this parameter or **ipAddress**, but not for both in the same request. + CidrBlock *string `json:"cidrBlock,omitempty"` + // Date MongoDB Cloud added the entry was added to the Access List. + // Read only field. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Network address in the access list for the Service Account. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. You can set a value for this parameter or **cidrBlock**, but not for both in the same request. + IpAddress *string `json:"ipAddress,omitempty"` + // Network address that issued the most recent request to the API. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. The resource returns this parameter after this IP address makes at least one request. + // Read only field. + LastUsedAddress *string `json:"lastUsedAddress,omitempty"` + // Date when MongoDB Cloud received the most recent request that originated from this Internet Protocol version 4 or version 6 address. The resource returns this parameter when at least one request originates from this IP address. MongoDB Cloud updates this parameter each time a client accesses the permitted resource, with a delay of up to 5 minutes. + // Read only field. + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + // The number of requests that has originated from this network address. + // Read only field. + RequestCount *int `json:"requestCount,omitempty"` +} + +// NewServiceAccountIPAccessListEntry instantiates a new ServiceAccountIPAccessListEntry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceAccountIPAccessListEntry() *ServiceAccountIPAccessListEntry { + this := ServiceAccountIPAccessListEntry{} + return &this +} + +// NewServiceAccountIPAccessListEntryWithDefaults instantiates a new ServiceAccountIPAccessListEntry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceAccountIPAccessListEntryWithDefaults() *ServiceAccountIPAccessListEntry { + this := ServiceAccountIPAccessListEntry{} + return &this +} + +// GetCidrBlock returns the CidrBlock field value if set, zero value otherwise +func (o *ServiceAccountIPAccessListEntry) GetCidrBlock() string { + if o == nil || IsNil(o.CidrBlock) { + var ret string + return ret + } + return *o.CidrBlock +} + +// GetCidrBlockOk returns a tuple with the CidrBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountIPAccessListEntry) GetCidrBlockOk() (*string, bool) { + if o == nil || IsNil(o.CidrBlock) { + return nil, false + } + + return o.CidrBlock, true +} + +// HasCidrBlock returns a boolean if a field has been set. +func (o *ServiceAccountIPAccessListEntry) HasCidrBlock() bool { + if o != nil && !IsNil(o.CidrBlock) { + return true + } + + return false +} + +// SetCidrBlock gets a reference to the given string and assigns it to the CidrBlock field. +func (o *ServiceAccountIPAccessListEntry) SetCidrBlock(v string) { + o.CidrBlock = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise +func (o *ServiceAccountIPAccessListEntry) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountIPAccessListEntry) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ServiceAccountIPAccessListEntry) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ServiceAccountIPAccessListEntry) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetIpAddress returns the IpAddress field value if set, zero value otherwise +func (o *ServiceAccountIPAccessListEntry) GetIpAddress() string { + if o == nil || IsNil(o.IpAddress) { + var ret string + return ret + } + return *o.IpAddress +} + +// GetIpAddressOk returns a tuple with the IpAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountIPAccessListEntry) GetIpAddressOk() (*string, bool) { + if o == nil || IsNil(o.IpAddress) { + return nil, false + } + + return o.IpAddress, true +} + +// HasIpAddress returns a boolean if a field has been set. +func (o *ServiceAccountIPAccessListEntry) HasIpAddress() bool { + if o != nil && !IsNil(o.IpAddress) { + return true + } + + return false +} + +// SetIpAddress gets a reference to the given string and assigns it to the IpAddress field. +func (o *ServiceAccountIPAccessListEntry) SetIpAddress(v string) { + o.IpAddress = &v +} + +// GetLastUsedAddress returns the LastUsedAddress field value if set, zero value otherwise +func (o *ServiceAccountIPAccessListEntry) GetLastUsedAddress() string { + if o == nil || IsNil(o.LastUsedAddress) { + var ret string + return ret + } + return *o.LastUsedAddress +} + +// GetLastUsedAddressOk returns a tuple with the LastUsedAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountIPAccessListEntry) GetLastUsedAddressOk() (*string, bool) { + if o == nil || IsNil(o.LastUsedAddress) { + return nil, false + } + + return o.LastUsedAddress, true +} + +// HasLastUsedAddress returns a boolean if a field has been set. +func (o *ServiceAccountIPAccessListEntry) HasLastUsedAddress() bool { + if o != nil && !IsNil(o.LastUsedAddress) { + return true + } + + return false +} + +// SetLastUsedAddress gets a reference to the given string and assigns it to the LastUsedAddress field. +func (o *ServiceAccountIPAccessListEntry) SetLastUsedAddress(v string) { + o.LastUsedAddress = &v +} + +// GetLastUsedAt returns the LastUsedAt field value if set, zero value otherwise +func (o *ServiceAccountIPAccessListEntry) GetLastUsedAt() time.Time { + if o == nil || IsNil(o.LastUsedAt) { + var ret time.Time + return ret + } + return *o.LastUsedAt +} + +// GetLastUsedAtOk returns a tuple with the LastUsedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountIPAccessListEntry) GetLastUsedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastUsedAt) { + return nil, false + } + + return o.LastUsedAt, true +} + +// HasLastUsedAt returns a boolean if a field has been set. +func (o *ServiceAccountIPAccessListEntry) HasLastUsedAt() bool { + if o != nil && !IsNil(o.LastUsedAt) { + return true + } + + return false +} + +// SetLastUsedAt gets a reference to the given time.Time and assigns it to the LastUsedAt field. +func (o *ServiceAccountIPAccessListEntry) SetLastUsedAt(v time.Time) { + o.LastUsedAt = &v +} + +// GetRequestCount returns the RequestCount field value if set, zero value otherwise +func (o *ServiceAccountIPAccessListEntry) GetRequestCount() int { + if o == nil || IsNil(o.RequestCount) { + var ret int + return ret + } + return *o.RequestCount +} + +// GetRequestCountOk returns a tuple with the RequestCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountIPAccessListEntry) GetRequestCountOk() (*int, bool) { + if o == nil || IsNil(o.RequestCount) { + return nil, false + } + + return o.RequestCount, true +} + +// HasRequestCount returns a boolean if a field has been set. +func (o *ServiceAccountIPAccessListEntry) HasRequestCount() bool { + if o != nil && !IsNil(o.RequestCount) { + return true + } + + return false +} + +// SetRequestCount gets a reference to the given int and assigns it to the RequestCount field. +func (o *ServiceAccountIPAccessListEntry) SetRequestCount(v int) { + o.RequestCount = &v +} diff --git a/admin/model_service_account_secret.go b/admin/model_service_account_secret.go new file mode 100644 index 000000000..3b593a020 --- /dev/null +++ b/admin/model_service_account_secret.go @@ -0,0 +1,220 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +import ( + "time" +) + +// ServiceAccountSecret struct for ServiceAccountSecret +type ServiceAccountSecret struct { + // The date that the secret was created on. + // Read only field. + CreatedAt time.Time `json:"createdAt"` + // The date for the expiration of the secret. + // Read only field. + ExpiresAt time.Time `json:"expiresAt"` + // Unique 24-hexadecimal digit string that identifies the secret. + // Read only field. + Id string `json:"id"` + // The last time the secret was used. + // Read only field. + LastUsedAt *time.Time `json:"lastUsedAt,omitempty"` + // The masked Service Account secret. + // Read only field. + MaskedSecretValue *string `json:"maskedSecretValue,omitempty"` + // The secret for the Service Account. It will be returned only the first time after creation. + // Read only field. + Secret *string `json:"secret,omitempty"` +} + +// NewServiceAccountSecret instantiates a new ServiceAccountSecret object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceAccountSecret(createdAt time.Time, expiresAt time.Time, id string) *ServiceAccountSecret { + this := ServiceAccountSecret{} + this.CreatedAt = createdAt + this.ExpiresAt = expiresAt + this.Id = id + return &this +} + +// NewServiceAccountSecretWithDefaults instantiates a new ServiceAccountSecret object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceAccountSecretWithDefaults() *ServiceAccountSecret { + this := ServiceAccountSecret{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value +func (o *ServiceAccountSecret) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *ServiceAccountSecret) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *ServiceAccountSecret) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetExpiresAt returns the ExpiresAt field value +func (o *ServiceAccountSecret) GetExpiresAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value +// and a boolean to check if the value has been set. +func (o *ServiceAccountSecret) GetExpiresAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ExpiresAt, true +} + +// SetExpiresAt sets field value +func (o *ServiceAccountSecret) SetExpiresAt(v time.Time) { + o.ExpiresAt = v +} + +// GetId returns the Id field value +func (o *ServiceAccountSecret) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ServiceAccountSecret) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ServiceAccountSecret) SetId(v string) { + o.Id = v +} + +// GetLastUsedAt returns the LastUsedAt field value if set, zero value otherwise +func (o *ServiceAccountSecret) GetLastUsedAt() time.Time { + if o == nil || IsNil(o.LastUsedAt) { + var ret time.Time + return ret + } + return *o.LastUsedAt +} + +// GetLastUsedAtOk returns a tuple with the LastUsedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountSecret) GetLastUsedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastUsedAt) { + return nil, false + } + + return o.LastUsedAt, true +} + +// HasLastUsedAt returns a boolean if a field has been set. +func (o *ServiceAccountSecret) HasLastUsedAt() bool { + if o != nil && !IsNil(o.LastUsedAt) { + return true + } + + return false +} + +// SetLastUsedAt gets a reference to the given time.Time and assigns it to the LastUsedAt field. +func (o *ServiceAccountSecret) SetLastUsedAt(v time.Time) { + o.LastUsedAt = &v +} + +// GetMaskedSecretValue returns the MaskedSecretValue field value if set, zero value otherwise +func (o *ServiceAccountSecret) GetMaskedSecretValue() string { + if o == nil || IsNil(o.MaskedSecretValue) { + var ret string + return ret + } + return *o.MaskedSecretValue +} + +// GetMaskedSecretValueOk returns a tuple with the MaskedSecretValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountSecret) GetMaskedSecretValueOk() (*string, bool) { + if o == nil || IsNil(o.MaskedSecretValue) { + return nil, false + } + + return o.MaskedSecretValue, true +} + +// HasMaskedSecretValue returns a boolean if a field has been set. +func (o *ServiceAccountSecret) HasMaskedSecretValue() bool { + if o != nil && !IsNil(o.MaskedSecretValue) { + return true + } + + return false +} + +// SetMaskedSecretValue gets a reference to the given string and assigns it to the MaskedSecretValue field. +func (o *ServiceAccountSecret) SetMaskedSecretValue(v string) { + o.MaskedSecretValue = &v +} + +// GetSecret returns the Secret field value if set, zero value otherwise +func (o *ServiceAccountSecret) GetSecret() string { + if o == nil || IsNil(o.Secret) { + var ret string + return ret + } + return *o.Secret +} + +// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceAccountSecret) GetSecretOk() (*string, bool) { + if o == nil || IsNil(o.Secret) { + return nil, false + } + + return o.Secret, true +} + +// HasSecret returns a boolean if a field has been set. +func (o *ServiceAccountSecret) HasSecret() bool { + if o != nil && !IsNil(o.Secret) { + return true + } + + return false +} + +// SetSecret gets a reference to the given string and assigns it to the Secret field. +func (o *ServiceAccountSecret) SetSecret(v string) { + o.Secret = &v +} diff --git a/admin/model_service_account_secret_request.go b/admin/model_service_account_secret_request.go new file mode 100644 index 000000000..dc7d666d4 --- /dev/null +++ b/admin/model_service_account_secret_request.go @@ -0,0 +1,51 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// ServiceAccountSecretRequest struct for ServiceAccountSecretRequest +type ServiceAccountSecretRequest struct { + // The expiration time of the new Service Account secret. The expiration is provided in hours. + SecretExpiresAfterHours int `json:"secretExpiresAfterHours"` +} + +// NewServiceAccountSecretRequest instantiates a new ServiceAccountSecretRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceAccountSecretRequest(secretExpiresAfterHours int) *ServiceAccountSecretRequest { + this := ServiceAccountSecretRequest{} + this.SecretExpiresAfterHours = secretExpiresAfterHours + return &this +} + +// NewServiceAccountSecretRequestWithDefaults instantiates a new ServiceAccountSecretRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceAccountSecretRequestWithDefaults() *ServiceAccountSecretRequest { + this := ServiceAccountSecretRequest{} + return &this +} + +// GetSecretExpiresAfterHours returns the SecretExpiresAfterHours field value +func (o *ServiceAccountSecretRequest) GetSecretExpiresAfterHours() int { + if o == nil { + var ret int + return ret + } + + return o.SecretExpiresAfterHours +} + +// GetSecretExpiresAfterHoursOk returns a tuple with the SecretExpiresAfterHours field value +// and a boolean to check if the value has been set. +func (o *ServiceAccountSecretRequest) GetSecretExpiresAfterHoursOk() (*int, bool) { + if o == nil { + return nil, false + } + return &o.SecretExpiresAfterHours, true +} + +// SetSecretExpiresAfterHours sets field value +func (o *ServiceAccountSecretRequest) SetSecretExpiresAfterHours(v int) { + o.SecretExpiresAfterHours = v +} diff --git a/docs/doc_last_reference.md b/docs/doc_last_reference.md index d5f156462..e97847367 100644 --- a/docs/doc_last_reference.md +++ b/docs/doc_last_reference.md @@ -352,6 +352,28 @@ Class | Method | HTTP request | Description | *ServerlessPrivateEndpointsApi* | [GetServerlessPrivateEndpoint](./docs/ServerlessPrivateEndpointsApi.md#getserverlessprivateendpoint) | **Get** /api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId} | Return One Private Endpoint for One Serverless Instance | *ServerlessPrivateEndpointsApi* | [ListServerlessPrivateEndpoints](./docs/ServerlessPrivateEndpointsApi.md#listserverlessprivateendpoints) | **Get** /api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint | Return All Private Endpoints for One Serverless Instance | *ServerlessPrivateEndpointsApi* | [UpdateServerlessPrivateEndpoint](./docs/ServerlessPrivateEndpointsApi.md#updateserverlessprivateendpoint) | **Patch** /api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId} | Update One Private Endpoint for One Serverless Instance | +*ServiceAccountsApi* | [AddProjectServiceAccount](./docs/ServiceAccountsApi.md#addprojectserviceaccount) | **Post** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite | Assign One Service Account to One Project | +*ServiceAccountsApi* | [CreateProjectServiceAccount](./docs/ServiceAccountsApi.md#createprojectserviceaccount) | **Post** /api/atlas/v2/groups/{groupId}/serviceAccounts | Create and Assign one Service Account to one Project | +*ServiceAccountsApi* | [CreateProjectServiceAccountAccessList](./docs/ServiceAccountsApi.md#createprojectserviceaccountaccesslist) | **Post** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList | Add Access List entries for one Project Service Account | +*ServiceAccountsApi* | [CreateProjectServiceAccountSecret](./docs/ServiceAccountsApi.md#createprojectserviceaccountsecret) | **Post** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets | Create one Project Service Account Secret | +*ServiceAccountsApi* | [CreateServiceAccount](./docs/ServiceAccountsApi.md#createserviceaccount) | **Post** /api/atlas/v2/orgs/{orgId}/serviceAccounts | Create one Organization Service Account | +*ServiceAccountsApi* | [CreateServiceAccountAccessList](./docs/ServiceAccountsApi.md#createserviceaccountaccesslist) | **Post** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList | Add Access List entries for one Organization Service Account | +*ServiceAccountsApi* | [CreateServiceAccountSecret](./docs/ServiceAccountsApi.md#createserviceaccountsecret) | **Post** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets | Create one Organization Service Account Secret | +*ServiceAccountsApi* | [DeleteProjectServiceAccount](./docs/ServiceAccountsApi.md#deleteprojectserviceaccount) | **Delete** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId} | Unassign One Service Account from One Project | +*ServiceAccountsApi* | [DeleteProjectServiceAccountAccessListEntry](./docs/ServiceAccountsApi.md#deleteprojectserviceaccountaccesslistentry) | **Delete** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress} | Remove One Access List entry from one Project Service Account | +*ServiceAccountsApi* | [DeleteProjectServiceAccountSecret](./docs/ServiceAccountsApi.md#deleteprojectserviceaccountsecret) | **Delete** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId} | Delete one Project Service Account Secret | +*ServiceAccountsApi* | [DeleteServiceAccount](./docs/ServiceAccountsApi.md#deleteserviceaccount) | **Delete** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId} | Delete one Organization Service Account | +*ServiceAccountsApi* | [DeleteServiceAccountAccessListEntry](./docs/ServiceAccountsApi.md#deleteserviceaccountaccesslistentry) | **Delete** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress} | Remove One Access List entry from one Organization Service Account | +*ServiceAccountsApi* | [DeleteServiceAccountSecret](./docs/ServiceAccountsApi.md#deleteserviceaccountsecret) | **Delete** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId} | Delete a Organization Service Account Secret | +*ServiceAccountsApi* | [GetProjectServiceAccount](./docs/ServiceAccountsApi.md#getprojectserviceaccount) | **Get** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId} | Get one Project Service Account | +*ServiceAccountsApi* | [GetServiceAccount](./docs/ServiceAccountsApi.md#getserviceaccount) | **Get** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId} | Get one Organization Service Account | +*ServiceAccountsApi* | [ListProjectServiceAccountAccessList](./docs/ServiceAccountsApi.md#listprojectserviceaccountaccesslist) | **Get** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList | Return All Access List entries for one Project Service Account | +*ServiceAccountsApi* | [ListProjectServiceAccounts](./docs/ServiceAccountsApi.md#listprojectserviceaccounts) | **Get** /api/atlas/v2/groups/{groupId}/serviceAccounts | List All Project Service Accounts | +*ServiceAccountsApi* | [ListServiceAccountAccessList](./docs/ServiceAccountsApi.md#listserviceaccountaccesslist) | **Get** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList | Return All Access List entries for one Organization Service Account | +*ServiceAccountsApi* | [ListServiceAccountProjects](./docs/ServiceAccountsApi.md#listserviceaccountprojects) | **Get** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups | Return All Service Account Project assignments | +*ServiceAccountsApi* | [ListServiceAccounts](./docs/ServiceAccountsApi.md#listserviceaccounts) | **Get** /api/atlas/v2/orgs/{orgId}/serviceAccounts | List All Organization Service Accounts | +*ServiceAccountsApi* | [UpdateProjectServiceAccount](./docs/ServiceAccountsApi.md#updateprojectserviceaccount) | **Patch** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId} | Update one Project Service Account | +*ServiceAccountsApi* | [UpdateServiceAccount](./docs/ServiceAccountsApi.md#updateserviceaccount) | **Patch** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId} | Update one Organization Service Account | *SharedTierRestoreJobsApi* | [CreateSharedClusterBackupRestoreJob](./docs/SharedTierRestoreJobsApi.md#createsharedclusterbackuprestorejob) | **Post** /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restore | Create One Restore Job from One M2 or M5 Cluster | *SharedTierRestoreJobsApi* | [GetSharedClusterBackupRestoreJob](./docs/SharedTierRestoreJobsApi.md#getsharedclusterbackuprestorejob) | **Get** /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restores/{restoreId} | Return One Restore Job for One M2 or M5 Cluster | *SharedTierRestoreJobsApi* | [ListSharedClusterBackupRestoreJobs](./docs/SharedTierRestoreJobsApi.md#listsharedclusterbackuprestorejobs) | **Get** /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restores | Return All Restore Jobs for One M2 or M5 Cluster | @@ -611,6 +633,10 @@ Class | Method | HTTP request | Description | - [GroupPaginatedEvent](./docs/GroupPaginatedEvent.md) - [GroupRole](./docs/GroupRole.md) - [GroupService](./docs/GroupService.md) + - [GroupServiceAccount](./docs/GroupServiceAccount.md) + - [GroupServiceAccountRequest](./docs/GroupServiceAccountRequest.md) + - [GroupServiceAccountRoleAssignment](./docs/GroupServiceAccountRoleAssignment.md) + - [GroupServiceAccountUpdateRequest](./docs/GroupServiceAccountUpdateRequest.md) - [GroupSettings](./docs/GroupSettings.md) - [GroupUpdate](./docs/GroupUpdate.md) - [HardwareSpec20240805](./docs/HardwareSpec20240805.md) @@ -657,6 +683,9 @@ Class | Method | HTTP request | Description | - [OrgFederationSettings](./docs/OrgFederationSettings.md) - [OrgGroup](./docs/OrgGroup.md) - [OrgPaginatedEvent](./docs/OrgPaginatedEvent.md) + - [OrgServiceAccount](./docs/OrgServiceAccount.md) + - [OrgServiceAccountRequest](./docs/OrgServiceAccountRequest.md) + - [OrgServiceAccountUpdateRequest](./docs/OrgServiceAccountUpdateRequest.md) - [OrganizationInvitation](./docs/OrganizationInvitation.md) - [OrganizationInvitationGroupRoleAssignmentsRequest](./docs/OrganizationInvitationGroupRoleAssignmentsRequest.md) - [OrganizationInvitationRequest](./docs/OrganizationInvitationRequest.md) @@ -697,11 +726,13 @@ Class | Method | HTTP request | Description | - [PaginatedDiskPartition](./docs/PaginatedDiskPartition.md) - [PaginatedEventTypeDetailsResponse](./docs/PaginatedEventTypeDetailsResponse.md) - [PaginatedFederationIdentityProvider](./docs/PaginatedFederationIdentityProvider.md) + - [PaginatedGroupServiceAccounts](./docs/PaginatedGroupServiceAccounts.md) - [PaginatedHostViewAtlas](./docs/PaginatedHostViewAtlas.md) - [PaginatedIntegration](./docs/PaginatedIntegration.md) - [PaginatedNetworkAccess](./docs/PaginatedNetworkAccess.md) - [PaginatedOnlineArchive](./docs/PaginatedOnlineArchive.md) - [PaginatedOrgGroup](./docs/PaginatedOrgGroup.md) + - [PaginatedOrgServiceAccounts](./docs/PaginatedOrgServiceAccounts.md) - [PaginatedOrganization](./docs/PaginatedOrganization.md) - [PaginatedPipelineRun](./docs/PaginatedPipelineRun.md) - [PaginatedPrivateNetworkEndpointIdEntry](./docs/PaginatedPrivateNetworkEndpointIdEntry.md) @@ -709,6 +740,8 @@ Class | Method | HTTP request | Description | - [PaginatedRestoreJob](./docs/PaginatedRestoreJob.md) - [PaginatedRoleMapping](./docs/PaginatedRoleMapping.md) - [PaginatedServerlessInstanceDescription](./docs/PaginatedServerlessInstanceDescription.md) + - [PaginatedServiceAccountGroup](./docs/PaginatedServiceAccountGroup.md) + - [PaginatedServiceAccountIPAccessEntry](./docs/PaginatedServiceAccountIPAccessEntry.md) - [PaginatedSnapshot](./docs/PaginatedSnapshot.md) - [PaginatedTeam](./docs/PaginatedTeam.md) - [PaginatedTeamRole](./docs/PaginatedTeamRole.md) @@ -762,6 +795,10 @@ Class | Method | HTTP request | Description | - [ServerlessTenantCreateRequest](./docs/ServerlessTenantCreateRequest.md) - [ServerlessTenantEndpoint](./docs/ServerlessTenantEndpoint.md) - [ServerlessTenantEndpointUpdate](./docs/ServerlessTenantEndpointUpdate.md) + - [ServiceAccountGroup](./docs/ServiceAccountGroup.md) + - [ServiceAccountIPAccessListEntry](./docs/ServiceAccountIPAccessListEntry.md) + - [ServiceAccountSecret](./docs/ServiceAccountSecret.md) + - [ServiceAccountSecretRequest](./docs/ServiceAccountSecretRequest.md) - [ShardEntry](./docs/ShardEntry.md) - [ShardKeys](./docs/ShardKeys.md) - [ShardingRequest](./docs/ShardingRequest.md) diff --git a/docs/docs/GroupServiceAccount.md b/docs/docs/GroupServiceAccount.md new file mode 100644 index 000000000..5cefdb720 --- /dev/null +++ b/docs/docs/GroupServiceAccount.md @@ -0,0 +1,180 @@ +# GroupServiceAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | Pointer to **string** | The Client ID of the Service Account. | [optional] +**CreatedAt** | Pointer to **time.Time** | The date that the Service Account was created on. | [optional] +**Description** | Pointer to **string** | Human readable description for the Service Account. | [optional] +**Name** | Pointer to **string** | Human-readable name for the Service Account. | [optional] +**Roles** | Pointer to **[]string** | A list of Project roles associated with the Service Account. | [optional] +**Secrets** | Pointer to [**[]ServiceAccountSecret**](ServiceAccountSecret.md) | A list of secrets associated with the specified Service Account. | [optional] + +## Methods + +### NewGroupServiceAccount + +`func NewGroupServiceAccount() *GroupServiceAccount` + +NewGroupServiceAccount instantiates a new GroupServiceAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGroupServiceAccountWithDefaults + +`func NewGroupServiceAccountWithDefaults() *GroupServiceAccount` + +NewGroupServiceAccountWithDefaults instantiates a new GroupServiceAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClientId + +`func (o *GroupServiceAccount) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *GroupServiceAccount) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *GroupServiceAccount) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + +### HasClientId + +`func (o *GroupServiceAccount) HasClientId() bool` + +HasClientId returns a boolean if a field has been set. +### GetCreatedAt + +`func (o *GroupServiceAccount) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *GroupServiceAccount) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *GroupServiceAccount) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *GroupServiceAccount) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. +### GetDescription + +`func (o *GroupServiceAccount) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *GroupServiceAccount) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *GroupServiceAccount) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *GroupServiceAccount) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. +### GetName + +`func (o *GroupServiceAccount) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *GroupServiceAccount) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *GroupServiceAccount) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *GroupServiceAccount) HasName() bool` + +HasName returns a boolean if a field has been set. +### GetRoles + +`func (o *GroupServiceAccount) GetRoles() []string` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *GroupServiceAccount) GetRolesOk() (*[]string, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *GroupServiceAccount) SetRoles(v []string)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *GroupServiceAccount) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. +### GetSecrets + +`func (o *GroupServiceAccount) GetSecrets() []ServiceAccountSecret` + +GetSecrets returns the Secrets field if non-nil, zero value otherwise. + +### GetSecretsOk + +`func (o *GroupServiceAccount) GetSecretsOk() (*[]ServiceAccountSecret, bool)` + +GetSecretsOk returns a tuple with the Secrets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecrets + +`func (o *GroupServiceAccount) SetSecrets(v []ServiceAccountSecret)` + +SetSecrets sets Secrets field to given value. + +### HasSecrets + +`func (o *GroupServiceAccount) HasSecrets() bool` + +HasSecrets returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/GroupServiceAccountRequest.md b/docs/docs/GroupServiceAccountRequest.md new file mode 100644 index 000000000..0c55a7017 --- /dev/null +++ b/docs/docs/GroupServiceAccountRequest.md @@ -0,0 +1,110 @@ +# GroupServiceAccountRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | Human readable description for the Service Account. | +**Name** | **string** | Human-readable name for the Service Account. The name is modifiable and does not have to be unique. | +**Roles** | **[]string** | A list of project-level roles for the Service Account. | +**SecretExpiresAfterHours** | **int** | The expiration time of the new Service Account secret. The expiration is provided in hours. | + +## Methods + +### NewGroupServiceAccountRequest + +`func NewGroupServiceAccountRequest(description string, name string, roles []string, secretExpiresAfterHours int, ) *GroupServiceAccountRequest` + +NewGroupServiceAccountRequest instantiates a new GroupServiceAccountRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGroupServiceAccountRequestWithDefaults + +`func NewGroupServiceAccountRequestWithDefaults() *GroupServiceAccountRequest` + +NewGroupServiceAccountRequestWithDefaults instantiates a new GroupServiceAccountRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *GroupServiceAccountRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *GroupServiceAccountRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *GroupServiceAccountRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### GetName + +`func (o *GroupServiceAccountRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *GroupServiceAccountRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *GroupServiceAccountRequest) SetName(v string)` + +SetName sets Name field to given value. + +### GetRoles + +`func (o *GroupServiceAccountRequest) GetRoles() []string` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *GroupServiceAccountRequest) GetRolesOk() (*[]string, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *GroupServiceAccountRequest) SetRoles(v []string)` + +SetRoles sets Roles field to given value. + +### GetSecretExpiresAfterHours + +`func (o *GroupServiceAccountRequest) GetSecretExpiresAfterHours() int` + +GetSecretExpiresAfterHours returns the SecretExpiresAfterHours field if non-nil, zero value otherwise. + +### GetSecretExpiresAfterHoursOk + +`func (o *GroupServiceAccountRequest) GetSecretExpiresAfterHoursOk() (*int, bool)` + +GetSecretExpiresAfterHoursOk returns a tuple with the SecretExpiresAfterHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecretExpiresAfterHours + +`func (o *GroupServiceAccountRequest) SetSecretExpiresAfterHours(v int)` + +SetSecretExpiresAfterHours sets SecretExpiresAfterHours field to given value. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/GroupServiceAccountRoleAssignment.md b/docs/docs/GroupServiceAccountRoleAssignment.md new file mode 100644 index 000000000..f54008204 --- /dev/null +++ b/docs/docs/GroupServiceAccountRoleAssignment.md @@ -0,0 +1,50 @@ +# GroupServiceAccountRoleAssignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Roles** | **[]string** | The Project permissions for the Service Account in the specified Project. | + +## Methods + +### NewGroupServiceAccountRoleAssignment + +`func NewGroupServiceAccountRoleAssignment(roles []string, ) *GroupServiceAccountRoleAssignment` + +NewGroupServiceAccountRoleAssignment instantiates a new GroupServiceAccountRoleAssignment object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGroupServiceAccountRoleAssignmentWithDefaults + +`func NewGroupServiceAccountRoleAssignmentWithDefaults() *GroupServiceAccountRoleAssignment` + +NewGroupServiceAccountRoleAssignmentWithDefaults instantiates a new GroupServiceAccountRoleAssignment object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRoles + +`func (o *GroupServiceAccountRoleAssignment) GetRoles() []string` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *GroupServiceAccountRoleAssignment) GetRolesOk() (*[]string, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *GroupServiceAccountRoleAssignment) SetRoles(v []string)` + +SetRoles sets Roles field to given value. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/GroupServiceAccountUpdateRequest.md b/docs/docs/GroupServiceAccountUpdateRequest.md new file mode 100644 index 000000000..fd293a7ed --- /dev/null +++ b/docs/docs/GroupServiceAccountUpdateRequest.md @@ -0,0 +1,105 @@ +# GroupServiceAccountUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | Human readable description for the Service Account. | [optional] +**Name** | Pointer to **string** | Human-readable name for the Service Account. The name is modifiable and does not have to be unique. | [optional] +**Roles** | Pointer to **[]string** | A list of Project roles associated with the Service Account. | [optional] + +## Methods + +### NewGroupServiceAccountUpdateRequest + +`func NewGroupServiceAccountUpdateRequest() *GroupServiceAccountUpdateRequest` + +NewGroupServiceAccountUpdateRequest instantiates a new GroupServiceAccountUpdateRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGroupServiceAccountUpdateRequestWithDefaults + +`func NewGroupServiceAccountUpdateRequestWithDefaults() *GroupServiceAccountUpdateRequest` + +NewGroupServiceAccountUpdateRequestWithDefaults instantiates a new GroupServiceAccountUpdateRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *GroupServiceAccountUpdateRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *GroupServiceAccountUpdateRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *GroupServiceAccountUpdateRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *GroupServiceAccountUpdateRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. +### GetName + +`func (o *GroupServiceAccountUpdateRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *GroupServiceAccountUpdateRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *GroupServiceAccountUpdateRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *GroupServiceAccountUpdateRequest) HasName() bool` + +HasName returns a boolean if a field has been set. +### GetRoles + +`func (o *GroupServiceAccountUpdateRequest) GetRoles() []string` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *GroupServiceAccountUpdateRequest) GetRolesOk() (*[]string, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *GroupServiceAccountUpdateRequest) SetRoles(v []string)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *GroupServiceAccountUpdateRequest) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/OrgServiceAccount.md b/docs/docs/OrgServiceAccount.md new file mode 100644 index 000000000..9e005c984 --- /dev/null +++ b/docs/docs/OrgServiceAccount.md @@ -0,0 +1,180 @@ +# OrgServiceAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | Pointer to **string** | The Client ID of the Service Account. | [optional] +**CreatedAt** | Pointer to **time.Time** | The date that the Service Account was created on. | [optional] +**Description** | Pointer to **string** | Human readable description for the Service Account. | [optional] +**Name** | Pointer to **string** | Human-readable name for the Service Account. | [optional] +**Roles** | Pointer to **[]string** | A list of Organization roles associated with the Service Account. | [optional] +**Secrets** | Pointer to [**[]ServiceAccountSecret**](ServiceAccountSecret.md) | A list of secrets associated with the specified Service Account. | [optional] + +## Methods + +### NewOrgServiceAccount + +`func NewOrgServiceAccount() *OrgServiceAccount` + +NewOrgServiceAccount instantiates a new OrgServiceAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrgServiceAccountWithDefaults + +`func NewOrgServiceAccountWithDefaults() *OrgServiceAccount` + +NewOrgServiceAccountWithDefaults instantiates a new OrgServiceAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClientId + +`func (o *OrgServiceAccount) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *OrgServiceAccount) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *OrgServiceAccount) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + +### HasClientId + +`func (o *OrgServiceAccount) HasClientId() bool` + +HasClientId returns a boolean if a field has been set. +### GetCreatedAt + +`func (o *OrgServiceAccount) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *OrgServiceAccount) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *OrgServiceAccount) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *OrgServiceAccount) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. +### GetDescription + +`func (o *OrgServiceAccount) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *OrgServiceAccount) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *OrgServiceAccount) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *OrgServiceAccount) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. +### GetName + +`func (o *OrgServiceAccount) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *OrgServiceAccount) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *OrgServiceAccount) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *OrgServiceAccount) HasName() bool` + +HasName returns a boolean if a field has been set. +### GetRoles + +`func (o *OrgServiceAccount) GetRoles() []string` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *OrgServiceAccount) GetRolesOk() (*[]string, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *OrgServiceAccount) SetRoles(v []string)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *OrgServiceAccount) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. +### GetSecrets + +`func (o *OrgServiceAccount) GetSecrets() []ServiceAccountSecret` + +GetSecrets returns the Secrets field if non-nil, zero value otherwise. + +### GetSecretsOk + +`func (o *OrgServiceAccount) GetSecretsOk() (*[]ServiceAccountSecret, bool)` + +GetSecretsOk returns a tuple with the Secrets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecrets + +`func (o *OrgServiceAccount) SetSecrets(v []ServiceAccountSecret)` + +SetSecrets sets Secrets field to given value. + +### HasSecrets + +`func (o *OrgServiceAccount) HasSecrets() bool` + +HasSecrets returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/OrgServiceAccountRequest.md b/docs/docs/OrgServiceAccountRequest.md new file mode 100644 index 000000000..bb8010d37 --- /dev/null +++ b/docs/docs/OrgServiceAccountRequest.md @@ -0,0 +1,110 @@ +# OrgServiceAccountRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | Human readable description for the Service Account. | +**Name** | **string** | Human-readable name for the Service Account. The name is modifiable and does not have to be unique. | +**Roles** | **[]string** | A list of organization-level roles for the Service Account. | +**SecretExpiresAfterHours** | **int** | The expiration time of the new Service Account secret. The expiration is provided in hours. | + +## Methods + +### NewOrgServiceAccountRequest + +`func NewOrgServiceAccountRequest(description string, name string, roles []string, secretExpiresAfterHours int, ) *OrgServiceAccountRequest` + +NewOrgServiceAccountRequest instantiates a new OrgServiceAccountRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrgServiceAccountRequestWithDefaults + +`func NewOrgServiceAccountRequestWithDefaults() *OrgServiceAccountRequest` + +NewOrgServiceAccountRequestWithDefaults instantiates a new OrgServiceAccountRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *OrgServiceAccountRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *OrgServiceAccountRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *OrgServiceAccountRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### GetName + +`func (o *OrgServiceAccountRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *OrgServiceAccountRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *OrgServiceAccountRequest) SetName(v string)` + +SetName sets Name field to given value. + +### GetRoles + +`func (o *OrgServiceAccountRequest) GetRoles() []string` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *OrgServiceAccountRequest) GetRolesOk() (*[]string, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *OrgServiceAccountRequest) SetRoles(v []string)` + +SetRoles sets Roles field to given value. + +### GetSecretExpiresAfterHours + +`func (o *OrgServiceAccountRequest) GetSecretExpiresAfterHours() int` + +GetSecretExpiresAfterHours returns the SecretExpiresAfterHours field if non-nil, zero value otherwise. + +### GetSecretExpiresAfterHoursOk + +`func (o *OrgServiceAccountRequest) GetSecretExpiresAfterHoursOk() (*int, bool)` + +GetSecretExpiresAfterHoursOk returns a tuple with the SecretExpiresAfterHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecretExpiresAfterHours + +`func (o *OrgServiceAccountRequest) SetSecretExpiresAfterHours(v int)` + +SetSecretExpiresAfterHours sets SecretExpiresAfterHours field to given value. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/OrgServiceAccountUpdateRequest.md b/docs/docs/OrgServiceAccountUpdateRequest.md new file mode 100644 index 000000000..34a123871 --- /dev/null +++ b/docs/docs/OrgServiceAccountUpdateRequest.md @@ -0,0 +1,105 @@ +# OrgServiceAccountUpdateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | Human readable description for the Service Account. | [optional] +**Name** | Pointer to **string** | Human-readable name for the Service Account. The name is modifiable and does not have to be unique. | [optional] +**Roles** | Pointer to **[]string** | A list of organization-level roles for the Service Account. | [optional] + +## Methods + +### NewOrgServiceAccountUpdateRequest + +`func NewOrgServiceAccountUpdateRequest() *OrgServiceAccountUpdateRequest` + +NewOrgServiceAccountUpdateRequest instantiates a new OrgServiceAccountUpdateRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrgServiceAccountUpdateRequestWithDefaults + +`func NewOrgServiceAccountUpdateRequestWithDefaults() *OrgServiceAccountUpdateRequest` + +NewOrgServiceAccountUpdateRequestWithDefaults instantiates a new OrgServiceAccountUpdateRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *OrgServiceAccountUpdateRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *OrgServiceAccountUpdateRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *OrgServiceAccountUpdateRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *OrgServiceAccountUpdateRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. +### GetName + +`func (o *OrgServiceAccountUpdateRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *OrgServiceAccountUpdateRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *OrgServiceAccountUpdateRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *OrgServiceAccountUpdateRequest) HasName() bool` + +HasName returns a boolean if a field has been set. +### GetRoles + +`func (o *OrgServiceAccountUpdateRequest) GetRoles() []string` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *OrgServiceAccountUpdateRequest) GetRolesOk() (*[]string, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *OrgServiceAccountUpdateRequest) SetRoles(v []string)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *OrgServiceAccountUpdateRequest) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/OrganizationSettings.md b/docs/docs/OrganizationSettings.md index 0d0271667..7a3e7afd7 100644 --- a/docs/docs/OrganizationSettings.md +++ b/docs/docs/OrganizationSettings.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ApiAccessListRequired** | Pointer to **bool** | Flag that indicates whether to require API operations to originate from an IP Address added to the API access list for the specified organization. | [optional] +**MaxServiceAccountSecretValidityInHours** | Pointer to **int** | Number that represents the maximum period before expiry in hours for new Atlas Admin API Service Account secrets within the specified organization. | [optional] **MultiFactorAuthRequired** | Pointer to **bool** | Flag that indicates whether to require users to set up Multi-Factor Authentication (MFA) before accessing the specified organization. To learn more, see: https://www.mongodb.com/docs/atlas/security-multi-factor-authentication/. | [optional] **RestrictEmployeeAccess** | Pointer to **bool** | Flag that indicates whether to block MongoDB Support from accessing Atlas infrastructure and cluster logs for any deployment in the specified organization without explicit permission. Once this setting is turned on, you can grant MongoDB Support a 24-hour bypass access to the Atlas deployment to resolve support issues. To learn more, see: https://www.mongodb.com/docs/atlas/security-restrict-support-access/. | [optional] **SecurityContact** | Pointer to **string** | String that specifies a single email address for the specified organization to receive security-related notifications. Specifying a security contact does not grant them authorization or access to Atlas for security decisions or approvals. An empty string is valid and clears the existing security contact (if any). | [optional] @@ -52,6 +53,30 @@ SetApiAccessListRequired sets ApiAccessListRequired field to given value. `func (o *OrganizationSettings) HasApiAccessListRequired() bool` HasApiAccessListRequired returns a boolean if a field has been set. +### GetMaxServiceAccountSecretValidityInHours + +`func (o *OrganizationSettings) GetMaxServiceAccountSecretValidityInHours() int` + +GetMaxServiceAccountSecretValidityInHours returns the MaxServiceAccountSecretValidityInHours field if non-nil, zero value otherwise. + +### GetMaxServiceAccountSecretValidityInHoursOk + +`func (o *OrganizationSettings) GetMaxServiceAccountSecretValidityInHoursOk() (*int, bool)` + +GetMaxServiceAccountSecretValidityInHoursOk returns a tuple with the MaxServiceAccountSecretValidityInHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxServiceAccountSecretValidityInHours + +`func (o *OrganizationSettings) SetMaxServiceAccountSecretValidityInHours(v int)` + +SetMaxServiceAccountSecretValidityInHours sets MaxServiceAccountSecretValidityInHours field to given value. + +### HasMaxServiceAccountSecretValidityInHours + +`func (o *OrganizationSettings) HasMaxServiceAccountSecretValidityInHours() bool` + +HasMaxServiceAccountSecretValidityInHours returns a boolean if a field has been set. ### GetMultiFactorAuthRequired `func (o *OrganizationSettings) GetMultiFactorAuthRequired() bool` diff --git a/docs/docs/PaginatedGroupServiceAccounts.md b/docs/docs/PaginatedGroupServiceAccounts.md new file mode 100644 index 000000000..05ba9d8f3 --- /dev/null +++ b/docs/docs/PaginatedGroupServiceAccounts.md @@ -0,0 +1,105 @@ +# PaginatedGroupServiceAccounts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Links** | Pointer to [**[]Link**](Link.md) | List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. | [optional] [readonly] +**Results** | Pointer to [**[]GroupServiceAccount**](GroupServiceAccount.md) | List of returned documents that MongoDB Cloud provides when completing this request. | [optional] [readonly] +**TotalCount** | Pointer to **int** | Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. | [optional] [readonly] + +## Methods + +### NewPaginatedGroupServiceAccounts + +`func NewPaginatedGroupServiceAccounts() *PaginatedGroupServiceAccounts` + +NewPaginatedGroupServiceAccounts instantiates a new PaginatedGroupServiceAccounts object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaginatedGroupServiceAccountsWithDefaults + +`func NewPaginatedGroupServiceAccountsWithDefaults() *PaginatedGroupServiceAccounts` + +NewPaginatedGroupServiceAccountsWithDefaults instantiates a new PaginatedGroupServiceAccounts object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLinks + +`func (o *PaginatedGroupServiceAccounts) GetLinks() []Link` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *PaginatedGroupServiceAccounts) GetLinksOk() (*[]Link, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *PaginatedGroupServiceAccounts) SetLinks(v []Link)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *PaginatedGroupServiceAccounts) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. +### GetResults + +`func (o *PaginatedGroupServiceAccounts) GetResults() []GroupServiceAccount` + +GetResults returns the Results field if non-nil, zero value otherwise. + +### GetResultsOk + +`func (o *PaginatedGroupServiceAccounts) GetResultsOk() (*[]GroupServiceAccount, bool)` + +GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResults + +`func (o *PaginatedGroupServiceAccounts) SetResults(v []GroupServiceAccount)` + +SetResults sets Results field to given value. + +### HasResults + +`func (o *PaginatedGroupServiceAccounts) HasResults() bool` + +HasResults returns a boolean if a field has been set. +### GetTotalCount + +`func (o *PaginatedGroupServiceAccounts) GetTotalCount() int` + +GetTotalCount returns the TotalCount field if non-nil, zero value otherwise. + +### GetTotalCountOk + +`func (o *PaginatedGroupServiceAccounts) GetTotalCountOk() (*int, bool)` + +GetTotalCountOk returns a tuple with the TotalCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalCount + +`func (o *PaginatedGroupServiceAccounts) SetTotalCount(v int)` + +SetTotalCount sets TotalCount field to given value. + +### HasTotalCount + +`func (o *PaginatedGroupServiceAccounts) HasTotalCount() bool` + +HasTotalCount returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/PaginatedOrgServiceAccounts.md b/docs/docs/PaginatedOrgServiceAccounts.md new file mode 100644 index 000000000..18936f1d3 --- /dev/null +++ b/docs/docs/PaginatedOrgServiceAccounts.md @@ -0,0 +1,105 @@ +# PaginatedOrgServiceAccounts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Links** | Pointer to [**[]Link**](Link.md) | List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. | [optional] [readonly] +**Results** | Pointer to [**[]OrgServiceAccount**](OrgServiceAccount.md) | List of returned documents that MongoDB Cloud provides when completing this request. | [optional] [readonly] +**TotalCount** | Pointer to **int** | Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. | [optional] [readonly] + +## Methods + +### NewPaginatedOrgServiceAccounts + +`func NewPaginatedOrgServiceAccounts() *PaginatedOrgServiceAccounts` + +NewPaginatedOrgServiceAccounts instantiates a new PaginatedOrgServiceAccounts object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaginatedOrgServiceAccountsWithDefaults + +`func NewPaginatedOrgServiceAccountsWithDefaults() *PaginatedOrgServiceAccounts` + +NewPaginatedOrgServiceAccountsWithDefaults instantiates a new PaginatedOrgServiceAccounts object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLinks + +`func (o *PaginatedOrgServiceAccounts) GetLinks() []Link` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *PaginatedOrgServiceAccounts) GetLinksOk() (*[]Link, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *PaginatedOrgServiceAccounts) SetLinks(v []Link)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *PaginatedOrgServiceAccounts) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. +### GetResults + +`func (o *PaginatedOrgServiceAccounts) GetResults() []OrgServiceAccount` + +GetResults returns the Results field if non-nil, zero value otherwise. + +### GetResultsOk + +`func (o *PaginatedOrgServiceAccounts) GetResultsOk() (*[]OrgServiceAccount, bool)` + +GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResults + +`func (o *PaginatedOrgServiceAccounts) SetResults(v []OrgServiceAccount)` + +SetResults sets Results field to given value. + +### HasResults + +`func (o *PaginatedOrgServiceAccounts) HasResults() bool` + +HasResults returns a boolean if a field has been set. +### GetTotalCount + +`func (o *PaginatedOrgServiceAccounts) GetTotalCount() int` + +GetTotalCount returns the TotalCount field if non-nil, zero value otherwise. + +### GetTotalCountOk + +`func (o *PaginatedOrgServiceAccounts) GetTotalCountOk() (*int, bool)` + +GetTotalCountOk returns a tuple with the TotalCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalCount + +`func (o *PaginatedOrgServiceAccounts) SetTotalCount(v int)` + +SetTotalCount sets TotalCount field to given value. + +### HasTotalCount + +`func (o *PaginatedOrgServiceAccounts) HasTotalCount() bool` + +HasTotalCount returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/PaginatedServiceAccountGroup.md b/docs/docs/PaginatedServiceAccountGroup.md new file mode 100644 index 000000000..3cf0f95bb --- /dev/null +++ b/docs/docs/PaginatedServiceAccountGroup.md @@ -0,0 +1,105 @@ +# PaginatedServiceAccountGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Links** | Pointer to [**[]Link**](Link.md) | List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. | [optional] [readonly] +**Results** | Pointer to [**[]ServiceAccountGroup**](ServiceAccountGroup.md) | List of returned documents that MongoDB Cloud provides when completing this request. | [optional] [readonly] +**TotalCount** | Pointer to **int** | Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. | [optional] [readonly] + +## Methods + +### NewPaginatedServiceAccountGroup + +`func NewPaginatedServiceAccountGroup() *PaginatedServiceAccountGroup` + +NewPaginatedServiceAccountGroup instantiates a new PaginatedServiceAccountGroup object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaginatedServiceAccountGroupWithDefaults + +`func NewPaginatedServiceAccountGroupWithDefaults() *PaginatedServiceAccountGroup` + +NewPaginatedServiceAccountGroupWithDefaults instantiates a new PaginatedServiceAccountGroup object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLinks + +`func (o *PaginatedServiceAccountGroup) GetLinks() []Link` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *PaginatedServiceAccountGroup) GetLinksOk() (*[]Link, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *PaginatedServiceAccountGroup) SetLinks(v []Link)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *PaginatedServiceAccountGroup) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. +### GetResults + +`func (o *PaginatedServiceAccountGroup) GetResults() []ServiceAccountGroup` + +GetResults returns the Results field if non-nil, zero value otherwise. + +### GetResultsOk + +`func (o *PaginatedServiceAccountGroup) GetResultsOk() (*[]ServiceAccountGroup, bool)` + +GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResults + +`func (o *PaginatedServiceAccountGroup) SetResults(v []ServiceAccountGroup)` + +SetResults sets Results field to given value. + +### HasResults + +`func (o *PaginatedServiceAccountGroup) HasResults() bool` + +HasResults returns a boolean if a field has been set. +### GetTotalCount + +`func (o *PaginatedServiceAccountGroup) GetTotalCount() int` + +GetTotalCount returns the TotalCount field if non-nil, zero value otherwise. + +### GetTotalCountOk + +`func (o *PaginatedServiceAccountGroup) GetTotalCountOk() (*int, bool)` + +GetTotalCountOk returns a tuple with the TotalCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalCount + +`func (o *PaginatedServiceAccountGroup) SetTotalCount(v int)` + +SetTotalCount sets TotalCount field to given value. + +### HasTotalCount + +`func (o *PaginatedServiceAccountGroup) HasTotalCount() bool` + +HasTotalCount returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/PaginatedServiceAccountIPAccessEntry.md b/docs/docs/PaginatedServiceAccountIPAccessEntry.md new file mode 100644 index 000000000..11eaf2387 --- /dev/null +++ b/docs/docs/PaginatedServiceAccountIPAccessEntry.md @@ -0,0 +1,105 @@ +# PaginatedServiceAccountIPAccessEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Links** | Pointer to [**[]Link**](Link.md) | List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. | [optional] [readonly] +**Results** | Pointer to [**[]ServiceAccountIPAccessListEntry**](ServiceAccountIPAccessListEntry.md) | List of returned documents that MongoDB Cloud provides when completing this request. | [optional] [readonly] +**TotalCount** | Pointer to **int** | Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. | [optional] [readonly] + +## Methods + +### NewPaginatedServiceAccountIPAccessEntry + +`func NewPaginatedServiceAccountIPAccessEntry() *PaginatedServiceAccountIPAccessEntry` + +NewPaginatedServiceAccountIPAccessEntry instantiates a new PaginatedServiceAccountIPAccessEntry object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaginatedServiceAccountIPAccessEntryWithDefaults + +`func NewPaginatedServiceAccountIPAccessEntryWithDefaults() *PaginatedServiceAccountIPAccessEntry` + +NewPaginatedServiceAccountIPAccessEntryWithDefaults instantiates a new PaginatedServiceAccountIPAccessEntry object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLinks + +`func (o *PaginatedServiceAccountIPAccessEntry) GetLinks() []Link` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *PaginatedServiceAccountIPAccessEntry) GetLinksOk() (*[]Link, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *PaginatedServiceAccountIPAccessEntry) SetLinks(v []Link)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *PaginatedServiceAccountIPAccessEntry) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. +### GetResults + +`func (o *PaginatedServiceAccountIPAccessEntry) GetResults() []ServiceAccountIPAccessListEntry` + +GetResults returns the Results field if non-nil, zero value otherwise. + +### GetResultsOk + +`func (o *PaginatedServiceAccountIPAccessEntry) GetResultsOk() (*[]ServiceAccountIPAccessListEntry, bool)` + +GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResults + +`func (o *PaginatedServiceAccountIPAccessEntry) SetResults(v []ServiceAccountIPAccessListEntry)` + +SetResults sets Results field to given value. + +### HasResults + +`func (o *PaginatedServiceAccountIPAccessEntry) HasResults() bool` + +HasResults returns a boolean if a field has been set. +### GetTotalCount + +`func (o *PaginatedServiceAccountIPAccessEntry) GetTotalCount() int` + +GetTotalCount returns the TotalCount field if non-nil, zero value otherwise. + +### GetTotalCountOk + +`func (o *PaginatedServiceAccountIPAccessEntry) GetTotalCountOk() (*int, bool)` + +GetTotalCountOk returns a tuple with the TotalCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalCount + +`func (o *PaginatedServiceAccountIPAccessEntry) SetTotalCount(v int)` + +SetTotalCount sets TotalCount field to given value. + +### HasTotalCount + +`func (o *PaginatedServiceAccountIPAccessEntry) HasTotalCount() bool` + +HasTotalCount returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/ServiceAccountGroup.md b/docs/docs/ServiceAccountGroup.md new file mode 100644 index 000000000..2683c81d0 --- /dev/null +++ b/docs/docs/ServiceAccountGroup.md @@ -0,0 +1,55 @@ +# ServiceAccountGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GroupId** | Pointer to **string** | Unique 24-hexadecimal digit string that identifies your project. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | [optional] [readonly] + +## Methods + +### NewServiceAccountGroup + +`func NewServiceAccountGroup() *ServiceAccountGroup` + +NewServiceAccountGroup instantiates a new ServiceAccountGroup object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewServiceAccountGroupWithDefaults + +`func NewServiceAccountGroupWithDefaults() *ServiceAccountGroup` + +NewServiceAccountGroupWithDefaults instantiates a new ServiceAccountGroup object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGroupId + +`func (o *ServiceAccountGroup) GetGroupId() string` + +GetGroupId returns the GroupId field if non-nil, zero value otherwise. + +### GetGroupIdOk + +`func (o *ServiceAccountGroup) GetGroupIdOk() (*string, bool)` + +GetGroupIdOk returns a tuple with the GroupId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroupId + +`func (o *ServiceAccountGroup) SetGroupId(v string)` + +SetGroupId sets GroupId field to given value. + +### HasGroupId + +`func (o *ServiceAccountGroup) HasGroupId() bool` + +HasGroupId returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/ServiceAccountIPAccessListEntry.md b/docs/docs/ServiceAccountIPAccessListEntry.md new file mode 100644 index 000000000..7dd52ab42 --- /dev/null +++ b/docs/docs/ServiceAccountIPAccessListEntry.md @@ -0,0 +1,180 @@ +# ServiceAccountIPAccessListEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CidrBlock** | Pointer to **string** | Range of network addresses in the access list for the Service Account. This parameter requires the range to be expressed in Classless Inter-Domain Routing (CIDR) notation of Internet Protocol version 4 or version 6 addresses. You can set a value for this parameter or **ipAddress**, but not for both in the same request. | [optional] +**CreatedAt** | Pointer to **time.Time** | Date MongoDB Cloud added the entry was added to the Access List. | [optional] [readonly] +**IpAddress** | Pointer to **string** | Network address in the access list for the Service Account. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. You can set a value for this parameter or **cidrBlock**, but not for both in the same request. | [optional] +**LastUsedAddress** | Pointer to **string** | Network address that issued the most recent request to the API. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. The resource returns this parameter after this IP address makes at least one request. | [optional] [readonly] +**LastUsedAt** | Pointer to **time.Time** | Date when MongoDB Cloud received the most recent request that originated from this Internet Protocol version 4 or version 6 address. The resource returns this parameter when at least one request originates from this IP address. MongoDB Cloud updates this parameter each time a client accesses the permitted resource, with a delay of up to 5 minutes. | [optional] [readonly] +**RequestCount** | Pointer to **int** | The number of requests that has originated from this network address. | [optional] [readonly] + +## Methods + +### NewServiceAccountIPAccessListEntry + +`func NewServiceAccountIPAccessListEntry() *ServiceAccountIPAccessListEntry` + +NewServiceAccountIPAccessListEntry instantiates a new ServiceAccountIPAccessListEntry object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewServiceAccountIPAccessListEntryWithDefaults + +`func NewServiceAccountIPAccessListEntryWithDefaults() *ServiceAccountIPAccessListEntry` + +NewServiceAccountIPAccessListEntryWithDefaults instantiates a new ServiceAccountIPAccessListEntry object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCidrBlock + +`func (o *ServiceAccountIPAccessListEntry) GetCidrBlock() string` + +GetCidrBlock returns the CidrBlock field if non-nil, zero value otherwise. + +### GetCidrBlockOk + +`func (o *ServiceAccountIPAccessListEntry) GetCidrBlockOk() (*string, bool)` + +GetCidrBlockOk returns a tuple with the CidrBlock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidrBlock + +`func (o *ServiceAccountIPAccessListEntry) SetCidrBlock(v string)` + +SetCidrBlock sets CidrBlock field to given value. + +### HasCidrBlock + +`func (o *ServiceAccountIPAccessListEntry) HasCidrBlock() bool` + +HasCidrBlock returns a boolean if a field has been set. +### GetCreatedAt + +`func (o *ServiceAccountIPAccessListEntry) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ServiceAccountIPAccessListEntry) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ServiceAccountIPAccessListEntry) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *ServiceAccountIPAccessListEntry) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. +### GetIpAddress + +`func (o *ServiceAccountIPAccessListEntry) GetIpAddress() string` + +GetIpAddress returns the IpAddress field if non-nil, zero value otherwise. + +### GetIpAddressOk + +`func (o *ServiceAccountIPAccessListEntry) GetIpAddressOk() (*string, bool)` + +GetIpAddressOk returns a tuple with the IpAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddress + +`func (o *ServiceAccountIPAccessListEntry) SetIpAddress(v string)` + +SetIpAddress sets IpAddress field to given value. + +### HasIpAddress + +`func (o *ServiceAccountIPAccessListEntry) HasIpAddress() bool` + +HasIpAddress returns a boolean if a field has been set. +### GetLastUsedAddress + +`func (o *ServiceAccountIPAccessListEntry) GetLastUsedAddress() string` + +GetLastUsedAddress returns the LastUsedAddress field if non-nil, zero value otherwise. + +### GetLastUsedAddressOk + +`func (o *ServiceAccountIPAccessListEntry) GetLastUsedAddressOk() (*string, bool)` + +GetLastUsedAddressOk returns a tuple with the LastUsedAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUsedAddress + +`func (o *ServiceAccountIPAccessListEntry) SetLastUsedAddress(v string)` + +SetLastUsedAddress sets LastUsedAddress field to given value. + +### HasLastUsedAddress + +`func (o *ServiceAccountIPAccessListEntry) HasLastUsedAddress() bool` + +HasLastUsedAddress returns a boolean if a field has been set. +### GetLastUsedAt + +`func (o *ServiceAccountIPAccessListEntry) GetLastUsedAt() time.Time` + +GetLastUsedAt returns the LastUsedAt field if non-nil, zero value otherwise. + +### GetLastUsedAtOk + +`func (o *ServiceAccountIPAccessListEntry) GetLastUsedAtOk() (*time.Time, bool)` + +GetLastUsedAtOk returns a tuple with the LastUsedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUsedAt + +`func (o *ServiceAccountIPAccessListEntry) SetLastUsedAt(v time.Time)` + +SetLastUsedAt sets LastUsedAt field to given value. + +### HasLastUsedAt + +`func (o *ServiceAccountIPAccessListEntry) HasLastUsedAt() bool` + +HasLastUsedAt returns a boolean if a field has been set. +### GetRequestCount + +`func (o *ServiceAccountIPAccessListEntry) GetRequestCount() int` + +GetRequestCount returns the RequestCount field if non-nil, zero value otherwise. + +### GetRequestCountOk + +`func (o *ServiceAccountIPAccessListEntry) GetRequestCountOk() (*int, bool)` + +GetRequestCountOk returns a tuple with the RequestCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestCount + +`func (o *ServiceAccountIPAccessListEntry) SetRequestCount(v int)` + +SetRequestCount sets RequestCount field to given value. + +### HasRequestCount + +`func (o *ServiceAccountIPAccessListEntry) HasRequestCount() bool` + +HasRequestCount returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/ServiceAccountSecret.md b/docs/docs/ServiceAccountSecret.md new file mode 100644 index 000000000..cd4ee5bab --- /dev/null +++ b/docs/docs/ServiceAccountSecret.md @@ -0,0 +1,165 @@ +# ServiceAccountSecret + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **time.Time** | The date that the secret was created on. | [readonly] +**ExpiresAt** | **time.Time** | The date for the expiration of the secret. | [readonly] +**Id** | **string** | Unique 24-hexadecimal digit string that identifies the secret. | [readonly] +**LastUsedAt** | Pointer to **time.Time** | The last time the secret was used. | [optional] [readonly] +**MaskedSecretValue** | Pointer to **string** | The masked Service Account secret. | [optional] [readonly] +**Secret** | Pointer to **string** | The secret for the Service Account. It will be returned only the first time after creation. | [optional] [readonly] + +## Methods + +### NewServiceAccountSecret + +`func NewServiceAccountSecret(createdAt time.Time, expiresAt time.Time, id string, ) *ServiceAccountSecret` + +NewServiceAccountSecret instantiates a new ServiceAccountSecret object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewServiceAccountSecretWithDefaults + +`func NewServiceAccountSecretWithDefaults() *ServiceAccountSecret` + +NewServiceAccountSecretWithDefaults instantiates a new ServiceAccountSecret object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *ServiceAccountSecret) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ServiceAccountSecret) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ServiceAccountSecret) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### GetExpiresAt + +`func (o *ServiceAccountSecret) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *ServiceAccountSecret) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *ServiceAccountSecret) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### GetId + +`func (o *ServiceAccountSecret) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ServiceAccountSecret) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ServiceAccountSecret) SetId(v string)` + +SetId sets Id field to given value. + +### GetLastUsedAt + +`func (o *ServiceAccountSecret) GetLastUsedAt() time.Time` + +GetLastUsedAt returns the LastUsedAt field if non-nil, zero value otherwise. + +### GetLastUsedAtOk + +`func (o *ServiceAccountSecret) GetLastUsedAtOk() (*time.Time, bool)` + +GetLastUsedAtOk returns a tuple with the LastUsedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUsedAt + +`func (o *ServiceAccountSecret) SetLastUsedAt(v time.Time)` + +SetLastUsedAt sets LastUsedAt field to given value. + +### HasLastUsedAt + +`func (o *ServiceAccountSecret) HasLastUsedAt() bool` + +HasLastUsedAt returns a boolean if a field has been set. +### GetMaskedSecretValue + +`func (o *ServiceAccountSecret) GetMaskedSecretValue() string` + +GetMaskedSecretValue returns the MaskedSecretValue field if non-nil, zero value otherwise. + +### GetMaskedSecretValueOk + +`func (o *ServiceAccountSecret) GetMaskedSecretValueOk() (*string, bool)` + +GetMaskedSecretValueOk returns a tuple with the MaskedSecretValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaskedSecretValue + +`func (o *ServiceAccountSecret) SetMaskedSecretValue(v string)` + +SetMaskedSecretValue sets MaskedSecretValue field to given value. + +### HasMaskedSecretValue + +`func (o *ServiceAccountSecret) HasMaskedSecretValue() bool` + +HasMaskedSecretValue returns a boolean if a field has been set. +### GetSecret + +`func (o *ServiceAccountSecret) GetSecret() string` + +GetSecret returns the Secret field if non-nil, zero value otherwise. + +### GetSecretOk + +`func (o *ServiceAccountSecret) GetSecretOk() (*string, bool)` + +GetSecretOk returns a tuple with the Secret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecret + +`func (o *ServiceAccountSecret) SetSecret(v string)` + +SetSecret sets Secret field to given value. + +### HasSecret + +`func (o *ServiceAccountSecret) HasSecret() bool` + +HasSecret returns a boolean if a field has been set. + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/ServiceAccountSecretRequest.md b/docs/docs/ServiceAccountSecretRequest.md new file mode 100644 index 000000000..14b6692cc --- /dev/null +++ b/docs/docs/ServiceAccountSecretRequest.md @@ -0,0 +1,50 @@ +# ServiceAccountSecretRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SecretExpiresAfterHours** | **int** | The expiration time of the new Service Account secret. The expiration is provided in hours. | + +## Methods + +### NewServiceAccountSecretRequest + +`func NewServiceAccountSecretRequest(secretExpiresAfterHours int, ) *ServiceAccountSecretRequest` + +NewServiceAccountSecretRequest instantiates a new ServiceAccountSecretRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewServiceAccountSecretRequestWithDefaults + +`func NewServiceAccountSecretRequestWithDefaults() *ServiceAccountSecretRequest` + +NewServiceAccountSecretRequestWithDefaults instantiates a new ServiceAccountSecretRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSecretExpiresAfterHours + +`func (o *ServiceAccountSecretRequest) GetSecretExpiresAfterHours() int` + +GetSecretExpiresAfterHours returns the SecretExpiresAfterHours field if non-nil, zero value otherwise. + +### GetSecretExpiresAfterHoursOk + +`func (o *ServiceAccountSecretRequest) GetSecretExpiresAfterHoursOk() (*int, bool)` + +GetSecretExpiresAfterHoursOk returns a tuple with the SecretExpiresAfterHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecretExpiresAfterHours + +`func (o *ServiceAccountSecretRequest) SetSecretExpiresAfterHours(v int)` + +SetSecretExpiresAfterHours sets SecretExpiresAfterHours field to given value. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/docs/ServiceAccountsApi.md b/docs/docs/ServiceAccountsApi.md new file mode 100644 index 000000000..d2098096a --- /dev/null +++ b/docs/docs/ServiceAccountsApi.md @@ -0,0 +1,1900 @@ +# \ServiceAccountsApi + +All URIs are relative to *https://cloud.mongodb.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddProjectServiceAccount**](ServiceAccountsApi.md#AddProjectServiceAccount) | **Post** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite | Assign One Service Account to One Project +[**CreateProjectServiceAccount**](ServiceAccountsApi.md#CreateProjectServiceAccount) | **Post** /api/atlas/v2/groups/{groupId}/serviceAccounts | Create and Assign one Service Account to one Project +[**CreateProjectServiceAccountAccessList**](ServiceAccountsApi.md#CreateProjectServiceAccountAccessList) | **Post** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList | Add Access List entries for one Project Service Account +[**CreateProjectServiceAccountSecret**](ServiceAccountsApi.md#CreateProjectServiceAccountSecret) | **Post** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets | Create one Project Service Account Secret +[**CreateServiceAccount**](ServiceAccountsApi.md#CreateServiceAccount) | **Post** /api/atlas/v2/orgs/{orgId}/serviceAccounts | Create one Organization Service Account +[**CreateServiceAccountAccessList**](ServiceAccountsApi.md#CreateServiceAccountAccessList) | **Post** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList | Add Access List entries for one Organization Service Account +[**CreateServiceAccountSecret**](ServiceAccountsApi.md#CreateServiceAccountSecret) | **Post** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets | Create one Organization Service Account Secret +[**DeleteProjectServiceAccount**](ServiceAccountsApi.md#DeleteProjectServiceAccount) | **Delete** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId} | Unassign One Service Account from One Project +[**DeleteProjectServiceAccountAccessListEntry**](ServiceAccountsApi.md#DeleteProjectServiceAccountAccessListEntry) | **Delete** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress} | Remove One Access List entry from one Project Service Account +[**DeleteProjectServiceAccountSecret**](ServiceAccountsApi.md#DeleteProjectServiceAccountSecret) | **Delete** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId} | Delete one Project Service Account Secret +[**DeleteServiceAccount**](ServiceAccountsApi.md#DeleteServiceAccount) | **Delete** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId} | Delete one Organization Service Account +[**DeleteServiceAccountAccessListEntry**](ServiceAccountsApi.md#DeleteServiceAccountAccessListEntry) | **Delete** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress} | Remove One Access List entry from one Organization Service Account +[**DeleteServiceAccountSecret**](ServiceAccountsApi.md#DeleteServiceAccountSecret) | **Delete** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId} | Delete a Organization Service Account Secret +[**GetProjectServiceAccount**](ServiceAccountsApi.md#GetProjectServiceAccount) | **Get** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId} | Get one Project Service Account +[**GetServiceAccount**](ServiceAccountsApi.md#GetServiceAccount) | **Get** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId} | Get one Organization Service Account +[**ListProjectServiceAccountAccessList**](ServiceAccountsApi.md#ListProjectServiceAccountAccessList) | **Get** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList | Return All Access List entries for one Project Service Account +[**ListProjectServiceAccounts**](ServiceAccountsApi.md#ListProjectServiceAccounts) | **Get** /api/atlas/v2/groups/{groupId}/serviceAccounts | List All Project Service Accounts +[**ListServiceAccountAccessList**](ServiceAccountsApi.md#ListServiceAccountAccessList) | **Get** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList | Return All Access List entries for one Organization Service Account +[**ListServiceAccountProjects**](ServiceAccountsApi.md#ListServiceAccountProjects) | **Get** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups | Return All Service Account Project assignments +[**ListServiceAccounts**](ServiceAccountsApi.md#ListServiceAccounts) | **Get** /api/atlas/v2/orgs/{orgId}/serviceAccounts | List All Organization Service Accounts +[**UpdateProjectServiceAccount**](ServiceAccountsApi.md#UpdateProjectServiceAccount) | **Patch** /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId} | Update one Project Service Account +[**UpdateServiceAccount**](ServiceAccountsApi.md#UpdateServiceAccount) | **Patch** /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId} | Update one Organization Service Account + + + +## AddProjectServiceAccount + +> GroupServiceAccount AddProjectServiceAccount(ctx, clientId, groupId, groupServiceAccountRoleAssignment []GroupServiceAccountRoleAssignment).Execute() + +Assign One Service Account to One Project + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + groupId := "32b6e34b3d91647abb20e7b8" // string | + groupServiceAccountRoleAssignment := []openapiclient.GroupServiceAccountRoleAssignment{*openapiclient.NewGroupServiceAccountRoleAssignment([]string{"Roles_example"})} // []GroupServiceAccountRoleAssignment | + + resp, r, err := sdk.ServiceAccountsApi.AddProjectServiceAccount(context.Background(), clientId, groupId, &groupServiceAccountRoleAssignment).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.AddProjectServiceAccount`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `AddProjectServiceAccount`: GroupServiceAccount + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.AddProjectServiceAccount`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The Client ID of the Service Account. | +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAddProjectServiceAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **groupServiceAccountRoleAssignment** | [**[]GroupServiceAccountRoleAssignment**](GroupServiceAccountRoleAssignment.md) | The Project permissions for the Service Account in the specified Project. | + +### Return type + +[**GroupServiceAccount**](GroupServiceAccount.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.atlas.2024-08-05+json +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateProjectServiceAccount + +> GroupServiceAccount CreateProjectServiceAccount(ctx, groupId, groupServiceAccountRequest GroupServiceAccountRequest).Execute() + +Create and Assign one Service Account to one Project + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + groupId := "32b6e34b3d91647abb20e7b8" // string | + groupServiceAccountRequest := *openapiclient.NewGroupServiceAccountRequest("Description_example", "Name_example", []string{"Roles_example"}, int(123)) // GroupServiceAccountRequest | + + resp, r, err := sdk.ServiceAccountsApi.CreateProjectServiceAccount(context.Background(), groupId, &groupServiceAccountRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.CreateProjectServiceAccount`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `CreateProjectServiceAccount`: GroupServiceAccount + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.CreateProjectServiceAccount`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateProjectServiceAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **groupServiceAccountRequest** | [**GroupServiceAccountRequest**](GroupServiceAccountRequest.md) | Details of the new Service Account. | + +### Return type + +[**GroupServiceAccount**](GroupServiceAccount.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.atlas.2024-08-05+json +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateProjectServiceAccountAccessList + +> PaginatedServiceAccountIPAccessEntry CreateProjectServiceAccountAccessList(ctx, groupId, clientId, serviceAccountIPAccessListEntry []ServiceAccountIPAccessListEntry).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + +Add Access List entries for one Project Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + groupId := "32b6e34b3d91647abb20e7b8" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + serviceAccountIPAccessListEntry := []openapiclient.ServiceAccountIPAccessListEntry{*openapiclient.NewServiceAccountIPAccessListEntry()} // []ServiceAccountIPAccessListEntry | + includeCount := true // bool | (optional) (default to true) + itemsPerPage := int(100) // int | (optional) (default to 100) + pageNum := int(1) // int | (optional) (default to 1) + + resp, r, err := sdk.ServiceAccountsApi.CreateProjectServiceAccountAccessList(context.Background(), groupId, clientId, &serviceAccountIPAccessListEntry).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.CreateProjectServiceAccountAccessList`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `CreateProjectServiceAccountAccessList`: PaginatedServiceAccountIPAccessEntry + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.CreateProjectServiceAccountAccessList`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | +**clientId** | **string** | The Client ID of the Service Account. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateProjectServiceAccountAccessListRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **serviceAccountIPAccessListEntry** | [**[]ServiceAccountIPAccessListEntry**](ServiceAccountIPAccessListEntry.md) | A list of access list entries to add to the access list of the specified Service Account for the project. | + **includeCount** | **bool** | Flag that indicates whether the response returns the total number of items (**totalCount**) in the response. | [default to true] + **itemsPerPage** | **int** | Number of items that the response returns per page. | [default to 100] + **pageNum** | **int** | Number of the page that displays the current set of the total objects that the response returns. | [default to 1] + +### Return type + +[**PaginatedServiceAccountIPAccessEntry**](PaginatedServiceAccountIPAccessEntry.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.atlas.2024-08-05+json +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateProjectServiceAccountSecret + +> ServiceAccountSecret CreateProjectServiceAccountSecret(ctx, groupId, clientId, serviceAccountSecretRequest ServiceAccountSecretRequest).Execute() + +Create one Project Service Account Secret + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + groupId := "32b6e34b3d91647abb20e7b8" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + serviceAccountSecretRequest := *openapiclient.NewServiceAccountSecretRequest(int(123)) // ServiceAccountSecretRequest | + + resp, r, err := sdk.ServiceAccountsApi.CreateProjectServiceAccountSecret(context.Background(), groupId, clientId, &serviceAccountSecretRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.CreateProjectServiceAccountSecret`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `CreateProjectServiceAccountSecret`: ServiceAccountSecret + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.CreateProjectServiceAccountSecret`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | +**clientId** | **string** | The Client ID of the Service Account. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateProjectServiceAccountSecretRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **serviceAccountSecretRequest** | [**ServiceAccountSecretRequest**](ServiceAccountSecretRequest.md) | Details for the new secret. | + +### Return type + +[**ServiceAccountSecret**](ServiceAccountSecret.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.atlas.2024-08-05+json +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateServiceAccount + +> OrgServiceAccount CreateServiceAccount(ctx, orgId, orgServiceAccountRequest OrgServiceAccountRequest).Execute() + +Create one Organization Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + orgId := "4888442a3354817a7320eb61" // string | + orgServiceAccountRequest := *openapiclient.NewOrgServiceAccountRequest("Description_example", "Name_example", []string{"Roles_example"}, int(123)) // OrgServiceAccountRequest | + + resp, r, err := sdk.ServiceAccountsApi.CreateServiceAccount(context.Background(), orgId, &orgServiceAccountRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.CreateServiceAccount`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `CreateServiceAccount`: OrgServiceAccount + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.CreateServiceAccount`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateServiceAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **orgServiceAccountRequest** | [**OrgServiceAccountRequest**](OrgServiceAccountRequest.md) | Details of the new Service Account. | + +### Return type + +[**OrgServiceAccount**](OrgServiceAccount.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.atlas.2024-08-05+json +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateServiceAccountAccessList + +> PaginatedServiceAccountIPAccessEntry CreateServiceAccountAccessList(ctx, orgId, clientId, serviceAccountIPAccessListEntry []ServiceAccountIPAccessListEntry).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + +Add Access List entries for one Organization Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + orgId := "4888442a3354817a7320eb61" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + serviceAccountIPAccessListEntry := []openapiclient.ServiceAccountIPAccessListEntry{*openapiclient.NewServiceAccountIPAccessListEntry()} // []ServiceAccountIPAccessListEntry | + includeCount := true // bool | (optional) (default to true) + itemsPerPage := int(100) // int | (optional) (default to 100) + pageNum := int(1) // int | (optional) (default to 1) + + resp, r, err := sdk.ServiceAccountsApi.CreateServiceAccountAccessList(context.Background(), orgId, clientId, &serviceAccountIPAccessListEntry).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.CreateServiceAccountAccessList`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `CreateServiceAccountAccessList`: PaginatedServiceAccountIPAccessEntry + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.CreateServiceAccountAccessList`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | +**clientId** | **string** | The Client ID of the Service Account. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateServiceAccountAccessListRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **serviceAccountIPAccessListEntry** | [**[]ServiceAccountIPAccessListEntry**](ServiceAccountIPAccessListEntry.md) | A list of access list entries to add to the access list of the specified Service Account for the organization. | + **includeCount** | **bool** | Flag that indicates whether the response returns the total number of items (**totalCount**) in the response. | [default to true] + **itemsPerPage** | **int** | Number of items that the response returns per page. | [default to 100] + **pageNum** | **int** | Number of the page that displays the current set of the total objects that the response returns. | [default to 1] + +### Return type + +[**PaginatedServiceAccountIPAccessEntry**](PaginatedServiceAccountIPAccessEntry.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.atlas.2024-08-05+json +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateServiceAccountSecret + +> ServiceAccountSecret CreateServiceAccountSecret(ctx, orgId, clientId, serviceAccountSecretRequest ServiceAccountSecretRequest).Execute() + +Create one Organization Service Account Secret + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + orgId := "4888442a3354817a7320eb61" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + serviceAccountSecretRequest := *openapiclient.NewServiceAccountSecretRequest(int(123)) // ServiceAccountSecretRequest | + + resp, r, err := sdk.ServiceAccountsApi.CreateServiceAccountSecret(context.Background(), orgId, clientId, &serviceAccountSecretRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.CreateServiceAccountSecret`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `CreateServiceAccountSecret`: ServiceAccountSecret + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.CreateServiceAccountSecret`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | +**clientId** | **string** | The Client ID of the Service Account. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateServiceAccountSecretRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **serviceAccountSecretRequest** | [**ServiceAccountSecretRequest**](ServiceAccountSecretRequest.md) | Details for the new secret. | + +### Return type + +[**ServiceAccountSecret**](ServiceAccountSecret.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.atlas.2024-08-05+json +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteProjectServiceAccount + +> any DeleteProjectServiceAccount(ctx, clientId, groupId).Execute() + +Unassign One Service Account from One Project + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + groupId := "32b6e34b3d91647abb20e7b8" // string | + + resp, r, err := sdk.ServiceAccountsApi.DeleteProjectServiceAccount(context.Background(), clientId, groupId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.DeleteProjectServiceAccount`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `DeleteProjectServiceAccount`: any + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.DeleteProjectServiceAccount`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The Client ID of the Service Account. | +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteProjectServiceAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +**any** + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteProjectServiceAccountAccessListEntry + +> DeleteProjectServiceAccountAccessListEntry(ctx, groupId, clientId, ipAddress).Execute() + +Remove One Access List entry from one Project Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + groupId := "32b6e34b3d91647abb20e7b8" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + ipAddress := "192.0.2.0%2F24" // string | + + r, err := sdk.ServiceAccountsApi.DeleteProjectServiceAccountAccessListEntry(context.Background(), groupId, clientId, ipAddress).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.DeleteProjectServiceAccountAccessListEntry`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | +**clientId** | **string** | The Client ID of the Service Account. | +**ipAddress** | **string** | One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteProjectServiceAccountAccessListEntryRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + + (empty response body) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteProjectServiceAccountSecret + +> DeleteProjectServiceAccountSecret(ctx, clientId, secretId, groupId).Execute() + +Delete one Project Service Account Secret + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + secretId := "secretId_example" // string | + groupId := "32b6e34b3d91647abb20e7b8" // string | + + r, err := sdk.ServiceAccountsApi.DeleteProjectServiceAccountSecret(context.Background(), clientId, secretId, groupId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.DeleteProjectServiceAccountSecret`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The Client ID of the Service Account. | +**secretId** | **string** | Unique 24-hexadecimal digit string that identifies the secret. | +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteProjectServiceAccountSecretRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + + (empty response body) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteServiceAccount + +> DeleteServiceAccount(ctx, clientId, orgId).Execute() + +Delete one Organization Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + orgId := "4888442a3354817a7320eb61" // string | + + r, err := sdk.ServiceAccountsApi.DeleteServiceAccount(context.Background(), clientId, orgId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.DeleteServiceAccount`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The Client ID of the Service Account. | +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteServiceAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteServiceAccountAccessListEntry + +> DeleteServiceAccountAccessListEntry(ctx, orgId, clientId, ipAddress).Execute() + +Remove One Access List entry from one Organization Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + orgId := "4888442a3354817a7320eb61" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + ipAddress := "192.0.2.0%2F24" // string | + + r, err := sdk.ServiceAccountsApi.DeleteServiceAccountAccessListEntry(context.Background(), orgId, clientId, ipAddress).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.DeleteServiceAccountAccessListEntry`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | +**clientId** | **string** | The Client ID of the Service Account. | +**ipAddress** | **string** | One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteServiceAccountAccessListEntryRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + + (empty response body) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteServiceAccountSecret + +> DeleteServiceAccountSecret(ctx, clientId, secretId, orgId).Execute() + +Delete a Organization Service Account Secret + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + secretId := "secretId_example" // string | + orgId := "4888442a3354817a7320eb61" // string | + + r, err := sdk.ServiceAccountsApi.DeleteServiceAccountSecret(context.Background(), clientId, secretId, orgId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.DeleteServiceAccountSecret`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The Client ID of the Service Account. | +**secretId** | **string** | Unique 24-hexadecimal digit string that identifies the secret. | +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteServiceAccountSecretRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + + (empty response body) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetProjectServiceAccount + +> GroupServiceAccount GetProjectServiceAccount(ctx, groupId, clientId).Execute() + +Get one Project Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + groupId := "32b6e34b3d91647abb20e7b8" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + + resp, r, err := sdk.ServiceAccountsApi.GetProjectServiceAccount(context.Background(), groupId, clientId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.GetProjectServiceAccount`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `GetProjectServiceAccount`: GroupServiceAccount + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.GetProjectServiceAccount`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | +**clientId** | **string** | The Client ID of the Service Account. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetProjectServiceAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**GroupServiceAccount**](GroupServiceAccount.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetServiceAccount + +> OrgServiceAccount GetServiceAccount(ctx, orgId, clientId).Execute() + +Get one Organization Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + orgId := "4888442a3354817a7320eb61" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + + resp, r, err := sdk.ServiceAccountsApi.GetServiceAccount(context.Background(), orgId, clientId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.GetServiceAccount`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `GetServiceAccount`: OrgServiceAccount + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.GetServiceAccount`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | +**clientId** | **string** | The Client ID of the Service Account. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetServiceAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**OrgServiceAccount**](OrgServiceAccount.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListProjectServiceAccountAccessList + +> PaginatedServiceAccountIPAccessEntry ListProjectServiceAccountAccessList(ctx, groupId, clientId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + +Return All Access List entries for one Project Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + groupId := "32b6e34b3d91647abb20e7b8" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + includeCount := true // bool | (optional) (default to true) + itemsPerPage := int(100) // int | (optional) (default to 100) + pageNum := int(1) // int | (optional) (default to 1) + + resp, r, err := sdk.ServiceAccountsApi.ListProjectServiceAccountAccessList(context.Background(), groupId, clientId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.ListProjectServiceAccountAccessList`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `ListProjectServiceAccountAccessList`: PaginatedServiceAccountIPAccessEntry + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.ListProjectServiceAccountAccessList`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | +**clientId** | **string** | The Client ID of the Service Account. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListProjectServiceAccountAccessListRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **includeCount** | **bool** | Flag that indicates whether the response returns the total number of items (**totalCount**) in the response. | [default to true] + **itemsPerPage** | **int** | Number of items that the response returns per page. | [default to 100] + **pageNum** | **int** | Number of the page that displays the current set of the total objects that the response returns. | [default to 1] + +### Return type + +[**PaginatedServiceAccountIPAccessEntry**](PaginatedServiceAccountIPAccessEntry.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListProjectServiceAccounts + +> PaginatedGroupServiceAccounts ListProjectServiceAccounts(ctx, groupId).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + +List All Project Service Accounts + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + groupId := "32b6e34b3d91647abb20e7b8" // string | + itemsPerPage := int(100) // int | (optional) (default to 100) + pageNum := int(1) // int | (optional) (default to 1) + + resp, r, err := sdk.ServiceAccountsApi.ListProjectServiceAccounts(context.Background(), groupId).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.ListProjectServiceAccounts`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `ListProjectServiceAccounts`: PaginatedGroupServiceAccounts + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.ListProjectServiceAccounts`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListProjectServiceAccountsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **itemsPerPage** | **int** | Number of items that the response returns per page. | [default to 100] + **pageNum** | **int** | Number of the page that displays the current set of the total objects that the response returns. | [default to 1] + +### Return type + +[**PaginatedGroupServiceAccounts**](PaginatedGroupServiceAccounts.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListServiceAccountAccessList + +> PaginatedServiceAccountIPAccessEntry ListServiceAccountAccessList(ctx, orgId, clientId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + +Return All Access List entries for one Organization Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + orgId := "4888442a3354817a7320eb61" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + includeCount := true // bool | (optional) (default to true) + itemsPerPage := int(100) // int | (optional) (default to 100) + pageNum := int(1) // int | (optional) (default to 1) + + resp, r, err := sdk.ServiceAccountsApi.ListServiceAccountAccessList(context.Background(), orgId, clientId).IncludeCount(includeCount).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.ListServiceAccountAccessList`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `ListServiceAccountAccessList`: PaginatedServiceAccountIPAccessEntry + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.ListServiceAccountAccessList`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | +**clientId** | **string** | The Client ID of the Service Account. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListServiceAccountAccessListRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **includeCount** | **bool** | Flag that indicates whether the response returns the total number of items (**totalCount**) in the response. | [default to true] + **itemsPerPage** | **int** | Number of items that the response returns per page. | [default to 100] + **pageNum** | **int** | Number of the page that displays the current set of the total objects that the response returns. | [default to 1] + +### Return type + +[**PaginatedServiceAccountIPAccessEntry**](PaginatedServiceAccountIPAccessEntry.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListServiceAccountProjects + +> PaginatedServiceAccountGroup ListServiceAccountProjects(ctx, orgId, clientId).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + +Return All Service Account Project assignments + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + orgId := "4888442a3354817a7320eb61" // string | + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + itemsPerPage := int(100) // int | (optional) (default to 100) + pageNum := int(1) // int | (optional) (default to 1) + + resp, r, err := sdk.ServiceAccountsApi.ListServiceAccountProjects(context.Background(), orgId, clientId).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.ListServiceAccountProjects`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `ListServiceAccountProjects`: PaginatedServiceAccountGroup + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.ListServiceAccountProjects`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | +**clientId** | **string** | The Client ID of the Service Account. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListServiceAccountProjectsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **itemsPerPage** | **int** | Number of items that the response returns per page. | [default to 100] + **pageNum** | **int** | Number of the page that displays the current set of the total objects that the response returns. | [default to 1] + +### Return type + +[**PaginatedServiceAccountGroup**](PaginatedServiceAccountGroup.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListServiceAccounts + +> PaginatedOrgServiceAccounts ListServiceAccounts(ctx, orgId).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + +List All Organization Service Accounts + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + orgId := "4888442a3354817a7320eb61" // string | + itemsPerPage := int(100) // int | (optional) (default to 100) + pageNum := int(1) // int | (optional) (default to 1) + + resp, r, err := sdk.ServiceAccountsApi.ListServiceAccounts(context.Background(), orgId).ItemsPerPage(itemsPerPage).PageNum(pageNum).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.ListServiceAccounts`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `ListServiceAccounts`: PaginatedOrgServiceAccounts + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.ListServiceAccounts`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListServiceAccountsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **itemsPerPage** | **int** | Number of items that the response returns per page. | [default to 100] + **pageNum** | **int** | Number of the page that displays the current set of the total objects that the response returns. | [default to 1] + +### Return type + +[**PaginatedOrgServiceAccounts**](PaginatedOrgServiceAccounts.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateProjectServiceAccount + +> GroupServiceAccount UpdateProjectServiceAccount(ctx, clientId, groupId, groupServiceAccountUpdateRequest GroupServiceAccountUpdateRequest).Execute() + +Update one Project Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + groupId := "32b6e34b3d91647abb20e7b8" // string | + groupServiceAccountUpdateRequest := *openapiclient.NewGroupServiceAccountUpdateRequest() // GroupServiceAccountUpdateRequest | + + resp, r, err := sdk.ServiceAccountsApi.UpdateProjectServiceAccount(context.Background(), clientId, groupId, &groupServiceAccountUpdateRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.UpdateProjectServiceAccount`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `UpdateProjectServiceAccount`: GroupServiceAccount + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.UpdateProjectServiceAccount`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The Client ID of the Service Account. | +**groupId** | **string** | Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateProjectServiceAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **groupServiceAccountUpdateRequest** | [**GroupServiceAccountUpdateRequest**](GroupServiceAccountUpdateRequest.md) | The new details for the Service Account. | + +### Return type + +[**GroupServiceAccount**](GroupServiceAccount.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.atlas.2024-08-05+json +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateServiceAccount + +> OrgServiceAccount UpdateServiceAccount(ctx, clientId, orgId, orgServiceAccountUpdateRequest OrgServiceAccountUpdateRequest).Execute() + +Update one Organization Service Account + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + + "go.mongodb.org/atlas-sdk/v20241023001/admin" +) + +func main() { + apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") + apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") + + sdk, err := admin.NewClient(admin.UseDigestAuth(apiKey, apiSecret)) + if err != nil { + fmt.Fprintf(os.Stderr, "Error initializing SDK: %v\n", err) + return + } + + clientId := "mdb_sa_id_667066535bc75b03c37b3038" // string | + orgId := "4888442a3354817a7320eb61" // string | + orgServiceAccountUpdateRequest := *openapiclient.NewOrgServiceAccountUpdateRequest() // OrgServiceAccountUpdateRequest | + + resp, r, err := sdk.ServiceAccountsApi.UpdateServiceAccount(context.Background(), clientId, orgId, &orgServiceAccountUpdateRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ServiceAccountsApi.UpdateServiceAccount`: %v (%v)\n", err, r) + apiError, ok := admin.AsError(err) + if ok { + fmt.Fprintf(os.Stderr, "API error obj: %v\n", apiError) + } + return + } + // response from `UpdateServiceAccount`: OrgServiceAccount + fmt.Fprintf(os.Stdout, "Response from `ServiceAccountsApi.UpdateServiceAccount`: %v (%v)\n", resp, r) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | **string** | The Client ID of the Service Account. | +**orgId** | **string** | Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateServiceAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **orgServiceAccountUpdateRequest** | [**OrgServiceAccountUpdateRequest**](OrgServiceAccountUpdateRequest.md) | The new details for the Service Account. | + +### Return type + +[**OrgServiceAccount**](OrgServiceAccount.md) + +### Authorization +[DigestAuth](../README.md#Authentication) + +### HTTP request headers + +- **Content-Type**: application/vnd.atlas.2024-08-05+json +- **Accept**: application/vnd.atlas.2024-08-05+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/internal/core/version.go b/internal/core/version.go index 0455c9427..40e003b33 100644 --- a/internal/core/version.go +++ b/internal/core/version.go @@ -5,7 +5,7 @@ package core // For more information please see: https://github.com/mongodb/atlas-sdk-go/blob/main/docs/doc_1_concepts.md const ( // SDK release tag version. - Version = "v20241023001.0.0" + Version = "v20241023001.1.0" // Resource Version. Resource = "20241023" ) diff --git a/mockadmin/service_accounts_api.go b/mockadmin/service_accounts_api.go new file mode 100644 index 000000000..92a3691ca --- /dev/null +++ b/mockadmin/service_accounts_api.go @@ -0,0 +1,3568 @@ +// Code generated by mockery. DO NOT EDIT. + +package mockadmin + +import ( + context "context" + + admin "go.mongodb.org/atlas-sdk/v20241023001/admin" + + http "net/http" + + mock "github.com/stretchr/testify/mock" +) + +// ServiceAccountsApi is an autogenerated mock type for the ServiceAccountsApi type +type ServiceAccountsApi struct { + mock.Mock +} + +type ServiceAccountsApi_Expecter struct { + mock *mock.Mock +} + +func (_m *ServiceAccountsApi) EXPECT() *ServiceAccountsApi_Expecter { + return &ServiceAccountsApi_Expecter{mock: &_m.Mock} +} + +// AddProjectServiceAccount provides a mock function with given fields: ctx, clientId, groupId, groupServiceAccountRoleAssignment +func (_m *ServiceAccountsApi) AddProjectServiceAccount(ctx context.Context, clientId string, groupId string, groupServiceAccountRoleAssignment *[]admin.GroupServiceAccountRoleAssignment) admin.AddProjectServiceAccountApiRequest { + ret := _m.Called(ctx, clientId, groupId, groupServiceAccountRoleAssignment) + + if len(ret) == 0 { + panic("no return value specified for AddProjectServiceAccount") + } + + var r0 admin.AddProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *[]admin.GroupServiceAccountRoleAssignment) admin.AddProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, clientId, groupId, groupServiceAccountRoleAssignment) + } else { + r0 = ret.Get(0).(admin.AddProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_AddProjectServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddProjectServiceAccount' +type ServiceAccountsApi_AddProjectServiceAccount_Call struct { + *mock.Call +} + +// AddProjectServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - clientId string +// - groupId string +// - groupServiceAccountRoleAssignment *[]admin.GroupServiceAccountRoleAssignment +func (_e *ServiceAccountsApi_Expecter) AddProjectServiceAccount(ctx any, clientId any, groupId any, groupServiceAccountRoleAssignment any) *ServiceAccountsApi_AddProjectServiceAccount_Call { + return &ServiceAccountsApi_AddProjectServiceAccount_Call{Call: _e.mock.On("AddProjectServiceAccount", ctx, clientId, groupId, groupServiceAccountRoleAssignment)} +} + +func (_c *ServiceAccountsApi_AddProjectServiceAccount_Call) Run(run func(ctx context.Context, clientId string, groupId string, groupServiceAccountRoleAssignment *[]admin.GroupServiceAccountRoleAssignment)) *ServiceAccountsApi_AddProjectServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*[]admin.GroupServiceAccountRoleAssignment)) + }) + return _c +} + +func (_c *ServiceAccountsApi_AddProjectServiceAccount_Call) Return(_a0 admin.AddProjectServiceAccountApiRequest) *ServiceAccountsApi_AddProjectServiceAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_AddProjectServiceAccount_Call) RunAndReturn(run func(context.Context, string, string, *[]admin.GroupServiceAccountRoleAssignment) admin.AddProjectServiceAccountApiRequest) *ServiceAccountsApi_AddProjectServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// AddProjectServiceAccountExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) AddProjectServiceAccountExecute(r admin.AddProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for AddProjectServiceAccountExecute") + } + + var r0 *admin.GroupServiceAccount + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.AddProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.AddProjectServiceAccountApiRequest) *admin.GroupServiceAccount); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.GroupServiceAccount) + } + } + + if rf, ok := ret.Get(1).(func(admin.AddProjectServiceAccountApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.AddProjectServiceAccountApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_AddProjectServiceAccountExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddProjectServiceAccountExecute' +type ServiceAccountsApi_AddProjectServiceAccountExecute_Call struct { + *mock.Call +} + +// AddProjectServiceAccountExecute is a helper method to define mock.On call +// - r admin.AddProjectServiceAccountApiRequest +func (_e *ServiceAccountsApi_Expecter) AddProjectServiceAccountExecute(r any) *ServiceAccountsApi_AddProjectServiceAccountExecute_Call { + return &ServiceAccountsApi_AddProjectServiceAccountExecute_Call{Call: _e.mock.On("AddProjectServiceAccountExecute", r)} +} + +func (_c *ServiceAccountsApi_AddProjectServiceAccountExecute_Call) Run(run func(r admin.AddProjectServiceAccountApiRequest)) *ServiceAccountsApi_AddProjectServiceAccountExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.AddProjectServiceAccountApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_AddProjectServiceAccountExecute_Call) Return(_a0 *admin.GroupServiceAccount, _a1 *http.Response, _a2 error) *ServiceAccountsApi_AddProjectServiceAccountExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_AddProjectServiceAccountExecute_Call) RunAndReturn(run func(admin.AddProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error)) *ServiceAccountsApi_AddProjectServiceAccountExecute_Call { + _c.Call.Return(run) + return _c +} + +// AddProjectServiceAccountWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) AddProjectServiceAccountWithParams(ctx context.Context, args *admin.AddProjectServiceAccountApiParams) admin.AddProjectServiceAccountApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for AddProjectServiceAccountWithParams") + } + + var r0 admin.AddProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.AddProjectServiceAccountApiParams) admin.AddProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.AddProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_AddProjectServiceAccountWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddProjectServiceAccountWithParams' +type ServiceAccountsApi_AddProjectServiceAccountWithParams_Call struct { + *mock.Call +} + +// AddProjectServiceAccountWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.AddProjectServiceAccountApiParams +func (_e *ServiceAccountsApi_Expecter) AddProjectServiceAccountWithParams(ctx any, args any) *ServiceAccountsApi_AddProjectServiceAccountWithParams_Call { + return &ServiceAccountsApi_AddProjectServiceAccountWithParams_Call{Call: _e.mock.On("AddProjectServiceAccountWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_AddProjectServiceAccountWithParams_Call) Run(run func(ctx context.Context, args *admin.AddProjectServiceAccountApiParams)) *ServiceAccountsApi_AddProjectServiceAccountWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.AddProjectServiceAccountApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_AddProjectServiceAccountWithParams_Call) Return(_a0 admin.AddProjectServiceAccountApiRequest) *ServiceAccountsApi_AddProjectServiceAccountWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_AddProjectServiceAccountWithParams_Call) RunAndReturn(run func(context.Context, *admin.AddProjectServiceAccountApiParams) admin.AddProjectServiceAccountApiRequest) *ServiceAccountsApi_AddProjectServiceAccountWithParams_Call { + _c.Call.Return(run) + return _c +} + +// CreateProjectServiceAccount provides a mock function with given fields: ctx, groupId, groupServiceAccountRequest +func (_m *ServiceAccountsApi) CreateProjectServiceAccount(ctx context.Context, groupId string, groupServiceAccountRequest *admin.GroupServiceAccountRequest) admin.CreateProjectServiceAccountApiRequest { + ret := _m.Called(ctx, groupId, groupServiceAccountRequest) + + if len(ret) == 0 { + panic("no return value specified for CreateProjectServiceAccount") + } + + var r0 admin.CreateProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, *admin.GroupServiceAccountRequest) admin.CreateProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, groupId, groupServiceAccountRequest) + } else { + r0 = ret.Get(0).(admin.CreateProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateProjectServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProjectServiceAccount' +type ServiceAccountsApi_CreateProjectServiceAccount_Call struct { + *mock.Call +} + +// CreateProjectServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - groupServiceAccountRequest *admin.GroupServiceAccountRequest +func (_e *ServiceAccountsApi_Expecter) CreateProjectServiceAccount(ctx any, groupId any, groupServiceAccountRequest any) *ServiceAccountsApi_CreateProjectServiceAccount_Call { + return &ServiceAccountsApi_CreateProjectServiceAccount_Call{Call: _e.mock.On("CreateProjectServiceAccount", ctx, groupId, groupServiceAccountRequest)} +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccount_Call) Run(run func(ctx context.Context, groupId string, groupServiceAccountRequest *admin.GroupServiceAccountRequest)) *ServiceAccountsApi_CreateProjectServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*admin.GroupServiceAccountRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccount_Call) Return(_a0 admin.CreateProjectServiceAccountApiRequest) *ServiceAccountsApi_CreateProjectServiceAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccount_Call) RunAndReturn(run func(context.Context, string, *admin.GroupServiceAccountRequest) admin.CreateProjectServiceAccountApiRequest) *ServiceAccountsApi_CreateProjectServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// CreateProjectServiceAccountAccessList provides a mock function with given fields: ctx, groupId, clientId, serviceAccountIPAccessListEntry +func (_m *ServiceAccountsApi) CreateProjectServiceAccountAccessList(ctx context.Context, groupId string, clientId string, serviceAccountIPAccessListEntry *[]admin.ServiceAccountIPAccessListEntry) admin.CreateProjectServiceAccountAccessListApiRequest { + ret := _m.Called(ctx, groupId, clientId, serviceAccountIPAccessListEntry) + + if len(ret) == 0 { + panic("no return value specified for CreateProjectServiceAccountAccessList") + } + + var r0 admin.CreateProjectServiceAccountAccessListApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *[]admin.ServiceAccountIPAccessListEntry) admin.CreateProjectServiceAccountAccessListApiRequest); ok { + r0 = rf(ctx, groupId, clientId, serviceAccountIPAccessListEntry) + } else { + r0 = ret.Get(0).(admin.CreateProjectServiceAccountAccessListApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProjectServiceAccountAccessList' +type ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call struct { + *mock.Call +} + +// CreateProjectServiceAccountAccessList is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - clientId string +// - serviceAccountIPAccessListEntry *[]admin.ServiceAccountIPAccessListEntry +func (_e *ServiceAccountsApi_Expecter) CreateProjectServiceAccountAccessList(ctx any, groupId any, clientId any, serviceAccountIPAccessListEntry any) *ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call { + return &ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call{Call: _e.mock.On("CreateProjectServiceAccountAccessList", ctx, groupId, clientId, serviceAccountIPAccessListEntry)} +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call) Run(run func(ctx context.Context, groupId string, clientId string, serviceAccountIPAccessListEntry *[]admin.ServiceAccountIPAccessListEntry)) *ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*[]admin.ServiceAccountIPAccessListEntry)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call) Return(_a0 admin.CreateProjectServiceAccountAccessListApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call) RunAndReturn(run func(context.Context, string, string, *[]admin.ServiceAccountIPAccessListEntry) admin.CreateProjectServiceAccountAccessListApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountAccessList_Call { + _c.Call.Return(run) + return _c +} + +// CreateProjectServiceAccountAccessListExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) CreateProjectServiceAccountAccessListExecute(r admin.CreateProjectServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for CreateProjectServiceAccountAccessListExecute") + } + + var r0 *admin.PaginatedServiceAccountIPAccessEntry + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.CreateProjectServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.CreateProjectServiceAccountAccessListApiRequest) *admin.PaginatedServiceAccountIPAccessEntry); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PaginatedServiceAccountIPAccessEntry) + } + } + + if rf, ok := ret.Get(1).(func(admin.CreateProjectServiceAccountAccessListApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.CreateProjectServiceAccountAccessListApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProjectServiceAccountAccessListExecute' +type ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call struct { + *mock.Call +} + +// CreateProjectServiceAccountAccessListExecute is a helper method to define mock.On call +// - r admin.CreateProjectServiceAccountAccessListApiRequest +func (_e *ServiceAccountsApi_Expecter) CreateProjectServiceAccountAccessListExecute(r any) *ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call { + return &ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call{Call: _e.mock.On("CreateProjectServiceAccountAccessListExecute", r)} +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call) Run(run func(r admin.CreateProjectServiceAccountAccessListApiRequest)) *ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.CreateProjectServiceAccountAccessListApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call) Return(_a0 *admin.PaginatedServiceAccountIPAccessEntry, _a1 *http.Response, _a2 error) *ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call) RunAndReturn(run func(admin.CreateProjectServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error)) *ServiceAccountsApi_CreateProjectServiceAccountAccessListExecute_Call { + _c.Call.Return(run) + return _c +} + +// CreateProjectServiceAccountAccessListWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) CreateProjectServiceAccountAccessListWithParams(ctx context.Context, args *admin.CreateProjectServiceAccountAccessListApiParams) admin.CreateProjectServiceAccountAccessListApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for CreateProjectServiceAccountAccessListWithParams") + } + + var r0 admin.CreateProjectServiceAccountAccessListApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.CreateProjectServiceAccountAccessListApiParams) admin.CreateProjectServiceAccountAccessListApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.CreateProjectServiceAccountAccessListApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProjectServiceAccountAccessListWithParams' +type ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call struct { + *mock.Call +} + +// CreateProjectServiceAccountAccessListWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.CreateProjectServiceAccountAccessListApiParams +func (_e *ServiceAccountsApi_Expecter) CreateProjectServiceAccountAccessListWithParams(ctx any, args any) *ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call { + return &ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call{Call: _e.mock.On("CreateProjectServiceAccountAccessListWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call) Run(run func(ctx context.Context, args *admin.CreateProjectServiceAccountAccessListApiParams)) *ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.CreateProjectServiceAccountAccessListApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call) Return(_a0 admin.CreateProjectServiceAccountAccessListApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call) RunAndReturn(run func(context.Context, *admin.CreateProjectServiceAccountAccessListApiParams) admin.CreateProjectServiceAccountAccessListApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountAccessListWithParams_Call { + _c.Call.Return(run) + return _c +} + +// CreateProjectServiceAccountExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) CreateProjectServiceAccountExecute(r admin.CreateProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for CreateProjectServiceAccountExecute") + } + + var r0 *admin.GroupServiceAccount + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.CreateProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.CreateProjectServiceAccountApiRequest) *admin.GroupServiceAccount); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.GroupServiceAccount) + } + } + + if rf, ok := ret.Get(1).(func(admin.CreateProjectServiceAccountApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.CreateProjectServiceAccountApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_CreateProjectServiceAccountExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProjectServiceAccountExecute' +type ServiceAccountsApi_CreateProjectServiceAccountExecute_Call struct { + *mock.Call +} + +// CreateProjectServiceAccountExecute is a helper method to define mock.On call +// - r admin.CreateProjectServiceAccountApiRequest +func (_e *ServiceAccountsApi_Expecter) CreateProjectServiceAccountExecute(r any) *ServiceAccountsApi_CreateProjectServiceAccountExecute_Call { + return &ServiceAccountsApi_CreateProjectServiceAccountExecute_Call{Call: _e.mock.On("CreateProjectServiceAccountExecute", r)} +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountExecute_Call) Run(run func(r admin.CreateProjectServiceAccountApiRequest)) *ServiceAccountsApi_CreateProjectServiceAccountExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.CreateProjectServiceAccountApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountExecute_Call) Return(_a0 *admin.GroupServiceAccount, _a1 *http.Response, _a2 error) *ServiceAccountsApi_CreateProjectServiceAccountExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountExecute_Call) RunAndReturn(run func(admin.CreateProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error)) *ServiceAccountsApi_CreateProjectServiceAccountExecute_Call { + _c.Call.Return(run) + return _c +} + +// CreateProjectServiceAccountSecret provides a mock function with given fields: ctx, groupId, clientId, serviceAccountSecretRequest +func (_m *ServiceAccountsApi) CreateProjectServiceAccountSecret(ctx context.Context, groupId string, clientId string, serviceAccountSecretRequest *admin.ServiceAccountSecretRequest) admin.CreateProjectServiceAccountSecretApiRequest { + ret := _m.Called(ctx, groupId, clientId, serviceAccountSecretRequest) + + if len(ret) == 0 { + panic("no return value specified for CreateProjectServiceAccountSecret") + } + + var r0 admin.CreateProjectServiceAccountSecretApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.ServiceAccountSecretRequest) admin.CreateProjectServiceAccountSecretApiRequest); ok { + r0 = rf(ctx, groupId, clientId, serviceAccountSecretRequest) + } else { + r0 = ret.Get(0).(admin.CreateProjectServiceAccountSecretApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateProjectServiceAccountSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProjectServiceAccountSecret' +type ServiceAccountsApi_CreateProjectServiceAccountSecret_Call struct { + *mock.Call +} + +// CreateProjectServiceAccountSecret is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - clientId string +// - serviceAccountSecretRequest *admin.ServiceAccountSecretRequest +func (_e *ServiceAccountsApi_Expecter) CreateProjectServiceAccountSecret(ctx any, groupId any, clientId any, serviceAccountSecretRequest any) *ServiceAccountsApi_CreateProjectServiceAccountSecret_Call { + return &ServiceAccountsApi_CreateProjectServiceAccountSecret_Call{Call: _e.mock.On("CreateProjectServiceAccountSecret", ctx, groupId, clientId, serviceAccountSecretRequest)} +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountSecret_Call) Run(run func(ctx context.Context, groupId string, clientId string, serviceAccountSecretRequest *admin.ServiceAccountSecretRequest)) *ServiceAccountsApi_CreateProjectServiceAccountSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.ServiceAccountSecretRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountSecret_Call) Return(_a0 admin.CreateProjectServiceAccountSecretApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountSecret_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountSecret_Call) RunAndReturn(run func(context.Context, string, string, *admin.ServiceAccountSecretRequest) admin.CreateProjectServiceAccountSecretApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountSecret_Call { + _c.Call.Return(run) + return _c +} + +// CreateProjectServiceAccountSecretExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) CreateProjectServiceAccountSecretExecute(r admin.CreateProjectServiceAccountSecretApiRequest) (*admin.ServiceAccountSecret, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for CreateProjectServiceAccountSecretExecute") + } + + var r0 *admin.ServiceAccountSecret + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.CreateProjectServiceAccountSecretApiRequest) (*admin.ServiceAccountSecret, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.CreateProjectServiceAccountSecretApiRequest) *admin.ServiceAccountSecret); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.ServiceAccountSecret) + } + } + + if rf, ok := ret.Get(1).(func(admin.CreateProjectServiceAccountSecretApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.CreateProjectServiceAccountSecretApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProjectServiceAccountSecretExecute' +type ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call struct { + *mock.Call +} + +// CreateProjectServiceAccountSecretExecute is a helper method to define mock.On call +// - r admin.CreateProjectServiceAccountSecretApiRequest +func (_e *ServiceAccountsApi_Expecter) CreateProjectServiceAccountSecretExecute(r any) *ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call { + return &ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call{Call: _e.mock.On("CreateProjectServiceAccountSecretExecute", r)} +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call) Run(run func(r admin.CreateProjectServiceAccountSecretApiRequest)) *ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.CreateProjectServiceAccountSecretApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call) Return(_a0 *admin.ServiceAccountSecret, _a1 *http.Response, _a2 error) *ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call) RunAndReturn(run func(admin.CreateProjectServiceAccountSecretApiRequest) (*admin.ServiceAccountSecret, *http.Response, error)) *ServiceAccountsApi_CreateProjectServiceAccountSecretExecute_Call { + _c.Call.Return(run) + return _c +} + +// CreateProjectServiceAccountSecretWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) CreateProjectServiceAccountSecretWithParams(ctx context.Context, args *admin.CreateProjectServiceAccountSecretApiParams) admin.CreateProjectServiceAccountSecretApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for CreateProjectServiceAccountSecretWithParams") + } + + var r0 admin.CreateProjectServiceAccountSecretApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.CreateProjectServiceAccountSecretApiParams) admin.CreateProjectServiceAccountSecretApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.CreateProjectServiceAccountSecretApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProjectServiceAccountSecretWithParams' +type ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call struct { + *mock.Call +} + +// CreateProjectServiceAccountSecretWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.CreateProjectServiceAccountSecretApiParams +func (_e *ServiceAccountsApi_Expecter) CreateProjectServiceAccountSecretWithParams(ctx any, args any) *ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call { + return &ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call{Call: _e.mock.On("CreateProjectServiceAccountSecretWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call) Run(run func(ctx context.Context, args *admin.CreateProjectServiceAccountSecretApiParams)) *ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.CreateProjectServiceAccountSecretApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call) Return(_a0 admin.CreateProjectServiceAccountSecretApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call) RunAndReturn(run func(context.Context, *admin.CreateProjectServiceAccountSecretApiParams) admin.CreateProjectServiceAccountSecretApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountSecretWithParams_Call { + _c.Call.Return(run) + return _c +} + +// CreateProjectServiceAccountWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) CreateProjectServiceAccountWithParams(ctx context.Context, args *admin.CreateProjectServiceAccountApiParams) admin.CreateProjectServiceAccountApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for CreateProjectServiceAccountWithParams") + } + + var r0 admin.CreateProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.CreateProjectServiceAccountApiParams) admin.CreateProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.CreateProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProjectServiceAccountWithParams' +type ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call struct { + *mock.Call +} + +// CreateProjectServiceAccountWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.CreateProjectServiceAccountApiParams +func (_e *ServiceAccountsApi_Expecter) CreateProjectServiceAccountWithParams(ctx any, args any) *ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call { + return &ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call{Call: _e.mock.On("CreateProjectServiceAccountWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call) Run(run func(ctx context.Context, args *admin.CreateProjectServiceAccountApiParams)) *ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.CreateProjectServiceAccountApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call) Return(_a0 admin.CreateProjectServiceAccountApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call) RunAndReturn(run func(context.Context, *admin.CreateProjectServiceAccountApiParams) admin.CreateProjectServiceAccountApiRequest) *ServiceAccountsApi_CreateProjectServiceAccountWithParams_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccount provides a mock function with given fields: ctx, orgId, orgServiceAccountRequest +func (_m *ServiceAccountsApi) CreateServiceAccount(ctx context.Context, orgId string, orgServiceAccountRequest *admin.OrgServiceAccountRequest) admin.CreateServiceAccountApiRequest { + ret := _m.Called(ctx, orgId, orgServiceAccountRequest) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccount") + } + + var r0 admin.CreateServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, *admin.OrgServiceAccountRequest) admin.CreateServiceAccountApiRequest); ok { + r0 = rf(ctx, orgId, orgServiceAccountRequest) + } else { + r0 = ret.Get(0).(admin.CreateServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccount' +type ServiceAccountsApi_CreateServiceAccount_Call struct { + *mock.Call +} + +// CreateServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - orgServiceAccountRequest *admin.OrgServiceAccountRequest +func (_e *ServiceAccountsApi_Expecter) CreateServiceAccount(ctx any, orgId any, orgServiceAccountRequest any) *ServiceAccountsApi_CreateServiceAccount_Call { + return &ServiceAccountsApi_CreateServiceAccount_Call{Call: _e.mock.On("CreateServiceAccount", ctx, orgId, orgServiceAccountRequest)} +} + +func (_c *ServiceAccountsApi_CreateServiceAccount_Call) Run(run func(ctx context.Context, orgId string, orgServiceAccountRequest *admin.OrgServiceAccountRequest)) *ServiceAccountsApi_CreateServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*admin.OrgServiceAccountRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccount_Call) Return(_a0 admin.CreateServiceAccountApiRequest) *ServiceAccountsApi_CreateServiceAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccount_Call) RunAndReturn(run func(context.Context, string, *admin.OrgServiceAccountRequest) admin.CreateServiceAccountApiRequest) *ServiceAccountsApi_CreateServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccountAccessList provides a mock function with given fields: ctx, orgId, clientId, serviceAccountIPAccessListEntry +func (_m *ServiceAccountsApi) CreateServiceAccountAccessList(ctx context.Context, orgId string, clientId string, serviceAccountIPAccessListEntry *[]admin.ServiceAccountIPAccessListEntry) admin.CreateServiceAccountAccessListApiRequest { + ret := _m.Called(ctx, orgId, clientId, serviceAccountIPAccessListEntry) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccountAccessList") + } + + var r0 admin.CreateServiceAccountAccessListApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *[]admin.ServiceAccountIPAccessListEntry) admin.CreateServiceAccountAccessListApiRequest); ok { + r0 = rf(ctx, orgId, clientId, serviceAccountIPAccessListEntry) + } else { + r0 = ret.Get(0).(admin.CreateServiceAccountAccessListApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateServiceAccountAccessList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccountAccessList' +type ServiceAccountsApi_CreateServiceAccountAccessList_Call struct { + *mock.Call +} + +// CreateServiceAccountAccessList is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - clientId string +// - serviceAccountIPAccessListEntry *[]admin.ServiceAccountIPAccessListEntry +func (_e *ServiceAccountsApi_Expecter) CreateServiceAccountAccessList(ctx any, orgId any, clientId any, serviceAccountIPAccessListEntry any) *ServiceAccountsApi_CreateServiceAccountAccessList_Call { + return &ServiceAccountsApi_CreateServiceAccountAccessList_Call{Call: _e.mock.On("CreateServiceAccountAccessList", ctx, orgId, clientId, serviceAccountIPAccessListEntry)} +} + +func (_c *ServiceAccountsApi_CreateServiceAccountAccessList_Call) Run(run func(ctx context.Context, orgId string, clientId string, serviceAccountIPAccessListEntry *[]admin.ServiceAccountIPAccessListEntry)) *ServiceAccountsApi_CreateServiceAccountAccessList_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*[]admin.ServiceAccountIPAccessListEntry)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountAccessList_Call) Return(_a0 admin.CreateServiceAccountAccessListApiRequest) *ServiceAccountsApi_CreateServiceAccountAccessList_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountAccessList_Call) RunAndReturn(run func(context.Context, string, string, *[]admin.ServiceAccountIPAccessListEntry) admin.CreateServiceAccountAccessListApiRequest) *ServiceAccountsApi_CreateServiceAccountAccessList_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccountAccessListExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) CreateServiceAccountAccessListExecute(r admin.CreateServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccountAccessListExecute") + } + + var r0 *admin.PaginatedServiceAccountIPAccessEntry + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.CreateServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.CreateServiceAccountAccessListApiRequest) *admin.PaginatedServiceAccountIPAccessEntry); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PaginatedServiceAccountIPAccessEntry) + } + } + + if rf, ok := ret.Get(1).(func(admin.CreateServiceAccountAccessListApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.CreateServiceAccountAccessListApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccountAccessListExecute' +type ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call struct { + *mock.Call +} + +// CreateServiceAccountAccessListExecute is a helper method to define mock.On call +// - r admin.CreateServiceAccountAccessListApiRequest +func (_e *ServiceAccountsApi_Expecter) CreateServiceAccountAccessListExecute(r any) *ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call { + return &ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call{Call: _e.mock.On("CreateServiceAccountAccessListExecute", r)} +} + +func (_c *ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call) Run(run func(r admin.CreateServiceAccountAccessListApiRequest)) *ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.CreateServiceAccountAccessListApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call) Return(_a0 *admin.PaginatedServiceAccountIPAccessEntry, _a1 *http.Response, _a2 error) *ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call) RunAndReturn(run func(admin.CreateServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error)) *ServiceAccountsApi_CreateServiceAccountAccessListExecute_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccountAccessListWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) CreateServiceAccountAccessListWithParams(ctx context.Context, args *admin.CreateServiceAccountAccessListApiParams) admin.CreateServiceAccountAccessListApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccountAccessListWithParams") + } + + var r0 admin.CreateServiceAccountAccessListApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.CreateServiceAccountAccessListApiParams) admin.CreateServiceAccountAccessListApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.CreateServiceAccountAccessListApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccountAccessListWithParams' +type ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call struct { + *mock.Call +} + +// CreateServiceAccountAccessListWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.CreateServiceAccountAccessListApiParams +func (_e *ServiceAccountsApi_Expecter) CreateServiceAccountAccessListWithParams(ctx any, args any) *ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call { + return &ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call{Call: _e.mock.On("CreateServiceAccountAccessListWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call) Run(run func(ctx context.Context, args *admin.CreateServiceAccountAccessListApiParams)) *ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.CreateServiceAccountAccessListApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call) Return(_a0 admin.CreateServiceAccountAccessListApiRequest) *ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call) RunAndReturn(run func(context.Context, *admin.CreateServiceAccountAccessListApiParams) admin.CreateServiceAccountAccessListApiRequest) *ServiceAccountsApi_CreateServiceAccountAccessListWithParams_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccountExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) CreateServiceAccountExecute(r admin.CreateServiceAccountApiRequest) (*admin.OrgServiceAccount, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccountExecute") + } + + var r0 *admin.OrgServiceAccount + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.CreateServiceAccountApiRequest) (*admin.OrgServiceAccount, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.CreateServiceAccountApiRequest) *admin.OrgServiceAccount); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.OrgServiceAccount) + } + } + + if rf, ok := ret.Get(1).(func(admin.CreateServiceAccountApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.CreateServiceAccountApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_CreateServiceAccountExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccountExecute' +type ServiceAccountsApi_CreateServiceAccountExecute_Call struct { + *mock.Call +} + +// CreateServiceAccountExecute is a helper method to define mock.On call +// - r admin.CreateServiceAccountApiRequest +func (_e *ServiceAccountsApi_Expecter) CreateServiceAccountExecute(r any) *ServiceAccountsApi_CreateServiceAccountExecute_Call { + return &ServiceAccountsApi_CreateServiceAccountExecute_Call{Call: _e.mock.On("CreateServiceAccountExecute", r)} +} + +func (_c *ServiceAccountsApi_CreateServiceAccountExecute_Call) Run(run func(r admin.CreateServiceAccountApiRequest)) *ServiceAccountsApi_CreateServiceAccountExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.CreateServiceAccountApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountExecute_Call) Return(_a0 *admin.OrgServiceAccount, _a1 *http.Response, _a2 error) *ServiceAccountsApi_CreateServiceAccountExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountExecute_Call) RunAndReturn(run func(admin.CreateServiceAccountApiRequest) (*admin.OrgServiceAccount, *http.Response, error)) *ServiceAccountsApi_CreateServiceAccountExecute_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccountSecret provides a mock function with given fields: ctx, orgId, clientId, serviceAccountSecretRequest +func (_m *ServiceAccountsApi) CreateServiceAccountSecret(ctx context.Context, orgId string, clientId string, serviceAccountSecretRequest *admin.ServiceAccountSecretRequest) admin.CreateServiceAccountSecretApiRequest { + ret := _m.Called(ctx, orgId, clientId, serviceAccountSecretRequest) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccountSecret") + } + + var r0 admin.CreateServiceAccountSecretApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.ServiceAccountSecretRequest) admin.CreateServiceAccountSecretApiRequest); ok { + r0 = rf(ctx, orgId, clientId, serviceAccountSecretRequest) + } else { + r0 = ret.Get(0).(admin.CreateServiceAccountSecretApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateServiceAccountSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccountSecret' +type ServiceAccountsApi_CreateServiceAccountSecret_Call struct { + *mock.Call +} + +// CreateServiceAccountSecret is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - clientId string +// - serviceAccountSecretRequest *admin.ServiceAccountSecretRequest +func (_e *ServiceAccountsApi_Expecter) CreateServiceAccountSecret(ctx any, orgId any, clientId any, serviceAccountSecretRequest any) *ServiceAccountsApi_CreateServiceAccountSecret_Call { + return &ServiceAccountsApi_CreateServiceAccountSecret_Call{Call: _e.mock.On("CreateServiceAccountSecret", ctx, orgId, clientId, serviceAccountSecretRequest)} +} + +func (_c *ServiceAccountsApi_CreateServiceAccountSecret_Call) Run(run func(ctx context.Context, orgId string, clientId string, serviceAccountSecretRequest *admin.ServiceAccountSecretRequest)) *ServiceAccountsApi_CreateServiceAccountSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.ServiceAccountSecretRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountSecret_Call) Return(_a0 admin.CreateServiceAccountSecretApiRequest) *ServiceAccountsApi_CreateServiceAccountSecret_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountSecret_Call) RunAndReturn(run func(context.Context, string, string, *admin.ServiceAccountSecretRequest) admin.CreateServiceAccountSecretApiRequest) *ServiceAccountsApi_CreateServiceAccountSecret_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccountSecretExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) CreateServiceAccountSecretExecute(r admin.CreateServiceAccountSecretApiRequest) (*admin.ServiceAccountSecret, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccountSecretExecute") + } + + var r0 *admin.ServiceAccountSecret + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.CreateServiceAccountSecretApiRequest) (*admin.ServiceAccountSecret, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.CreateServiceAccountSecretApiRequest) *admin.ServiceAccountSecret); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.ServiceAccountSecret) + } + } + + if rf, ok := ret.Get(1).(func(admin.CreateServiceAccountSecretApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.CreateServiceAccountSecretApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_CreateServiceAccountSecretExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccountSecretExecute' +type ServiceAccountsApi_CreateServiceAccountSecretExecute_Call struct { + *mock.Call +} + +// CreateServiceAccountSecretExecute is a helper method to define mock.On call +// - r admin.CreateServiceAccountSecretApiRequest +func (_e *ServiceAccountsApi_Expecter) CreateServiceAccountSecretExecute(r any) *ServiceAccountsApi_CreateServiceAccountSecretExecute_Call { + return &ServiceAccountsApi_CreateServiceAccountSecretExecute_Call{Call: _e.mock.On("CreateServiceAccountSecretExecute", r)} +} + +func (_c *ServiceAccountsApi_CreateServiceAccountSecretExecute_Call) Run(run func(r admin.CreateServiceAccountSecretApiRequest)) *ServiceAccountsApi_CreateServiceAccountSecretExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.CreateServiceAccountSecretApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountSecretExecute_Call) Return(_a0 *admin.ServiceAccountSecret, _a1 *http.Response, _a2 error) *ServiceAccountsApi_CreateServiceAccountSecretExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountSecretExecute_Call) RunAndReturn(run func(admin.CreateServiceAccountSecretApiRequest) (*admin.ServiceAccountSecret, *http.Response, error)) *ServiceAccountsApi_CreateServiceAccountSecretExecute_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccountSecretWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) CreateServiceAccountSecretWithParams(ctx context.Context, args *admin.CreateServiceAccountSecretApiParams) admin.CreateServiceAccountSecretApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccountSecretWithParams") + } + + var r0 admin.CreateServiceAccountSecretApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.CreateServiceAccountSecretApiParams) admin.CreateServiceAccountSecretApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.CreateServiceAccountSecretApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccountSecretWithParams' +type ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call struct { + *mock.Call +} + +// CreateServiceAccountSecretWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.CreateServiceAccountSecretApiParams +func (_e *ServiceAccountsApi_Expecter) CreateServiceAccountSecretWithParams(ctx any, args any) *ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call { + return &ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call{Call: _e.mock.On("CreateServiceAccountSecretWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call) Run(run func(ctx context.Context, args *admin.CreateServiceAccountSecretApiParams)) *ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.CreateServiceAccountSecretApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call) Return(_a0 admin.CreateServiceAccountSecretApiRequest) *ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call) RunAndReturn(run func(context.Context, *admin.CreateServiceAccountSecretApiParams) admin.CreateServiceAccountSecretApiRequest) *ServiceAccountsApi_CreateServiceAccountSecretWithParams_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccountWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) CreateServiceAccountWithParams(ctx context.Context, args *admin.CreateServiceAccountApiParams) admin.CreateServiceAccountApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccountWithParams") + } + + var r0 admin.CreateServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.CreateServiceAccountApiParams) admin.CreateServiceAccountApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.CreateServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_CreateServiceAccountWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccountWithParams' +type ServiceAccountsApi_CreateServiceAccountWithParams_Call struct { + *mock.Call +} + +// CreateServiceAccountWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.CreateServiceAccountApiParams +func (_e *ServiceAccountsApi_Expecter) CreateServiceAccountWithParams(ctx any, args any) *ServiceAccountsApi_CreateServiceAccountWithParams_Call { + return &ServiceAccountsApi_CreateServiceAccountWithParams_Call{Call: _e.mock.On("CreateServiceAccountWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_CreateServiceAccountWithParams_Call) Run(run func(ctx context.Context, args *admin.CreateServiceAccountApiParams)) *ServiceAccountsApi_CreateServiceAccountWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.CreateServiceAccountApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountWithParams_Call) Return(_a0 admin.CreateServiceAccountApiRequest) *ServiceAccountsApi_CreateServiceAccountWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_CreateServiceAccountWithParams_Call) RunAndReturn(run func(context.Context, *admin.CreateServiceAccountApiParams) admin.CreateServiceAccountApiRequest) *ServiceAccountsApi_CreateServiceAccountWithParams_Call { + _c.Call.Return(run) + return _c +} + +// DeleteProjectServiceAccount provides a mock function with given fields: ctx, clientId, groupId +func (_m *ServiceAccountsApi) DeleteProjectServiceAccount(ctx context.Context, clientId string, groupId string) admin.DeleteProjectServiceAccountApiRequest { + ret := _m.Called(ctx, clientId, groupId) + + if len(ret) == 0 { + panic("no return value specified for DeleteProjectServiceAccount") + } + + var r0 admin.DeleteProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.DeleteProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, clientId, groupId) + } else { + r0 = ret.Get(0).(admin.DeleteProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteProjectServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProjectServiceAccount' +type ServiceAccountsApi_DeleteProjectServiceAccount_Call struct { + *mock.Call +} + +// DeleteProjectServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - clientId string +// - groupId string +func (_e *ServiceAccountsApi_Expecter) DeleteProjectServiceAccount(ctx any, clientId any, groupId any) *ServiceAccountsApi_DeleteProjectServiceAccount_Call { + return &ServiceAccountsApi_DeleteProjectServiceAccount_Call{Call: _e.mock.On("DeleteProjectServiceAccount", ctx, clientId, groupId)} +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccount_Call) Run(run func(ctx context.Context, clientId string, groupId string)) *ServiceAccountsApi_DeleteProjectServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccount_Call) Return(_a0 admin.DeleteProjectServiceAccountApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccount_Call) RunAndReturn(run func(context.Context, string, string) admin.DeleteProjectServiceAccountApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// DeleteProjectServiceAccountAccessListEntry provides a mock function with given fields: ctx, groupId, clientId, ipAddress +func (_m *ServiceAccountsApi) DeleteProjectServiceAccountAccessListEntry(ctx context.Context, groupId string, clientId string, ipAddress string) admin.DeleteProjectServiceAccountAccessListEntryApiRequest { + ret := _m.Called(ctx, groupId, clientId, ipAddress) + + if len(ret) == 0 { + panic("no return value specified for DeleteProjectServiceAccountAccessListEntry") + } + + var r0 admin.DeleteProjectServiceAccountAccessListEntryApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) admin.DeleteProjectServiceAccountAccessListEntryApiRequest); ok { + r0 = rf(ctx, groupId, clientId, ipAddress) + } else { + r0 = ret.Get(0).(admin.DeleteProjectServiceAccountAccessListEntryApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProjectServiceAccountAccessListEntry' +type ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call struct { + *mock.Call +} + +// DeleteProjectServiceAccountAccessListEntry is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - clientId string +// - ipAddress string +func (_e *ServiceAccountsApi_Expecter) DeleteProjectServiceAccountAccessListEntry(ctx any, groupId any, clientId any, ipAddress any) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call { + return &ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call{Call: _e.mock.On("DeleteProjectServiceAccountAccessListEntry", ctx, groupId, clientId, ipAddress)} +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call) Run(run func(ctx context.Context, groupId string, clientId string, ipAddress string)) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call) Return(_a0 admin.DeleteProjectServiceAccountAccessListEntryApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call) RunAndReturn(run func(context.Context, string, string, string) admin.DeleteProjectServiceAccountAccessListEntryApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntry_Call { + _c.Call.Return(run) + return _c +} + +// DeleteProjectServiceAccountAccessListEntryExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) DeleteProjectServiceAccountAccessListEntryExecute(r admin.DeleteProjectServiceAccountAccessListEntryApiRequest) (*http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for DeleteProjectServiceAccountAccessListEntryExecute") + } + + var r0 *http.Response + var r1 error + if rf, ok := ret.Get(0).(func(admin.DeleteProjectServiceAccountAccessListEntryApiRequest) (*http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.DeleteProjectServiceAccountAccessListEntryApiRequest) *http.Response); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + + if rf, ok := ret.Get(1).(func(admin.DeleteProjectServiceAccountAccessListEntryApiRequest) error); ok { + r1 = rf(r) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProjectServiceAccountAccessListEntryExecute' +type ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call struct { + *mock.Call +} + +// DeleteProjectServiceAccountAccessListEntryExecute is a helper method to define mock.On call +// - r admin.DeleteProjectServiceAccountAccessListEntryApiRequest +func (_e *ServiceAccountsApi_Expecter) DeleteProjectServiceAccountAccessListEntryExecute(r any) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call { + return &ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call{Call: _e.mock.On("DeleteProjectServiceAccountAccessListEntryExecute", r)} +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call) Run(run func(r admin.DeleteProjectServiceAccountAccessListEntryApiRequest)) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.DeleteProjectServiceAccountAccessListEntryApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call) Return(_a0 *http.Response, _a1 error) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call) RunAndReturn(run func(admin.DeleteProjectServiceAccountAccessListEntryApiRequest) (*http.Response, error)) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryExecute_Call { + _c.Call.Return(run) + return _c +} + +// DeleteProjectServiceAccountAccessListEntryWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) DeleteProjectServiceAccountAccessListEntryWithParams(ctx context.Context, args *admin.DeleteProjectServiceAccountAccessListEntryApiParams) admin.DeleteProjectServiceAccountAccessListEntryApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for DeleteProjectServiceAccountAccessListEntryWithParams") + } + + var r0 admin.DeleteProjectServiceAccountAccessListEntryApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.DeleteProjectServiceAccountAccessListEntryApiParams) admin.DeleteProjectServiceAccountAccessListEntryApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.DeleteProjectServiceAccountAccessListEntryApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProjectServiceAccountAccessListEntryWithParams' +type ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call struct { + *mock.Call +} + +// DeleteProjectServiceAccountAccessListEntryWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.DeleteProjectServiceAccountAccessListEntryApiParams +func (_e *ServiceAccountsApi_Expecter) DeleteProjectServiceAccountAccessListEntryWithParams(ctx any, args any) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call { + return &ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call{Call: _e.mock.On("DeleteProjectServiceAccountAccessListEntryWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call) Run(run func(ctx context.Context, args *admin.DeleteProjectServiceAccountAccessListEntryApiParams)) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.DeleteProjectServiceAccountAccessListEntryApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call) Return(_a0 admin.DeleteProjectServiceAccountAccessListEntryApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call) RunAndReturn(run func(context.Context, *admin.DeleteProjectServiceAccountAccessListEntryApiParams) admin.DeleteProjectServiceAccountAccessListEntryApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountAccessListEntryWithParams_Call { + _c.Call.Return(run) + return _c +} + +// DeleteProjectServiceAccountExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) DeleteProjectServiceAccountExecute(r admin.DeleteProjectServiceAccountApiRequest) (any, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for DeleteProjectServiceAccountExecute") + } + + var r0 any + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.DeleteProjectServiceAccountApiRequest) (any, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.DeleteProjectServiceAccountApiRequest) any); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(any) + } + } + + if rf, ok := ret.Get(1).(func(admin.DeleteProjectServiceAccountApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.DeleteProjectServiceAccountApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProjectServiceAccountExecute' +type ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call struct { + *mock.Call +} + +// DeleteProjectServiceAccountExecute is a helper method to define mock.On call +// - r admin.DeleteProjectServiceAccountApiRequest +func (_e *ServiceAccountsApi_Expecter) DeleteProjectServiceAccountExecute(r any) *ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call { + return &ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call{Call: _e.mock.On("DeleteProjectServiceAccountExecute", r)} +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call) Run(run func(r admin.DeleteProjectServiceAccountApiRequest)) *ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.DeleteProjectServiceAccountApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call) Return(_a0 any, _a1 *http.Response, _a2 error) *ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call) RunAndReturn(run func(admin.DeleteProjectServiceAccountApiRequest) (any, *http.Response, error)) *ServiceAccountsApi_DeleteProjectServiceAccountExecute_Call { + _c.Call.Return(run) + return _c +} + +// DeleteProjectServiceAccountSecret provides a mock function with given fields: ctx, clientId, secretId, groupId +func (_m *ServiceAccountsApi) DeleteProjectServiceAccountSecret(ctx context.Context, clientId string, secretId string, groupId string) admin.DeleteProjectServiceAccountSecretApiRequest { + ret := _m.Called(ctx, clientId, secretId, groupId) + + if len(ret) == 0 { + panic("no return value specified for DeleteProjectServiceAccountSecret") + } + + var r0 admin.DeleteProjectServiceAccountSecretApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) admin.DeleteProjectServiceAccountSecretApiRequest); ok { + r0 = rf(ctx, clientId, secretId, groupId) + } else { + r0 = ret.Get(0).(admin.DeleteProjectServiceAccountSecretApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProjectServiceAccountSecret' +type ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call struct { + *mock.Call +} + +// DeleteProjectServiceAccountSecret is a helper method to define mock.On call +// - ctx context.Context +// - clientId string +// - secretId string +// - groupId string +func (_e *ServiceAccountsApi_Expecter) DeleteProjectServiceAccountSecret(ctx any, clientId any, secretId any, groupId any) *ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call { + return &ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call{Call: _e.mock.On("DeleteProjectServiceAccountSecret", ctx, clientId, secretId, groupId)} +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call) Run(run func(ctx context.Context, clientId string, secretId string, groupId string)) *ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call) Return(_a0 admin.DeleteProjectServiceAccountSecretApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call) RunAndReturn(run func(context.Context, string, string, string) admin.DeleteProjectServiceAccountSecretApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountSecret_Call { + _c.Call.Return(run) + return _c +} + +// DeleteProjectServiceAccountSecretExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) DeleteProjectServiceAccountSecretExecute(r admin.DeleteProjectServiceAccountSecretApiRequest) (*http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for DeleteProjectServiceAccountSecretExecute") + } + + var r0 *http.Response + var r1 error + if rf, ok := ret.Get(0).(func(admin.DeleteProjectServiceAccountSecretApiRequest) (*http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.DeleteProjectServiceAccountSecretApiRequest) *http.Response); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + + if rf, ok := ret.Get(1).(func(admin.DeleteProjectServiceAccountSecretApiRequest) error); ok { + r1 = rf(r) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProjectServiceAccountSecretExecute' +type ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call struct { + *mock.Call +} + +// DeleteProjectServiceAccountSecretExecute is a helper method to define mock.On call +// - r admin.DeleteProjectServiceAccountSecretApiRequest +func (_e *ServiceAccountsApi_Expecter) DeleteProjectServiceAccountSecretExecute(r any) *ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call { + return &ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call{Call: _e.mock.On("DeleteProjectServiceAccountSecretExecute", r)} +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call) Run(run func(r admin.DeleteProjectServiceAccountSecretApiRequest)) *ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.DeleteProjectServiceAccountSecretApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call) Return(_a0 *http.Response, _a1 error) *ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call) RunAndReturn(run func(admin.DeleteProjectServiceAccountSecretApiRequest) (*http.Response, error)) *ServiceAccountsApi_DeleteProjectServiceAccountSecretExecute_Call { + _c.Call.Return(run) + return _c +} + +// DeleteProjectServiceAccountSecretWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) DeleteProjectServiceAccountSecretWithParams(ctx context.Context, args *admin.DeleteProjectServiceAccountSecretApiParams) admin.DeleteProjectServiceAccountSecretApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for DeleteProjectServiceAccountSecretWithParams") + } + + var r0 admin.DeleteProjectServiceAccountSecretApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.DeleteProjectServiceAccountSecretApiParams) admin.DeleteProjectServiceAccountSecretApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.DeleteProjectServiceAccountSecretApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProjectServiceAccountSecretWithParams' +type ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call struct { + *mock.Call +} + +// DeleteProjectServiceAccountSecretWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.DeleteProjectServiceAccountSecretApiParams +func (_e *ServiceAccountsApi_Expecter) DeleteProjectServiceAccountSecretWithParams(ctx any, args any) *ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call { + return &ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call{Call: _e.mock.On("DeleteProjectServiceAccountSecretWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call) Run(run func(ctx context.Context, args *admin.DeleteProjectServiceAccountSecretApiParams)) *ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.DeleteProjectServiceAccountSecretApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call) Return(_a0 admin.DeleteProjectServiceAccountSecretApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call) RunAndReturn(run func(context.Context, *admin.DeleteProjectServiceAccountSecretApiParams) admin.DeleteProjectServiceAccountSecretApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountSecretWithParams_Call { + _c.Call.Return(run) + return _c +} + +// DeleteProjectServiceAccountWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) DeleteProjectServiceAccountWithParams(ctx context.Context, args *admin.DeleteProjectServiceAccountApiParams) admin.DeleteProjectServiceAccountApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for DeleteProjectServiceAccountWithParams") + } + + var r0 admin.DeleteProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.DeleteProjectServiceAccountApiParams) admin.DeleteProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.DeleteProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteProjectServiceAccountWithParams' +type ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call struct { + *mock.Call +} + +// DeleteProjectServiceAccountWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.DeleteProjectServiceAccountApiParams +func (_e *ServiceAccountsApi_Expecter) DeleteProjectServiceAccountWithParams(ctx any, args any) *ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call { + return &ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call{Call: _e.mock.On("DeleteProjectServiceAccountWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call) Run(run func(ctx context.Context, args *admin.DeleteProjectServiceAccountApiParams)) *ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.DeleteProjectServiceAccountApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call) Return(_a0 admin.DeleteProjectServiceAccountApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call) RunAndReturn(run func(context.Context, *admin.DeleteProjectServiceAccountApiParams) admin.DeleteProjectServiceAccountApiRequest) *ServiceAccountsApi_DeleteProjectServiceAccountWithParams_Call { + _c.Call.Return(run) + return _c +} + +// DeleteServiceAccount provides a mock function with given fields: ctx, clientId, orgId +func (_m *ServiceAccountsApi) DeleteServiceAccount(ctx context.Context, clientId string, orgId string) admin.DeleteServiceAccountApiRequest { + ret := _m.Called(ctx, clientId, orgId) + + if len(ret) == 0 { + panic("no return value specified for DeleteServiceAccount") + } + + var r0 admin.DeleteServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.DeleteServiceAccountApiRequest); ok { + r0 = rf(ctx, clientId, orgId) + } else { + r0 = ret.Get(0).(admin.DeleteServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServiceAccount' +type ServiceAccountsApi_DeleteServiceAccount_Call struct { + *mock.Call +} + +// DeleteServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - clientId string +// - orgId string +func (_e *ServiceAccountsApi_Expecter) DeleteServiceAccount(ctx any, clientId any, orgId any) *ServiceAccountsApi_DeleteServiceAccount_Call { + return &ServiceAccountsApi_DeleteServiceAccount_Call{Call: _e.mock.On("DeleteServiceAccount", ctx, clientId, orgId)} +} + +func (_c *ServiceAccountsApi_DeleteServiceAccount_Call) Run(run func(ctx context.Context, clientId string, orgId string)) *ServiceAccountsApi_DeleteServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccount_Call) Return(_a0 admin.DeleteServiceAccountApiRequest) *ServiceAccountsApi_DeleteServiceAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccount_Call) RunAndReturn(run func(context.Context, string, string) admin.DeleteServiceAccountApiRequest) *ServiceAccountsApi_DeleteServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// DeleteServiceAccountAccessListEntry provides a mock function with given fields: ctx, orgId, clientId, ipAddress +func (_m *ServiceAccountsApi) DeleteServiceAccountAccessListEntry(ctx context.Context, orgId string, clientId string, ipAddress string) admin.DeleteServiceAccountAccessListEntryApiRequest { + ret := _m.Called(ctx, orgId, clientId, ipAddress) + + if len(ret) == 0 { + panic("no return value specified for DeleteServiceAccountAccessListEntry") + } + + var r0 admin.DeleteServiceAccountAccessListEntryApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) admin.DeleteServiceAccountAccessListEntryApiRequest); ok { + r0 = rf(ctx, orgId, clientId, ipAddress) + } else { + r0 = ret.Get(0).(admin.DeleteServiceAccountAccessListEntryApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServiceAccountAccessListEntry' +type ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call struct { + *mock.Call +} + +// DeleteServiceAccountAccessListEntry is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - clientId string +// - ipAddress string +func (_e *ServiceAccountsApi_Expecter) DeleteServiceAccountAccessListEntry(ctx any, orgId any, clientId any, ipAddress any) *ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call { + return &ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call{Call: _e.mock.On("DeleteServiceAccountAccessListEntry", ctx, orgId, clientId, ipAddress)} +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call) Run(run func(ctx context.Context, orgId string, clientId string, ipAddress string)) *ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call) Return(_a0 admin.DeleteServiceAccountAccessListEntryApiRequest) *ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call) RunAndReturn(run func(context.Context, string, string, string) admin.DeleteServiceAccountAccessListEntryApiRequest) *ServiceAccountsApi_DeleteServiceAccountAccessListEntry_Call { + _c.Call.Return(run) + return _c +} + +// DeleteServiceAccountAccessListEntryExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) DeleteServiceAccountAccessListEntryExecute(r admin.DeleteServiceAccountAccessListEntryApiRequest) (*http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for DeleteServiceAccountAccessListEntryExecute") + } + + var r0 *http.Response + var r1 error + if rf, ok := ret.Get(0).(func(admin.DeleteServiceAccountAccessListEntryApiRequest) (*http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.DeleteServiceAccountAccessListEntryApiRequest) *http.Response); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + + if rf, ok := ret.Get(1).(func(admin.DeleteServiceAccountAccessListEntryApiRequest) error); ok { + r1 = rf(r) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServiceAccountAccessListEntryExecute' +type ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call struct { + *mock.Call +} + +// DeleteServiceAccountAccessListEntryExecute is a helper method to define mock.On call +// - r admin.DeleteServiceAccountAccessListEntryApiRequest +func (_e *ServiceAccountsApi_Expecter) DeleteServiceAccountAccessListEntryExecute(r any) *ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call { + return &ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call{Call: _e.mock.On("DeleteServiceAccountAccessListEntryExecute", r)} +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call) Run(run func(r admin.DeleteServiceAccountAccessListEntryApiRequest)) *ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.DeleteServiceAccountAccessListEntryApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call) Return(_a0 *http.Response, _a1 error) *ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call) RunAndReturn(run func(admin.DeleteServiceAccountAccessListEntryApiRequest) (*http.Response, error)) *ServiceAccountsApi_DeleteServiceAccountAccessListEntryExecute_Call { + _c.Call.Return(run) + return _c +} + +// DeleteServiceAccountAccessListEntryWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) DeleteServiceAccountAccessListEntryWithParams(ctx context.Context, args *admin.DeleteServiceAccountAccessListEntryApiParams) admin.DeleteServiceAccountAccessListEntryApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for DeleteServiceAccountAccessListEntryWithParams") + } + + var r0 admin.DeleteServiceAccountAccessListEntryApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.DeleteServiceAccountAccessListEntryApiParams) admin.DeleteServiceAccountAccessListEntryApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.DeleteServiceAccountAccessListEntryApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServiceAccountAccessListEntryWithParams' +type ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call struct { + *mock.Call +} + +// DeleteServiceAccountAccessListEntryWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.DeleteServiceAccountAccessListEntryApiParams +func (_e *ServiceAccountsApi_Expecter) DeleteServiceAccountAccessListEntryWithParams(ctx any, args any) *ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call { + return &ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call{Call: _e.mock.On("DeleteServiceAccountAccessListEntryWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call) Run(run func(ctx context.Context, args *admin.DeleteServiceAccountAccessListEntryApiParams)) *ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.DeleteServiceAccountAccessListEntryApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call) Return(_a0 admin.DeleteServiceAccountAccessListEntryApiRequest) *ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call) RunAndReturn(run func(context.Context, *admin.DeleteServiceAccountAccessListEntryApiParams) admin.DeleteServiceAccountAccessListEntryApiRequest) *ServiceAccountsApi_DeleteServiceAccountAccessListEntryWithParams_Call { + _c.Call.Return(run) + return _c +} + +// DeleteServiceAccountExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) DeleteServiceAccountExecute(r admin.DeleteServiceAccountApiRequest) (*http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for DeleteServiceAccountExecute") + } + + var r0 *http.Response + var r1 error + if rf, ok := ret.Get(0).(func(admin.DeleteServiceAccountApiRequest) (*http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.DeleteServiceAccountApiRequest) *http.Response); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + + if rf, ok := ret.Get(1).(func(admin.DeleteServiceAccountApiRequest) error); ok { + r1 = rf(r) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ServiceAccountsApi_DeleteServiceAccountExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServiceAccountExecute' +type ServiceAccountsApi_DeleteServiceAccountExecute_Call struct { + *mock.Call +} + +// DeleteServiceAccountExecute is a helper method to define mock.On call +// - r admin.DeleteServiceAccountApiRequest +func (_e *ServiceAccountsApi_Expecter) DeleteServiceAccountExecute(r any) *ServiceAccountsApi_DeleteServiceAccountExecute_Call { + return &ServiceAccountsApi_DeleteServiceAccountExecute_Call{Call: _e.mock.On("DeleteServiceAccountExecute", r)} +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountExecute_Call) Run(run func(r admin.DeleteServiceAccountApiRequest)) *ServiceAccountsApi_DeleteServiceAccountExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.DeleteServiceAccountApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountExecute_Call) Return(_a0 *http.Response, _a1 error) *ServiceAccountsApi_DeleteServiceAccountExecute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountExecute_Call) RunAndReturn(run func(admin.DeleteServiceAccountApiRequest) (*http.Response, error)) *ServiceAccountsApi_DeleteServiceAccountExecute_Call { + _c.Call.Return(run) + return _c +} + +// DeleteServiceAccountSecret provides a mock function with given fields: ctx, clientId, secretId, orgId +func (_m *ServiceAccountsApi) DeleteServiceAccountSecret(ctx context.Context, clientId string, secretId string, orgId string) admin.DeleteServiceAccountSecretApiRequest { + ret := _m.Called(ctx, clientId, secretId, orgId) + + if len(ret) == 0 { + panic("no return value specified for DeleteServiceAccountSecret") + } + + var r0 admin.DeleteServiceAccountSecretApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) admin.DeleteServiceAccountSecretApiRequest); ok { + r0 = rf(ctx, clientId, secretId, orgId) + } else { + r0 = ret.Get(0).(admin.DeleteServiceAccountSecretApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteServiceAccountSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServiceAccountSecret' +type ServiceAccountsApi_DeleteServiceAccountSecret_Call struct { + *mock.Call +} + +// DeleteServiceAccountSecret is a helper method to define mock.On call +// - ctx context.Context +// - clientId string +// - secretId string +// - orgId string +func (_e *ServiceAccountsApi_Expecter) DeleteServiceAccountSecret(ctx any, clientId any, secretId any, orgId any) *ServiceAccountsApi_DeleteServiceAccountSecret_Call { + return &ServiceAccountsApi_DeleteServiceAccountSecret_Call{Call: _e.mock.On("DeleteServiceAccountSecret", ctx, clientId, secretId, orgId)} +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountSecret_Call) Run(run func(ctx context.Context, clientId string, secretId string, orgId string)) *ServiceAccountsApi_DeleteServiceAccountSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountSecret_Call) Return(_a0 admin.DeleteServiceAccountSecretApiRequest) *ServiceAccountsApi_DeleteServiceAccountSecret_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountSecret_Call) RunAndReturn(run func(context.Context, string, string, string) admin.DeleteServiceAccountSecretApiRequest) *ServiceAccountsApi_DeleteServiceAccountSecret_Call { + _c.Call.Return(run) + return _c +} + +// DeleteServiceAccountSecretExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) DeleteServiceAccountSecretExecute(r admin.DeleteServiceAccountSecretApiRequest) (*http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for DeleteServiceAccountSecretExecute") + } + + var r0 *http.Response + var r1 error + if rf, ok := ret.Get(0).(func(admin.DeleteServiceAccountSecretApiRequest) (*http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.DeleteServiceAccountSecretApiRequest) *http.Response); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + + if rf, ok := ret.Get(1).(func(admin.DeleteServiceAccountSecretApiRequest) error); ok { + r1 = rf(r) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServiceAccountSecretExecute' +type ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call struct { + *mock.Call +} + +// DeleteServiceAccountSecretExecute is a helper method to define mock.On call +// - r admin.DeleteServiceAccountSecretApiRequest +func (_e *ServiceAccountsApi_Expecter) DeleteServiceAccountSecretExecute(r any) *ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call { + return &ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call{Call: _e.mock.On("DeleteServiceAccountSecretExecute", r)} +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call) Run(run func(r admin.DeleteServiceAccountSecretApiRequest)) *ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.DeleteServiceAccountSecretApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call) Return(_a0 *http.Response, _a1 error) *ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call) RunAndReturn(run func(admin.DeleteServiceAccountSecretApiRequest) (*http.Response, error)) *ServiceAccountsApi_DeleteServiceAccountSecretExecute_Call { + _c.Call.Return(run) + return _c +} + +// DeleteServiceAccountSecretWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) DeleteServiceAccountSecretWithParams(ctx context.Context, args *admin.DeleteServiceAccountSecretApiParams) admin.DeleteServiceAccountSecretApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for DeleteServiceAccountSecretWithParams") + } + + var r0 admin.DeleteServiceAccountSecretApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.DeleteServiceAccountSecretApiParams) admin.DeleteServiceAccountSecretApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.DeleteServiceAccountSecretApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServiceAccountSecretWithParams' +type ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call struct { + *mock.Call +} + +// DeleteServiceAccountSecretWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.DeleteServiceAccountSecretApiParams +func (_e *ServiceAccountsApi_Expecter) DeleteServiceAccountSecretWithParams(ctx any, args any) *ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call { + return &ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call{Call: _e.mock.On("DeleteServiceAccountSecretWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call) Run(run func(ctx context.Context, args *admin.DeleteServiceAccountSecretApiParams)) *ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.DeleteServiceAccountSecretApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call) Return(_a0 admin.DeleteServiceAccountSecretApiRequest) *ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call) RunAndReturn(run func(context.Context, *admin.DeleteServiceAccountSecretApiParams) admin.DeleteServiceAccountSecretApiRequest) *ServiceAccountsApi_DeleteServiceAccountSecretWithParams_Call { + _c.Call.Return(run) + return _c +} + +// DeleteServiceAccountWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) DeleteServiceAccountWithParams(ctx context.Context, args *admin.DeleteServiceAccountApiParams) admin.DeleteServiceAccountApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for DeleteServiceAccountWithParams") + } + + var r0 admin.DeleteServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.DeleteServiceAccountApiParams) admin.DeleteServiceAccountApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.DeleteServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_DeleteServiceAccountWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteServiceAccountWithParams' +type ServiceAccountsApi_DeleteServiceAccountWithParams_Call struct { + *mock.Call +} + +// DeleteServiceAccountWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.DeleteServiceAccountApiParams +func (_e *ServiceAccountsApi_Expecter) DeleteServiceAccountWithParams(ctx any, args any) *ServiceAccountsApi_DeleteServiceAccountWithParams_Call { + return &ServiceAccountsApi_DeleteServiceAccountWithParams_Call{Call: _e.mock.On("DeleteServiceAccountWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountWithParams_Call) Run(run func(ctx context.Context, args *admin.DeleteServiceAccountApiParams)) *ServiceAccountsApi_DeleteServiceAccountWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.DeleteServiceAccountApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountWithParams_Call) Return(_a0 admin.DeleteServiceAccountApiRequest) *ServiceAccountsApi_DeleteServiceAccountWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_DeleteServiceAccountWithParams_Call) RunAndReturn(run func(context.Context, *admin.DeleteServiceAccountApiParams) admin.DeleteServiceAccountApiRequest) *ServiceAccountsApi_DeleteServiceAccountWithParams_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectServiceAccount provides a mock function with given fields: ctx, groupId, clientId +func (_m *ServiceAccountsApi) GetProjectServiceAccount(ctx context.Context, groupId string, clientId string) admin.GetProjectServiceAccountApiRequest { + ret := _m.Called(ctx, groupId, clientId) + + if len(ret) == 0 { + panic("no return value specified for GetProjectServiceAccount") + } + + var r0 admin.GetProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.GetProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, groupId, clientId) + } else { + r0 = ret.Get(0).(admin.GetProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_GetProjectServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectServiceAccount' +type ServiceAccountsApi_GetProjectServiceAccount_Call struct { + *mock.Call +} + +// GetProjectServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - clientId string +func (_e *ServiceAccountsApi_Expecter) GetProjectServiceAccount(ctx any, groupId any, clientId any) *ServiceAccountsApi_GetProjectServiceAccount_Call { + return &ServiceAccountsApi_GetProjectServiceAccount_Call{Call: _e.mock.On("GetProjectServiceAccount", ctx, groupId, clientId)} +} + +func (_c *ServiceAccountsApi_GetProjectServiceAccount_Call) Run(run func(ctx context.Context, groupId string, clientId string)) *ServiceAccountsApi_GetProjectServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_GetProjectServiceAccount_Call) Return(_a0 admin.GetProjectServiceAccountApiRequest) *ServiceAccountsApi_GetProjectServiceAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_GetProjectServiceAccount_Call) RunAndReturn(run func(context.Context, string, string) admin.GetProjectServiceAccountApiRequest) *ServiceAccountsApi_GetProjectServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectServiceAccountExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) GetProjectServiceAccountExecute(r admin.GetProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for GetProjectServiceAccountExecute") + } + + var r0 *admin.GroupServiceAccount + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.GetProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.GetProjectServiceAccountApiRequest) *admin.GroupServiceAccount); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.GroupServiceAccount) + } + } + + if rf, ok := ret.Get(1).(func(admin.GetProjectServiceAccountApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.GetProjectServiceAccountApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_GetProjectServiceAccountExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectServiceAccountExecute' +type ServiceAccountsApi_GetProjectServiceAccountExecute_Call struct { + *mock.Call +} + +// GetProjectServiceAccountExecute is a helper method to define mock.On call +// - r admin.GetProjectServiceAccountApiRequest +func (_e *ServiceAccountsApi_Expecter) GetProjectServiceAccountExecute(r any) *ServiceAccountsApi_GetProjectServiceAccountExecute_Call { + return &ServiceAccountsApi_GetProjectServiceAccountExecute_Call{Call: _e.mock.On("GetProjectServiceAccountExecute", r)} +} + +func (_c *ServiceAccountsApi_GetProjectServiceAccountExecute_Call) Run(run func(r admin.GetProjectServiceAccountApiRequest)) *ServiceAccountsApi_GetProjectServiceAccountExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.GetProjectServiceAccountApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_GetProjectServiceAccountExecute_Call) Return(_a0 *admin.GroupServiceAccount, _a1 *http.Response, _a2 error) *ServiceAccountsApi_GetProjectServiceAccountExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_GetProjectServiceAccountExecute_Call) RunAndReturn(run func(admin.GetProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error)) *ServiceAccountsApi_GetProjectServiceAccountExecute_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectServiceAccountWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) GetProjectServiceAccountWithParams(ctx context.Context, args *admin.GetProjectServiceAccountApiParams) admin.GetProjectServiceAccountApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for GetProjectServiceAccountWithParams") + } + + var r0 admin.GetProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.GetProjectServiceAccountApiParams) admin.GetProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.GetProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_GetProjectServiceAccountWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectServiceAccountWithParams' +type ServiceAccountsApi_GetProjectServiceAccountWithParams_Call struct { + *mock.Call +} + +// GetProjectServiceAccountWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.GetProjectServiceAccountApiParams +func (_e *ServiceAccountsApi_Expecter) GetProjectServiceAccountWithParams(ctx any, args any) *ServiceAccountsApi_GetProjectServiceAccountWithParams_Call { + return &ServiceAccountsApi_GetProjectServiceAccountWithParams_Call{Call: _e.mock.On("GetProjectServiceAccountWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_GetProjectServiceAccountWithParams_Call) Run(run func(ctx context.Context, args *admin.GetProjectServiceAccountApiParams)) *ServiceAccountsApi_GetProjectServiceAccountWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.GetProjectServiceAccountApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_GetProjectServiceAccountWithParams_Call) Return(_a0 admin.GetProjectServiceAccountApiRequest) *ServiceAccountsApi_GetProjectServiceAccountWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_GetProjectServiceAccountWithParams_Call) RunAndReturn(run func(context.Context, *admin.GetProjectServiceAccountApiParams) admin.GetProjectServiceAccountApiRequest) *ServiceAccountsApi_GetProjectServiceAccountWithParams_Call { + _c.Call.Return(run) + return _c +} + +// GetServiceAccount provides a mock function with given fields: ctx, orgId, clientId +func (_m *ServiceAccountsApi) GetServiceAccount(ctx context.Context, orgId string, clientId string) admin.GetServiceAccountApiRequest { + ret := _m.Called(ctx, orgId, clientId) + + if len(ret) == 0 { + panic("no return value specified for GetServiceAccount") + } + + var r0 admin.GetServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.GetServiceAccountApiRequest); ok { + r0 = rf(ctx, orgId, clientId) + } else { + r0 = ret.Get(0).(admin.GetServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_GetServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetServiceAccount' +type ServiceAccountsApi_GetServiceAccount_Call struct { + *mock.Call +} + +// GetServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - clientId string +func (_e *ServiceAccountsApi_Expecter) GetServiceAccount(ctx any, orgId any, clientId any) *ServiceAccountsApi_GetServiceAccount_Call { + return &ServiceAccountsApi_GetServiceAccount_Call{Call: _e.mock.On("GetServiceAccount", ctx, orgId, clientId)} +} + +func (_c *ServiceAccountsApi_GetServiceAccount_Call) Run(run func(ctx context.Context, orgId string, clientId string)) *ServiceAccountsApi_GetServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_GetServiceAccount_Call) Return(_a0 admin.GetServiceAccountApiRequest) *ServiceAccountsApi_GetServiceAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_GetServiceAccount_Call) RunAndReturn(run func(context.Context, string, string) admin.GetServiceAccountApiRequest) *ServiceAccountsApi_GetServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// GetServiceAccountExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) GetServiceAccountExecute(r admin.GetServiceAccountApiRequest) (*admin.OrgServiceAccount, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for GetServiceAccountExecute") + } + + var r0 *admin.OrgServiceAccount + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.GetServiceAccountApiRequest) (*admin.OrgServiceAccount, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.GetServiceAccountApiRequest) *admin.OrgServiceAccount); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.OrgServiceAccount) + } + } + + if rf, ok := ret.Get(1).(func(admin.GetServiceAccountApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.GetServiceAccountApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_GetServiceAccountExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetServiceAccountExecute' +type ServiceAccountsApi_GetServiceAccountExecute_Call struct { + *mock.Call +} + +// GetServiceAccountExecute is a helper method to define mock.On call +// - r admin.GetServiceAccountApiRequest +func (_e *ServiceAccountsApi_Expecter) GetServiceAccountExecute(r any) *ServiceAccountsApi_GetServiceAccountExecute_Call { + return &ServiceAccountsApi_GetServiceAccountExecute_Call{Call: _e.mock.On("GetServiceAccountExecute", r)} +} + +func (_c *ServiceAccountsApi_GetServiceAccountExecute_Call) Run(run func(r admin.GetServiceAccountApiRequest)) *ServiceAccountsApi_GetServiceAccountExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.GetServiceAccountApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_GetServiceAccountExecute_Call) Return(_a0 *admin.OrgServiceAccount, _a1 *http.Response, _a2 error) *ServiceAccountsApi_GetServiceAccountExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_GetServiceAccountExecute_Call) RunAndReturn(run func(admin.GetServiceAccountApiRequest) (*admin.OrgServiceAccount, *http.Response, error)) *ServiceAccountsApi_GetServiceAccountExecute_Call { + _c.Call.Return(run) + return _c +} + +// GetServiceAccountWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) GetServiceAccountWithParams(ctx context.Context, args *admin.GetServiceAccountApiParams) admin.GetServiceAccountApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for GetServiceAccountWithParams") + } + + var r0 admin.GetServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.GetServiceAccountApiParams) admin.GetServiceAccountApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.GetServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_GetServiceAccountWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetServiceAccountWithParams' +type ServiceAccountsApi_GetServiceAccountWithParams_Call struct { + *mock.Call +} + +// GetServiceAccountWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.GetServiceAccountApiParams +func (_e *ServiceAccountsApi_Expecter) GetServiceAccountWithParams(ctx any, args any) *ServiceAccountsApi_GetServiceAccountWithParams_Call { + return &ServiceAccountsApi_GetServiceAccountWithParams_Call{Call: _e.mock.On("GetServiceAccountWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_GetServiceAccountWithParams_Call) Run(run func(ctx context.Context, args *admin.GetServiceAccountApiParams)) *ServiceAccountsApi_GetServiceAccountWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.GetServiceAccountApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_GetServiceAccountWithParams_Call) Return(_a0 admin.GetServiceAccountApiRequest) *ServiceAccountsApi_GetServiceAccountWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_GetServiceAccountWithParams_Call) RunAndReturn(run func(context.Context, *admin.GetServiceAccountApiParams) admin.GetServiceAccountApiRequest) *ServiceAccountsApi_GetServiceAccountWithParams_Call { + _c.Call.Return(run) + return _c +} + +// ListProjectServiceAccountAccessList provides a mock function with given fields: ctx, groupId, clientId +func (_m *ServiceAccountsApi) ListProjectServiceAccountAccessList(ctx context.Context, groupId string, clientId string) admin.ListProjectServiceAccountAccessListApiRequest { + ret := _m.Called(ctx, groupId, clientId) + + if len(ret) == 0 { + panic("no return value specified for ListProjectServiceAccountAccessList") + } + + var r0 admin.ListProjectServiceAccountAccessListApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.ListProjectServiceAccountAccessListApiRequest); ok { + r0 = rf(ctx, groupId, clientId) + } else { + r0 = ret.Get(0).(admin.ListProjectServiceAccountAccessListApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListProjectServiceAccountAccessList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProjectServiceAccountAccessList' +type ServiceAccountsApi_ListProjectServiceAccountAccessList_Call struct { + *mock.Call +} + +// ListProjectServiceAccountAccessList is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - clientId string +func (_e *ServiceAccountsApi_Expecter) ListProjectServiceAccountAccessList(ctx any, groupId any, clientId any) *ServiceAccountsApi_ListProjectServiceAccountAccessList_Call { + return &ServiceAccountsApi_ListProjectServiceAccountAccessList_Call{Call: _e.mock.On("ListProjectServiceAccountAccessList", ctx, groupId, clientId)} +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountAccessList_Call) Run(run func(ctx context.Context, groupId string, clientId string)) *ServiceAccountsApi_ListProjectServiceAccountAccessList_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountAccessList_Call) Return(_a0 admin.ListProjectServiceAccountAccessListApiRequest) *ServiceAccountsApi_ListProjectServiceAccountAccessList_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountAccessList_Call) RunAndReturn(run func(context.Context, string, string) admin.ListProjectServiceAccountAccessListApiRequest) *ServiceAccountsApi_ListProjectServiceAccountAccessList_Call { + _c.Call.Return(run) + return _c +} + +// ListProjectServiceAccountAccessListExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) ListProjectServiceAccountAccessListExecute(r admin.ListProjectServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for ListProjectServiceAccountAccessListExecute") + } + + var r0 *admin.PaginatedServiceAccountIPAccessEntry + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.ListProjectServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.ListProjectServiceAccountAccessListApiRequest) *admin.PaginatedServiceAccountIPAccessEntry); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PaginatedServiceAccountIPAccessEntry) + } + } + + if rf, ok := ret.Get(1).(func(admin.ListProjectServiceAccountAccessListApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.ListProjectServiceAccountAccessListApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProjectServiceAccountAccessListExecute' +type ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call struct { + *mock.Call +} + +// ListProjectServiceAccountAccessListExecute is a helper method to define mock.On call +// - r admin.ListProjectServiceAccountAccessListApiRequest +func (_e *ServiceAccountsApi_Expecter) ListProjectServiceAccountAccessListExecute(r any) *ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call { + return &ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call{Call: _e.mock.On("ListProjectServiceAccountAccessListExecute", r)} +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call) Run(run func(r admin.ListProjectServiceAccountAccessListApiRequest)) *ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.ListProjectServiceAccountAccessListApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call) Return(_a0 *admin.PaginatedServiceAccountIPAccessEntry, _a1 *http.Response, _a2 error) *ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call) RunAndReturn(run func(admin.ListProjectServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error)) *ServiceAccountsApi_ListProjectServiceAccountAccessListExecute_Call { + _c.Call.Return(run) + return _c +} + +// ListProjectServiceAccountAccessListWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) ListProjectServiceAccountAccessListWithParams(ctx context.Context, args *admin.ListProjectServiceAccountAccessListApiParams) admin.ListProjectServiceAccountAccessListApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for ListProjectServiceAccountAccessListWithParams") + } + + var r0 admin.ListProjectServiceAccountAccessListApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.ListProjectServiceAccountAccessListApiParams) admin.ListProjectServiceAccountAccessListApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.ListProjectServiceAccountAccessListApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProjectServiceAccountAccessListWithParams' +type ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call struct { + *mock.Call +} + +// ListProjectServiceAccountAccessListWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.ListProjectServiceAccountAccessListApiParams +func (_e *ServiceAccountsApi_Expecter) ListProjectServiceAccountAccessListWithParams(ctx any, args any) *ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call { + return &ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call{Call: _e.mock.On("ListProjectServiceAccountAccessListWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call) Run(run func(ctx context.Context, args *admin.ListProjectServiceAccountAccessListApiParams)) *ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.ListProjectServiceAccountAccessListApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call) Return(_a0 admin.ListProjectServiceAccountAccessListApiRequest) *ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call) RunAndReturn(run func(context.Context, *admin.ListProjectServiceAccountAccessListApiParams) admin.ListProjectServiceAccountAccessListApiRequest) *ServiceAccountsApi_ListProjectServiceAccountAccessListWithParams_Call { + _c.Call.Return(run) + return _c +} + +// ListProjectServiceAccounts provides a mock function with given fields: ctx, groupId +func (_m *ServiceAccountsApi) ListProjectServiceAccounts(ctx context.Context, groupId string) admin.ListProjectServiceAccountsApiRequest { + ret := _m.Called(ctx, groupId) + + if len(ret) == 0 { + panic("no return value specified for ListProjectServiceAccounts") + } + + var r0 admin.ListProjectServiceAccountsApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string) admin.ListProjectServiceAccountsApiRequest); ok { + r0 = rf(ctx, groupId) + } else { + r0 = ret.Get(0).(admin.ListProjectServiceAccountsApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListProjectServiceAccounts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProjectServiceAccounts' +type ServiceAccountsApi_ListProjectServiceAccounts_Call struct { + *mock.Call +} + +// ListProjectServiceAccounts is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +func (_e *ServiceAccountsApi_Expecter) ListProjectServiceAccounts(ctx any, groupId any) *ServiceAccountsApi_ListProjectServiceAccounts_Call { + return &ServiceAccountsApi_ListProjectServiceAccounts_Call{Call: _e.mock.On("ListProjectServiceAccounts", ctx, groupId)} +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccounts_Call) Run(run func(ctx context.Context, groupId string)) *ServiceAccountsApi_ListProjectServiceAccounts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccounts_Call) Return(_a0 admin.ListProjectServiceAccountsApiRequest) *ServiceAccountsApi_ListProjectServiceAccounts_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccounts_Call) RunAndReturn(run func(context.Context, string) admin.ListProjectServiceAccountsApiRequest) *ServiceAccountsApi_ListProjectServiceAccounts_Call { + _c.Call.Return(run) + return _c +} + +// ListProjectServiceAccountsExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) ListProjectServiceAccountsExecute(r admin.ListProjectServiceAccountsApiRequest) (*admin.PaginatedGroupServiceAccounts, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for ListProjectServiceAccountsExecute") + } + + var r0 *admin.PaginatedGroupServiceAccounts + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.ListProjectServiceAccountsApiRequest) (*admin.PaginatedGroupServiceAccounts, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.ListProjectServiceAccountsApiRequest) *admin.PaginatedGroupServiceAccounts); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PaginatedGroupServiceAccounts) + } + } + + if rf, ok := ret.Get(1).(func(admin.ListProjectServiceAccountsApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.ListProjectServiceAccountsApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_ListProjectServiceAccountsExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProjectServiceAccountsExecute' +type ServiceAccountsApi_ListProjectServiceAccountsExecute_Call struct { + *mock.Call +} + +// ListProjectServiceAccountsExecute is a helper method to define mock.On call +// - r admin.ListProjectServiceAccountsApiRequest +func (_e *ServiceAccountsApi_Expecter) ListProjectServiceAccountsExecute(r any) *ServiceAccountsApi_ListProjectServiceAccountsExecute_Call { + return &ServiceAccountsApi_ListProjectServiceAccountsExecute_Call{Call: _e.mock.On("ListProjectServiceAccountsExecute", r)} +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountsExecute_Call) Run(run func(r admin.ListProjectServiceAccountsApiRequest)) *ServiceAccountsApi_ListProjectServiceAccountsExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.ListProjectServiceAccountsApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountsExecute_Call) Return(_a0 *admin.PaginatedGroupServiceAccounts, _a1 *http.Response, _a2 error) *ServiceAccountsApi_ListProjectServiceAccountsExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountsExecute_Call) RunAndReturn(run func(admin.ListProjectServiceAccountsApiRequest) (*admin.PaginatedGroupServiceAccounts, *http.Response, error)) *ServiceAccountsApi_ListProjectServiceAccountsExecute_Call { + _c.Call.Return(run) + return _c +} + +// ListProjectServiceAccountsWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) ListProjectServiceAccountsWithParams(ctx context.Context, args *admin.ListProjectServiceAccountsApiParams) admin.ListProjectServiceAccountsApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for ListProjectServiceAccountsWithParams") + } + + var r0 admin.ListProjectServiceAccountsApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.ListProjectServiceAccountsApiParams) admin.ListProjectServiceAccountsApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.ListProjectServiceAccountsApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProjectServiceAccountsWithParams' +type ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call struct { + *mock.Call +} + +// ListProjectServiceAccountsWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.ListProjectServiceAccountsApiParams +func (_e *ServiceAccountsApi_Expecter) ListProjectServiceAccountsWithParams(ctx any, args any) *ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call { + return &ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call{Call: _e.mock.On("ListProjectServiceAccountsWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call) Run(run func(ctx context.Context, args *admin.ListProjectServiceAccountsApiParams)) *ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.ListProjectServiceAccountsApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call) Return(_a0 admin.ListProjectServiceAccountsApiRequest) *ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call) RunAndReturn(run func(context.Context, *admin.ListProjectServiceAccountsApiParams) admin.ListProjectServiceAccountsApiRequest) *ServiceAccountsApi_ListProjectServiceAccountsWithParams_Call { + _c.Call.Return(run) + return _c +} + +// ListServiceAccountAccessList provides a mock function with given fields: ctx, orgId, clientId +func (_m *ServiceAccountsApi) ListServiceAccountAccessList(ctx context.Context, orgId string, clientId string) admin.ListServiceAccountAccessListApiRequest { + ret := _m.Called(ctx, orgId, clientId) + + if len(ret) == 0 { + panic("no return value specified for ListServiceAccountAccessList") + } + + var r0 admin.ListServiceAccountAccessListApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.ListServiceAccountAccessListApiRequest); ok { + r0 = rf(ctx, orgId, clientId) + } else { + r0 = ret.Get(0).(admin.ListServiceAccountAccessListApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListServiceAccountAccessList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceAccountAccessList' +type ServiceAccountsApi_ListServiceAccountAccessList_Call struct { + *mock.Call +} + +// ListServiceAccountAccessList is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - clientId string +func (_e *ServiceAccountsApi_Expecter) ListServiceAccountAccessList(ctx any, orgId any, clientId any) *ServiceAccountsApi_ListServiceAccountAccessList_Call { + return &ServiceAccountsApi_ListServiceAccountAccessList_Call{Call: _e.mock.On("ListServiceAccountAccessList", ctx, orgId, clientId)} +} + +func (_c *ServiceAccountsApi_ListServiceAccountAccessList_Call) Run(run func(ctx context.Context, orgId string, clientId string)) *ServiceAccountsApi_ListServiceAccountAccessList_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountAccessList_Call) Return(_a0 admin.ListServiceAccountAccessListApiRequest) *ServiceAccountsApi_ListServiceAccountAccessList_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountAccessList_Call) RunAndReturn(run func(context.Context, string, string) admin.ListServiceAccountAccessListApiRequest) *ServiceAccountsApi_ListServiceAccountAccessList_Call { + _c.Call.Return(run) + return _c +} + +// ListServiceAccountAccessListExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) ListServiceAccountAccessListExecute(r admin.ListServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for ListServiceAccountAccessListExecute") + } + + var r0 *admin.PaginatedServiceAccountIPAccessEntry + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.ListServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.ListServiceAccountAccessListApiRequest) *admin.PaginatedServiceAccountIPAccessEntry); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PaginatedServiceAccountIPAccessEntry) + } + } + + if rf, ok := ret.Get(1).(func(admin.ListServiceAccountAccessListApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.ListServiceAccountAccessListApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_ListServiceAccountAccessListExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceAccountAccessListExecute' +type ServiceAccountsApi_ListServiceAccountAccessListExecute_Call struct { + *mock.Call +} + +// ListServiceAccountAccessListExecute is a helper method to define mock.On call +// - r admin.ListServiceAccountAccessListApiRequest +func (_e *ServiceAccountsApi_Expecter) ListServiceAccountAccessListExecute(r any) *ServiceAccountsApi_ListServiceAccountAccessListExecute_Call { + return &ServiceAccountsApi_ListServiceAccountAccessListExecute_Call{Call: _e.mock.On("ListServiceAccountAccessListExecute", r)} +} + +func (_c *ServiceAccountsApi_ListServiceAccountAccessListExecute_Call) Run(run func(r admin.ListServiceAccountAccessListApiRequest)) *ServiceAccountsApi_ListServiceAccountAccessListExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.ListServiceAccountAccessListApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountAccessListExecute_Call) Return(_a0 *admin.PaginatedServiceAccountIPAccessEntry, _a1 *http.Response, _a2 error) *ServiceAccountsApi_ListServiceAccountAccessListExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountAccessListExecute_Call) RunAndReturn(run func(admin.ListServiceAccountAccessListApiRequest) (*admin.PaginatedServiceAccountIPAccessEntry, *http.Response, error)) *ServiceAccountsApi_ListServiceAccountAccessListExecute_Call { + _c.Call.Return(run) + return _c +} + +// ListServiceAccountAccessListWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) ListServiceAccountAccessListWithParams(ctx context.Context, args *admin.ListServiceAccountAccessListApiParams) admin.ListServiceAccountAccessListApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for ListServiceAccountAccessListWithParams") + } + + var r0 admin.ListServiceAccountAccessListApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.ListServiceAccountAccessListApiParams) admin.ListServiceAccountAccessListApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.ListServiceAccountAccessListApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceAccountAccessListWithParams' +type ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call struct { + *mock.Call +} + +// ListServiceAccountAccessListWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.ListServiceAccountAccessListApiParams +func (_e *ServiceAccountsApi_Expecter) ListServiceAccountAccessListWithParams(ctx any, args any) *ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call { + return &ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call{Call: _e.mock.On("ListServiceAccountAccessListWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call) Run(run func(ctx context.Context, args *admin.ListServiceAccountAccessListApiParams)) *ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.ListServiceAccountAccessListApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call) Return(_a0 admin.ListServiceAccountAccessListApiRequest) *ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call) RunAndReturn(run func(context.Context, *admin.ListServiceAccountAccessListApiParams) admin.ListServiceAccountAccessListApiRequest) *ServiceAccountsApi_ListServiceAccountAccessListWithParams_Call { + _c.Call.Return(run) + return _c +} + +// ListServiceAccountProjects provides a mock function with given fields: ctx, orgId, clientId +func (_m *ServiceAccountsApi) ListServiceAccountProjects(ctx context.Context, orgId string, clientId string) admin.ListServiceAccountProjectsApiRequest { + ret := _m.Called(ctx, orgId, clientId) + + if len(ret) == 0 { + panic("no return value specified for ListServiceAccountProjects") + } + + var r0 admin.ListServiceAccountProjectsApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.ListServiceAccountProjectsApiRequest); ok { + r0 = rf(ctx, orgId, clientId) + } else { + r0 = ret.Get(0).(admin.ListServiceAccountProjectsApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListServiceAccountProjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceAccountProjects' +type ServiceAccountsApi_ListServiceAccountProjects_Call struct { + *mock.Call +} + +// ListServiceAccountProjects is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - clientId string +func (_e *ServiceAccountsApi_Expecter) ListServiceAccountProjects(ctx any, orgId any, clientId any) *ServiceAccountsApi_ListServiceAccountProjects_Call { + return &ServiceAccountsApi_ListServiceAccountProjects_Call{Call: _e.mock.On("ListServiceAccountProjects", ctx, orgId, clientId)} +} + +func (_c *ServiceAccountsApi_ListServiceAccountProjects_Call) Run(run func(ctx context.Context, orgId string, clientId string)) *ServiceAccountsApi_ListServiceAccountProjects_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountProjects_Call) Return(_a0 admin.ListServiceAccountProjectsApiRequest) *ServiceAccountsApi_ListServiceAccountProjects_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountProjects_Call) RunAndReturn(run func(context.Context, string, string) admin.ListServiceAccountProjectsApiRequest) *ServiceAccountsApi_ListServiceAccountProjects_Call { + _c.Call.Return(run) + return _c +} + +// ListServiceAccountProjectsExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) ListServiceAccountProjectsExecute(r admin.ListServiceAccountProjectsApiRequest) (*admin.PaginatedServiceAccountGroup, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for ListServiceAccountProjectsExecute") + } + + var r0 *admin.PaginatedServiceAccountGroup + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.ListServiceAccountProjectsApiRequest) (*admin.PaginatedServiceAccountGroup, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.ListServiceAccountProjectsApiRequest) *admin.PaginatedServiceAccountGroup); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PaginatedServiceAccountGroup) + } + } + + if rf, ok := ret.Get(1).(func(admin.ListServiceAccountProjectsApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.ListServiceAccountProjectsApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_ListServiceAccountProjectsExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceAccountProjectsExecute' +type ServiceAccountsApi_ListServiceAccountProjectsExecute_Call struct { + *mock.Call +} + +// ListServiceAccountProjectsExecute is a helper method to define mock.On call +// - r admin.ListServiceAccountProjectsApiRequest +func (_e *ServiceAccountsApi_Expecter) ListServiceAccountProjectsExecute(r any) *ServiceAccountsApi_ListServiceAccountProjectsExecute_Call { + return &ServiceAccountsApi_ListServiceAccountProjectsExecute_Call{Call: _e.mock.On("ListServiceAccountProjectsExecute", r)} +} + +func (_c *ServiceAccountsApi_ListServiceAccountProjectsExecute_Call) Run(run func(r admin.ListServiceAccountProjectsApiRequest)) *ServiceAccountsApi_ListServiceAccountProjectsExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.ListServiceAccountProjectsApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountProjectsExecute_Call) Return(_a0 *admin.PaginatedServiceAccountGroup, _a1 *http.Response, _a2 error) *ServiceAccountsApi_ListServiceAccountProjectsExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountProjectsExecute_Call) RunAndReturn(run func(admin.ListServiceAccountProjectsApiRequest) (*admin.PaginatedServiceAccountGroup, *http.Response, error)) *ServiceAccountsApi_ListServiceAccountProjectsExecute_Call { + _c.Call.Return(run) + return _c +} + +// ListServiceAccountProjectsWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) ListServiceAccountProjectsWithParams(ctx context.Context, args *admin.ListServiceAccountProjectsApiParams) admin.ListServiceAccountProjectsApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for ListServiceAccountProjectsWithParams") + } + + var r0 admin.ListServiceAccountProjectsApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.ListServiceAccountProjectsApiParams) admin.ListServiceAccountProjectsApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.ListServiceAccountProjectsApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceAccountProjectsWithParams' +type ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call struct { + *mock.Call +} + +// ListServiceAccountProjectsWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.ListServiceAccountProjectsApiParams +func (_e *ServiceAccountsApi_Expecter) ListServiceAccountProjectsWithParams(ctx any, args any) *ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call { + return &ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call{Call: _e.mock.On("ListServiceAccountProjectsWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call) Run(run func(ctx context.Context, args *admin.ListServiceAccountProjectsApiParams)) *ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.ListServiceAccountProjectsApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call) Return(_a0 admin.ListServiceAccountProjectsApiRequest) *ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call) RunAndReturn(run func(context.Context, *admin.ListServiceAccountProjectsApiParams) admin.ListServiceAccountProjectsApiRequest) *ServiceAccountsApi_ListServiceAccountProjectsWithParams_Call { + _c.Call.Return(run) + return _c +} + +// ListServiceAccounts provides a mock function with given fields: ctx, orgId +func (_m *ServiceAccountsApi) ListServiceAccounts(ctx context.Context, orgId string) admin.ListServiceAccountsApiRequest { + ret := _m.Called(ctx, orgId) + + if len(ret) == 0 { + panic("no return value specified for ListServiceAccounts") + } + + var r0 admin.ListServiceAccountsApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string) admin.ListServiceAccountsApiRequest); ok { + r0 = rf(ctx, orgId) + } else { + r0 = ret.Get(0).(admin.ListServiceAccountsApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListServiceAccounts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceAccounts' +type ServiceAccountsApi_ListServiceAccounts_Call struct { + *mock.Call +} + +// ListServiceAccounts is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +func (_e *ServiceAccountsApi_Expecter) ListServiceAccounts(ctx any, orgId any) *ServiceAccountsApi_ListServiceAccounts_Call { + return &ServiceAccountsApi_ListServiceAccounts_Call{Call: _e.mock.On("ListServiceAccounts", ctx, orgId)} +} + +func (_c *ServiceAccountsApi_ListServiceAccounts_Call) Run(run func(ctx context.Context, orgId string)) *ServiceAccountsApi_ListServiceAccounts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccounts_Call) Return(_a0 admin.ListServiceAccountsApiRequest) *ServiceAccountsApi_ListServiceAccounts_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccounts_Call) RunAndReturn(run func(context.Context, string) admin.ListServiceAccountsApiRequest) *ServiceAccountsApi_ListServiceAccounts_Call { + _c.Call.Return(run) + return _c +} + +// ListServiceAccountsExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) ListServiceAccountsExecute(r admin.ListServiceAccountsApiRequest) (*admin.PaginatedOrgServiceAccounts, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for ListServiceAccountsExecute") + } + + var r0 *admin.PaginatedOrgServiceAccounts + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.ListServiceAccountsApiRequest) (*admin.PaginatedOrgServiceAccounts, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.ListServiceAccountsApiRequest) *admin.PaginatedOrgServiceAccounts); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PaginatedOrgServiceAccounts) + } + } + + if rf, ok := ret.Get(1).(func(admin.ListServiceAccountsApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.ListServiceAccountsApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_ListServiceAccountsExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceAccountsExecute' +type ServiceAccountsApi_ListServiceAccountsExecute_Call struct { + *mock.Call +} + +// ListServiceAccountsExecute is a helper method to define mock.On call +// - r admin.ListServiceAccountsApiRequest +func (_e *ServiceAccountsApi_Expecter) ListServiceAccountsExecute(r any) *ServiceAccountsApi_ListServiceAccountsExecute_Call { + return &ServiceAccountsApi_ListServiceAccountsExecute_Call{Call: _e.mock.On("ListServiceAccountsExecute", r)} +} + +func (_c *ServiceAccountsApi_ListServiceAccountsExecute_Call) Run(run func(r admin.ListServiceAccountsApiRequest)) *ServiceAccountsApi_ListServiceAccountsExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.ListServiceAccountsApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountsExecute_Call) Return(_a0 *admin.PaginatedOrgServiceAccounts, _a1 *http.Response, _a2 error) *ServiceAccountsApi_ListServiceAccountsExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountsExecute_Call) RunAndReturn(run func(admin.ListServiceAccountsApiRequest) (*admin.PaginatedOrgServiceAccounts, *http.Response, error)) *ServiceAccountsApi_ListServiceAccountsExecute_Call { + _c.Call.Return(run) + return _c +} + +// ListServiceAccountsWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) ListServiceAccountsWithParams(ctx context.Context, args *admin.ListServiceAccountsApiParams) admin.ListServiceAccountsApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for ListServiceAccountsWithParams") + } + + var r0 admin.ListServiceAccountsApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.ListServiceAccountsApiParams) admin.ListServiceAccountsApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.ListServiceAccountsApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_ListServiceAccountsWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListServiceAccountsWithParams' +type ServiceAccountsApi_ListServiceAccountsWithParams_Call struct { + *mock.Call +} + +// ListServiceAccountsWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.ListServiceAccountsApiParams +func (_e *ServiceAccountsApi_Expecter) ListServiceAccountsWithParams(ctx any, args any) *ServiceAccountsApi_ListServiceAccountsWithParams_Call { + return &ServiceAccountsApi_ListServiceAccountsWithParams_Call{Call: _e.mock.On("ListServiceAccountsWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_ListServiceAccountsWithParams_Call) Run(run func(ctx context.Context, args *admin.ListServiceAccountsApiParams)) *ServiceAccountsApi_ListServiceAccountsWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.ListServiceAccountsApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountsWithParams_Call) Return(_a0 admin.ListServiceAccountsApiRequest) *ServiceAccountsApi_ListServiceAccountsWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_ListServiceAccountsWithParams_Call) RunAndReturn(run func(context.Context, *admin.ListServiceAccountsApiParams) admin.ListServiceAccountsApiRequest) *ServiceAccountsApi_ListServiceAccountsWithParams_Call { + _c.Call.Return(run) + return _c +} + +// UpdateProjectServiceAccount provides a mock function with given fields: ctx, clientId, groupId, groupServiceAccountUpdateRequest +func (_m *ServiceAccountsApi) UpdateProjectServiceAccount(ctx context.Context, clientId string, groupId string, groupServiceAccountUpdateRequest *admin.GroupServiceAccountUpdateRequest) admin.UpdateProjectServiceAccountApiRequest { + ret := _m.Called(ctx, clientId, groupId, groupServiceAccountUpdateRequest) + + if len(ret) == 0 { + panic("no return value specified for UpdateProjectServiceAccount") + } + + var r0 admin.UpdateProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.GroupServiceAccountUpdateRequest) admin.UpdateProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, clientId, groupId, groupServiceAccountUpdateRequest) + } else { + r0 = ret.Get(0).(admin.UpdateProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_UpdateProjectServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateProjectServiceAccount' +type ServiceAccountsApi_UpdateProjectServiceAccount_Call struct { + *mock.Call +} + +// UpdateProjectServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - clientId string +// - groupId string +// - groupServiceAccountUpdateRequest *admin.GroupServiceAccountUpdateRequest +func (_e *ServiceAccountsApi_Expecter) UpdateProjectServiceAccount(ctx any, clientId any, groupId any, groupServiceAccountUpdateRequest any) *ServiceAccountsApi_UpdateProjectServiceAccount_Call { + return &ServiceAccountsApi_UpdateProjectServiceAccount_Call{Call: _e.mock.On("UpdateProjectServiceAccount", ctx, clientId, groupId, groupServiceAccountUpdateRequest)} +} + +func (_c *ServiceAccountsApi_UpdateProjectServiceAccount_Call) Run(run func(ctx context.Context, clientId string, groupId string, groupServiceAccountUpdateRequest *admin.GroupServiceAccountUpdateRequest)) *ServiceAccountsApi_UpdateProjectServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.GroupServiceAccountUpdateRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_UpdateProjectServiceAccount_Call) Return(_a0 admin.UpdateProjectServiceAccountApiRequest) *ServiceAccountsApi_UpdateProjectServiceAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_UpdateProjectServiceAccount_Call) RunAndReturn(run func(context.Context, string, string, *admin.GroupServiceAccountUpdateRequest) admin.UpdateProjectServiceAccountApiRequest) *ServiceAccountsApi_UpdateProjectServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// UpdateProjectServiceAccountExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) UpdateProjectServiceAccountExecute(r admin.UpdateProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for UpdateProjectServiceAccountExecute") + } + + var r0 *admin.GroupServiceAccount + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.UpdateProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.UpdateProjectServiceAccountApiRequest) *admin.GroupServiceAccount); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.GroupServiceAccount) + } + } + + if rf, ok := ret.Get(1).(func(admin.UpdateProjectServiceAccountApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.UpdateProjectServiceAccountApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateProjectServiceAccountExecute' +type ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call struct { + *mock.Call +} + +// UpdateProjectServiceAccountExecute is a helper method to define mock.On call +// - r admin.UpdateProjectServiceAccountApiRequest +func (_e *ServiceAccountsApi_Expecter) UpdateProjectServiceAccountExecute(r any) *ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call { + return &ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call{Call: _e.mock.On("UpdateProjectServiceAccountExecute", r)} +} + +func (_c *ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call) Run(run func(r admin.UpdateProjectServiceAccountApiRequest)) *ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.UpdateProjectServiceAccountApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call) Return(_a0 *admin.GroupServiceAccount, _a1 *http.Response, _a2 error) *ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call) RunAndReturn(run func(admin.UpdateProjectServiceAccountApiRequest) (*admin.GroupServiceAccount, *http.Response, error)) *ServiceAccountsApi_UpdateProjectServiceAccountExecute_Call { + _c.Call.Return(run) + return _c +} + +// UpdateProjectServiceAccountWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) UpdateProjectServiceAccountWithParams(ctx context.Context, args *admin.UpdateProjectServiceAccountApiParams) admin.UpdateProjectServiceAccountApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for UpdateProjectServiceAccountWithParams") + } + + var r0 admin.UpdateProjectServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.UpdateProjectServiceAccountApiParams) admin.UpdateProjectServiceAccountApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.UpdateProjectServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateProjectServiceAccountWithParams' +type ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call struct { + *mock.Call +} + +// UpdateProjectServiceAccountWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.UpdateProjectServiceAccountApiParams +func (_e *ServiceAccountsApi_Expecter) UpdateProjectServiceAccountWithParams(ctx any, args any) *ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call { + return &ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call{Call: _e.mock.On("UpdateProjectServiceAccountWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call) Run(run func(ctx context.Context, args *admin.UpdateProjectServiceAccountApiParams)) *ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.UpdateProjectServiceAccountApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call) Return(_a0 admin.UpdateProjectServiceAccountApiRequest) *ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call) RunAndReturn(run func(context.Context, *admin.UpdateProjectServiceAccountApiParams) admin.UpdateProjectServiceAccountApiRequest) *ServiceAccountsApi_UpdateProjectServiceAccountWithParams_Call { + _c.Call.Return(run) + return _c +} + +// UpdateServiceAccount provides a mock function with given fields: ctx, clientId, orgId, orgServiceAccountUpdateRequest +func (_m *ServiceAccountsApi) UpdateServiceAccount(ctx context.Context, clientId string, orgId string, orgServiceAccountUpdateRequest *admin.OrgServiceAccountUpdateRequest) admin.UpdateServiceAccountApiRequest { + ret := _m.Called(ctx, clientId, orgId, orgServiceAccountUpdateRequest) + + if len(ret) == 0 { + panic("no return value specified for UpdateServiceAccount") + } + + var r0 admin.UpdateServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.OrgServiceAccountUpdateRequest) admin.UpdateServiceAccountApiRequest); ok { + r0 = rf(ctx, clientId, orgId, orgServiceAccountUpdateRequest) + } else { + r0 = ret.Get(0).(admin.UpdateServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_UpdateServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateServiceAccount' +type ServiceAccountsApi_UpdateServiceAccount_Call struct { + *mock.Call +} + +// UpdateServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - clientId string +// - orgId string +// - orgServiceAccountUpdateRequest *admin.OrgServiceAccountUpdateRequest +func (_e *ServiceAccountsApi_Expecter) UpdateServiceAccount(ctx any, clientId any, orgId any, orgServiceAccountUpdateRequest any) *ServiceAccountsApi_UpdateServiceAccount_Call { + return &ServiceAccountsApi_UpdateServiceAccount_Call{Call: _e.mock.On("UpdateServiceAccount", ctx, clientId, orgId, orgServiceAccountUpdateRequest)} +} + +func (_c *ServiceAccountsApi_UpdateServiceAccount_Call) Run(run func(ctx context.Context, clientId string, orgId string, orgServiceAccountUpdateRequest *admin.OrgServiceAccountUpdateRequest)) *ServiceAccountsApi_UpdateServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.OrgServiceAccountUpdateRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_UpdateServiceAccount_Call) Return(_a0 admin.UpdateServiceAccountApiRequest) *ServiceAccountsApi_UpdateServiceAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_UpdateServiceAccount_Call) RunAndReturn(run func(context.Context, string, string, *admin.OrgServiceAccountUpdateRequest) admin.UpdateServiceAccountApiRequest) *ServiceAccountsApi_UpdateServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// UpdateServiceAccountExecute provides a mock function with given fields: r +func (_m *ServiceAccountsApi) UpdateServiceAccountExecute(r admin.UpdateServiceAccountApiRequest) (*admin.OrgServiceAccount, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for UpdateServiceAccountExecute") + } + + var r0 *admin.OrgServiceAccount + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.UpdateServiceAccountApiRequest) (*admin.OrgServiceAccount, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.UpdateServiceAccountApiRequest) *admin.OrgServiceAccount); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.OrgServiceAccount) + } + } + + if rf, ok := ret.Get(1).(func(admin.UpdateServiceAccountApiRequest) *http.Response); ok { + r1 = rf(r) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.UpdateServiceAccountApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// ServiceAccountsApi_UpdateServiceAccountExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateServiceAccountExecute' +type ServiceAccountsApi_UpdateServiceAccountExecute_Call struct { + *mock.Call +} + +// UpdateServiceAccountExecute is a helper method to define mock.On call +// - r admin.UpdateServiceAccountApiRequest +func (_e *ServiceAccountsApi_Expecter) UpdateServiceAccountExecute(r any) *ServiceAccountsApi_UpdateServiceAccountExecute_Call { + return &ServiceAccountsApi_UpdateServiceAccountExecute_Call{Call: _e.mock.On("UpdateServiceAccountExecute", r)} +} + +func (_c *ServiceAccountsApi_UpdateServiceAccountExecute_Call) Run(run func(r admin.UpdateServiceAccountApiRequest)) *ServiceAccountsApi_UpdateServiceAccountExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.UpdateServiceAccountApiRequest)) + }) + return _c +} + +func (_c *ServiceAccountsApi_UpdateServiceAccountExecute_Call) Return(_a0 *admin.OrgServiceAccount, _a1 *http.Response, _a2 error) *ServiceAccountsApi_UpdateServiceAccountExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *ServiceAccountsApi_UpdateServiceAccountExecute_Call) RunAndReturn(run func(admin.UpdateServiceAccountApiRequest) (*admin.OrgServiceAccount, *http.Response, error)) *ServiceAccountsApi_UpdateServiceAccountExecute_Call { + _c.Call.Return(run) + return _c +} + +// UpdateServiceAccountWithParams provides a mock function with given fields: ctx, args +func (_m *ServiceAccountsApi) UpdateServiceAccountWithParams(ctx context.Context, args *admin.UpdateServiceAccountApiParams) admin.UpdateServiceAccountApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for UpdateServiceAccountWithParams") + } + + var r0 admin.UpdateServiceAccountApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.UpdateServiceAccountApiParams) admin.UpdateServiceAccountApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.UpdateServiceAccountApiRequest) + } + + return r0 +} + +// ServiceAccountsApi_UpdateServiceAccountWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateServiceAccountWithParams' +type ServiceAccountsApi_UpdateServiceAccountWithParams_Call struct { + *mock.Call +} + +// UpdateServiceAccountWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.UpdateServiceAccountApiParams +func (_e *ServiceAccountsApi_Expecter) UpdateServiceAccountWithParams(ctx any, args any) *ServiceAccountsApi_UpdateServiceAccountWithParams_Call { + return &ServiceAccountsApi_UpdateServiceAccountWithParams_Call{Call: _e.mock.On("UpdateServiceAccountWithParams", ctx, args)} +} + +func (_c *ServiceAccountsApi_UpdateServiceAccountWithParams_Call) Run(run func(ctx context.Context, args *admin.UpdateServiceAccountApiParams)) *ServiceAccountsApi_UpdateServiceAccountWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.UpdateServiceAccountApiParams)) + }) + return _c +} + +func (_c *ServiceAccountsApi_UpdateServiceAccountWithParams_Call) Return(_a0 admin.UpdateServiceAccountApiRequest) *ServiceAccountsApi_UpdateServiceAccountWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ServiceAccountsApi_UpdateServiceAccountWithParams_Call) RunAndReturn(run func(context.Context, *admin.UpdateServiceAccountApiParams) admin.UpdateServiceAccountApiRequest) *ServiceAccountsApi_UpdateServiceAccountWithParams_Call { + _c.Call.Return(run) + return _c +} + +// NewServiceAccountsApi creates a new instance of ServiceAccountsApi. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewServiceAccountsApi(t interface { + mock.TestingT + Cleanup(func()) +}) *ServiceAccountsApi { + mock := &ServiceAccountsApi{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/openapi/atlas-api-transformed.yaml b/openapi/atlas-api-transformed.yaml index e6b85e4e8..2a10ddad2 100644 --- a/openapi/atlas-api-transformed.yaml +++ b/openapi/atlas-api-transformed.yaml @@ -27,11 +27,12 @@ info: termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions title: MongoDB Atlas Administration API version: "2.0" - x-xgen-sha: 4f095c6eb3ef7a717f47646d37e76d52936f25a0 + x-xgen-sha: 86ea1c3d81a33c7436386c6c6ffd908142c8bc96 servers: - url: https://cloud.mongodb.com security: - DigestAuth: [] + - ServiceAccounts: [] tags: - description: Returns access logs for authentication attempts made to Atlas database deployments. To view database access history, you must have @@ -207,6 +208,14 @@ tags: description: Set Up a Private Endpoint for a Serverless Instance Tutorial url: https://dochub.mongodb.org/core/serverless-private-endpoint name: Serverless Private Endpoints + - description: Endpoints for managing Service Accounts and secrets. Service + Accounts are used for programmatic access to the Atlas Admin API through + the OAuth 2.0 Client Credentials flow. This feature is available as a + Preview feature. + externalDocs: + description: Get Started with the Atlas Administration API + url: https://www.mongodb.com/docs/atlas/configure-api-access/ + name: Service Accounts - description: Returns and adds restore jobs for shared-tier database deployments. name: Shared-Tier Restore Jobs - description: Returns and requests to download shared-tier database deployment snapshots. @@ -13154,6 +13163,414 @@ paths: summary: Update One Serverless Instance in One Project tags: - Serverless Instances + "/api/atlas/v2/groups/{groupId}/serviceAccounts": + get: + description: Returns all Service Accounts for the specified Project. Available + as a preview feature. + operationId: listProjectServiceAccounts + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedGroupServiceAccounts" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: List All Project Service Accounts + tags: + - Service Accounts + post: + description: Creates one Service Account for the specified Project. The Service + Account will automatically be added as an Organization Member to the + Organization that the specified Project is a part of. Available as a + preview feature. + operationId: createProjectServiceAccount + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccountRequest" + x-xgen-version: 2024-08-05 + description: Details of the new Service Account. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create and Assign one Service Account to one Project + tags: + - Service Accounts + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}": + delete: + description: Removes the specified Service Account from the specified project. + The Service Account will still be a part of the Organization it was + created in, and the credentials will remain active until expired or + manually revoked. Available as a preview feature. + operationId: deleteProjectServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/NoBody" + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + x-xgen-version: 2024-08-05 + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Unassign One Service Account from One Project + tags: + - Service Accounts + get: + description: Returns one Service Account in the specified Project. Available as + a preview feature. + operationId: getProjectServiceAccount + parameters: + - $ref: "#/components/parameters/groupId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Get one Project Service Account + tags: + - Service Accounts + patch: + description: Updates one Service Account in the specified Project. Available as + a preview feature. + operationId: updateProjectServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccountUpdateRequest" + description: The new details for the Service Account. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update one Project Service Account + tags: + - Service Accounts + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList": + get: + description: Returns all access list entries that you configured for the + specified Service Account for the project. Available as a preview + feature. + operationId: listProjectServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pageNum" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntry" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Access List entries for one Project Service Account + tags: + - Service Accounts + post: + description: Add Access List Entries for the specified Service Account for the + project. Resources require all API requests to originate from IP + addresses on the API access list. Available as a preview feature. + operationId: createProjectServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pageNum" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + type: array + items: + $ref: "#/components/schemas/ServiceAccountIPAccessListEntry" + x-xgen-version: 2024-08-05 + description: A list of access list entries to add to the access list of the + specified Service Account for the project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntry" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add Access List entries for one Project Service Account + tags: + - Service Accounts + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress}": + delete: + description: Removes the specified access list entry from the specified Service + Account for the project. You can't remove the requesting IP address from + the access list. Available as a preview feature. + operationId: deleteProjectServiceAccountAccessListEntry + parameters: + - $ref: "#/components/parameters/groupId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - description: One IP address or multiple IP addresses represented as one CIDR + block. When specifying a CIDR block with a subnet mask, such as + 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + in: path + name: ipAddress + required: true + schema: + type: string + example: 192.0.2.0%2F24 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$ + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Access List entry from one Project Service Account + tags: + - Service Accounts + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets": + post: + description: Create a secret for the specified Service Account in the specified + Project. Available as a preview feature. + operationId: createProjectServiceAccountSecret + parameters: + - $ref: "#/components/parameters/groupId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecretRequest" + description: Details for the new secret. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecret" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create one Project Service Account Secret + tags: + - Service Accounts + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId}": + delete: + description: Deletes the specified Service Account secret. Available as a + preview feature. + operationId: deleteProjectServiceAccountSecret + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - description: Unique 24-hexadecimal digit string that identifies the secret. + in: path + name: secretId + required: true + schema: + type: string + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete one Project Service Account Secret + tags: + - Service Accounts + "/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite": + post: + description: Assigns the specified Service Account to the specified Project. + Available as a preview feature. + operationId: addProjectServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + type: array + items: + $ref: "#/components/schemas/GroupServiceAccountRoleAssignment" + x-xgen-version: 2024-08-05 + description: The Project permissions for the Service Account in the specified + Project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Assign One Service Account to One Project + tags: + - Service Accounts "/api/atlas/v2/groups/{groupId}/settings": get: description: Returns details about the specified project's settings. To use this @@ -16365,6 +16782,395 @@ paths: summary: Validate one Atlas Resource Policy tags: - Resource Policies + "/api/atlas/v2/orgs/{orgId}/serviceAccounts": + get: + description: Returns all Service Accounts for the specified Organization. + Available as a preview feature. + operationId: listServiceAccounts + parameters: + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedOrgServiceAccounts" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: List All Organization Service Accounts + tags: + - Service Accounts + post: + description: Creates one Service Account for the specified Organization. + Available as a preview feature. + operationId: createServiceAccount + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccountRequest" + description: Details of the new Service Account. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccount" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create one Organization Service Account + tags: + - Service Accounts + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}": + delete: + description: Deletes the specified Service Account. Available as a preview feature. + operationId: deleteServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - $ref: "#/components/parameters/orgId" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete one Organization Service Account + tags: + - Service Accounts + get: + description: Returns the specified Service Account. Available as a preview feature. + operationId: getServiceAccount + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Get one Organization Service Account + tags: + - Service Accounts + patch: + description: Updates the specified Service Account in the specified + Organization. Available as a preview feature. + operationId: updateServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccountUpdateRequest" + description: The new details for the Service Account. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update one Organization Service Account + tags: + - Service Accounts + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList": + get: + description: Returns all access list entries that you configured for the + specified Service Account for the organization. Available as a preview + feature. + operationId: listServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntry" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Access List entries for one Organization Service Account + tags: + - Service Accounts + post: + description: Add Access List Entries for the specified Service Account for the + organization. Resources require all API requests to originate from IP + addresses on the API access list. Available as a preview feature. + operationId: createServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + type: array + items: + $ref: "#/components/schemas/ServiceAccountIPAccessListEntry" + x-xgen-version: 2024-08-05 + description: A list of access list entries to add to the access list of the + specified Service Account for the organization. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntry" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add Access List entries for one Organization Service Account + tags: + - Service Accounts + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress}": + delete: + description: Removes the specified access list entry from the specified Service + Account for the organization. You can't remove the requesting IP address + from the access list. Available as a preview feature. + operationId: deleteServiceAccountAccessListEntry + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - description: One IP address or multiple IP addresses represented as one CIDR + block. When specifying a CIDR block with a subnet mask, such as + 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + in: path + name: ipAddress + required: true + schema: + type: string + example: 192.0.2.0%2F24 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$ + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Access List entry from one Organization Service Account + tags: + - Service Accounts + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups": + get: + description: Returns a list of all projects the specified Service Account is a + part of. Available as a preview feature. + operationId: listServiceAccountProjects + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountGroup" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Service Account Project assignments + tags: + - Service Accounts + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets": + post: + description: Create a secret for the specified Service Account. Available as a + preview feature. + operationId: createServiceAccountSecret + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecretRequest" + description: Details for the new secret. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecret" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create one Organization Service Account Secret + tags: + - Service Accounts + "/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId}": + delete: + description: Deletes the specified Service Account secret. Available as a + preview feature. + operationId: deleteServiceAccountSecret + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + - description: Unique 24-hexadecimal digit string that identifies the secret. + in: path + name: secretId + required: true + schema: + type: string + - $ref: "#/components/parameters/orgId" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete a Organization Service Account Secret + tags: + - Service Accounts "/api/atlas/v2/orgs/{orgId}/settings": get: description: Returns details about the specified organization's settings. To use @@ -26545,6 +27351,103 @@ components: readOnly: true readOnly: true title: Group Service IP Addresses + GroupServiceAccount: + type: object + properties: + clientId: + type: string + description: The Client ID of the Service Account. + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + createdAt: + type: string + format: date-time + description: The date that the Service Account was created on. + description: + type: string + description: Human readable description for the Service Account. + name: + type: string + description: Human-readable name for the Service Account. + roles: + type: array + description: A list of Project roles associated with the Service Account. + items: + type: string + description: Project roles available for Service Accounts. + uniqueItems: true + secrets: + type: array + description: A list of secrets associated with the specified Service Account. + items: + $ref: "#/components/schemas/ServiceAccountSecret" + uniqueItems: true + GroupServiceAccountRequest: + type: object + properties: + description: + type: string + description: Human readable description for the Service Account. + maxLength: 250 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + name: + type: string + description: Human-readable name for the Service Account. The name is modifiable + and does not have to be unique. + maxLength: 64 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + roles: + type: array + description: A list of project-level roles for the Service Account. + items: + type: string + description: Project roles available for Service Accounts. + secretExpiresAfterHours: + type: integer + format: int32 + description: The expiration time of the new Service Account secret. The + expiration is provided in hours. + required: + - description + - name + - roles + - secretExpiresAfterHours + GroupServiceAccountRoleAssignment: + type: object + properties: + roles: + type: array + description: The Project permissions for the Service Account in the specified + Project. + items: + type: string + description: Project roles available for Service Accounts. + uniqueItems: true + required: + - roles + GroupServiceAccountUpdateRequest: + type: object + properties: + description: + type: string + description: Human readable description for the Service Account. + maxLength: 250 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + name: + type: string + description: Human-readable name for the Service Account. The name is modifiable + and does not have to be unique. + maxLength: 64 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + roles: + type: array + description: A list of Project roles associated with the Service Account. + items: + type: string + description: Project roles available for Service Accounts. GroupSettings: type: object description: Collection of settings that configures the project. @@ -29125,6 +30028,90 @@ components: type: string readOnly: true readOnly: true + OrgServiceAccount: + type: object + properties: + clientId: + type: string + description: The Client ID of the Service Account. + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + createdAt: + type: string + format: date-time + description: The date that the Service Account was created on. + description: + type: string + description: Human readable description for the Service Account. + name: + type: string + description: Human-readable name for the Service Account. + roles: + type: array + description: A list of Organization roles associated with the Service Account. + items: + type: string + description: Organization roles available for Service Accounts. + uniqueItems: true + secrets: + type: array + description: A list of secrets associated with the specified Service Account. + items: + $ref: "#/components/schemas/ServiceAccountSecret" + uniqueItems: true + OrgServiceAccountRequest: + type: object + properties: + description: + type: string + description: Human readable description for the Service Account. + maxLength: 250 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + name: + type: string + description: Human-readable name for the Service Account. The name is modifiable + and does not have to be unique. + maxLength: 64 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + roles: + type: array + description: A list of organization-level roles for the Service Account. + items: + type: string + description: Organization roles available for Service Accounts. + secretExpiresAfterHours: + type: integer + format: int32 + description: The expiration time of the new Service Account secret. The + expiration is provided in hours. + required: + - description + - name + - roles + - secretExpiresAfterHours + OrgServiceAccountUpdateRequest: + type: object + properties: + description: + type: string + description: Human readable description for the Service Account. + maxLength: 250 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + name: + type: string + description: Human-readable name for the Service Account. The name is modifiable + and does not have to be unique. + maxLength: 64 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + roles: + type: array + description: A list of organization-level roles for the Service Account. + items: + type: string + description: Organization roles available for Service Accounts. OrganizationInvitation: type: object properties: @@ -29297,6 +30284,12 @@ components: description: Flag that indicates whether to require API operations to originate from an IP Address added to the API access list for the specified organization. + maxServiceAccountSecretValidityInHours: + type: integer + format: int32 + description: Number that represents the maximum period before expiry in hours + for new Atlas Admin API Service Account secrets within the specified + organization. multiFactorAuthRequired: type: boolean description: "Flag that indicates whether to require users to set up @@ -29469,6 +30462,35 @@ components: if `includeCount` is set to `false`. minimum: 0 readOnly: true + PaginatedGroupServiceAccounts: + type: object + description: A list of Project Service Accounts. + properties: + links: + type: array + description: List of one or more Uniform Resource Locators (URLs) that point to + API sub-resources, related API resources, or both. RFC 5988 outlines + these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + results: + type: array + description: List of returned documents that MongoDB Cloud provides when + completing this request. + items: + $ref: "#/components/schemas/GroupServiceAccount" + readOnly: true + totalCount: + type: integer + format: int32 + description: Total number of documents available. MongoDB Cloud omits this value + if `includeCount` is set to `false`. + minimum: 0 + readOnly: true PaginatedHostView_Atlas: type: object properties: @@ -29497,6 +30519,64 @@ components: if `includeCount` is set to `false`. minimum: 0 readOnly: true + PaginatedOrgServiceAccounts: + type: object + description: A list of Organization Service Accounts. + properties: + links: + type: array + description: List of one or more Uniform Resource Locators (URLs) that point to + API sub-resources, related API resources, or both. RFC 5988 outlines + these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + results: + type: array + description: List of returned documents that MongoDB Cloud provides when + completing this request. + items: + $ref: "#/components/schemas/OrgServiceAccount" + readOnly: true + totalCount: + type: integer + format: int32 + description: Total number of documents available. MongoDB Cloud omits this value + if `includeCount` is set to `false`. + minimum: 0 + readOnly: true + PaginatedServiceAccountGroup: + type: object + description: A list of projects associated with the Service Account. + properties: + links: + type: array + description: List of one or more Uniform Resource Locators (URLs) that point to + API sub-resources, related API resources, or both. RFC 5988 outlines + these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + results: + type: array + description: List of returned documents that MongoDB Cloud provides when + completing this request. + items: + $ref: "#/components/schemas/ServiceAccountGroup" + readOnly: true + totalCount: + type: integer + format: int32 + description: Total number of documents available. MongoDB Cloud omits this value + if `includeCount` is set to `false`. + minimum: 0 + readOnly: true PemFileInfo: type: object description: PEM file information for the identity provider's current certificates. @@ -30943,6 +32023,118 @@ components: writeOnly: true required: - providerName + ServiceAccountGroup: + type: object + properties: + groupId: + type: string + description: "Unique 24-hexadecimal digit string that identifies your project. + **NOTE**: Groups and projects are synonymous terms. Your group id is + the same as your project id. For existing groups, your group/project + id remains the same. The resource and corresponding endpoints use + the term groups." + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + readOnly: true + ServiceAccountIPAccessListEntry: + type: object + properties: + cidrBlock: + type: string + description: Range of network addresses in the access list for the Service + Account. This parameter requires the range to be expressed in + Classless Inter-Domain Routing (CIDR) notation of Internet Protocol + version 4 or version 6 addresses. You can set a value for this + parameter or **ipAddress**, but not for both in the same request. + example: 203.0.113.0/24 + pattern: ^((([0-9]{1,3}\.){3}[0-9]{1,3})|(:{0,2}([0-9a-f]{1,4}:){0,7}[0-9a-f]{1,4}[:]{0,2}))((%2[fF]|/)[0-9]{1,3})+$ + createdAt: + type: string + format: date-time + description: Date MongoDB Cloud added the entry was added to the Access List. + readOnly: true + ipAddress: + type: string + description: Network address in the access list for the Service Account. This + parameter requires the address to be expressed as one Internet + Protocol version 4 or version 6 address. You can set a value for + this parameter or **cidrBlock**, but not for both in the same + request. + example: 203.0.113.10 + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + lastUsedAddress: + type: string + description: Network address that issued the most recent request to the API. + This parameter requires the address to be expressed as one Internet + Protocol version 4 or version 6 address. The resource returns this + parameter after this IP address makes at least one request. + readOnly: true + lastUsedAt: + type: string + format: date-time + description: Date when MongoDB Cloud received the most recent request that + originated from this Internet Protocol version 4 or version 6 + address. The resource returns this parameter when at least one + request originates from this IP address. MongoDB Cloud updates this + parameter each time a client accesses the permitted resource, with a + delay of up to 5 minutes. + readOnly: true + requestCount: + type: integer + format: int32 + description: The number of requests that has originated from this network address. + readOnly: true + ServiceAccountSecret: + type: object + properties: + createdAt: + type: string + format: date-time + description: The date that the secret was created on. + readOnly: true + expiresAt: + type: string + format: date-time + description: The date for the expiration of the secret. + readOnly: true + id: + type: string + description: Unique 24-hexadecimal digit string that identifies the secret. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + lastUsedAt: + type: string + format: date-time + description: The last time the secret was used. + readOnly: true + maskedSecretValue: + type: string + description: The masked Service Account secret. + example: mdb_ic_sk_...12ce + readOnly: true + secret: + type: string + description: The secret for the Service Account. It will be returned only the + first time after creation. + pattern: ^mdb_sa_sk_[0-9a-zA-Z_-]{40}$ + readOnly: true + required: + - createdAt + - expiresAt + - id + ServiceAccountSecretRequest: + type: object + properties: + secretExpiresAfterHours: + type: integer + format: int32 + description: The expiration time of the new Service Account secret. The + expiration is provided in hours. + required: + - secretExpiresAfterHours ShardEntry: type: object description: Sharding configuration for a collection to be sharded on the @@ -34716,6 +35908,34 @@ components: if `includeCount` is set to `false`. minimum: 0 readOnly: true + PaginatedServiceAccountIPAccessEntry: + type: object + properties: + links: + type: array + description: List of one or more Uniform Resource Locators (URLs) that point to + API sub-resources, related API resources, or both. RFC 5988 outlines + these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + results: + type: array + description: List of returned documents that MongoDB Cloud provides when + completing this request. + items: + $ref: "#/components/schemas/ServiceAccountIPAccessListEntry" + readOnly: true + totalCount: + type: integer + format: int32 + description: Total number of documents available. MongoDB Cloud omits this value + if `includeCount` is set to `false`. + minimum: 0 + readOnly: true PaginatedSnapshot: type: object properties: @@ -35107,3 +36327,11 @@ components: DigestAuth: scheme: digest type: http + ServiceAccounts: + description: Learn more about the Preview Feature [Service + Accounts](https://www.mongodb.com/docs/atlas/api/service-accounts-overview). + flows: + clientCredentials: + scopes: {} + tokenUrl: https://cloud.mongodb.com/api/oauth/token + type: oauth2 diff --git a/openapi/atlas-api.yaml b/openapi/atlas-api.yaml index c8587fdc5..0eeefb938 100644 --- a/openapi/atlas-api.yaml +++ b/openapi/atlas-api.yaml @@ -21,11 +21,12 @@ info: termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions title: MongoDB Atlas Administration API version: "2.0" - x-xgen-sha: 4f095c6eb3ef7a717f47646d37e76d52936f25a0 + x-xgen-sha: 86ea1c3d81a33c7436386c6c6ffd908142c8bc96 servers: - url: https://cloud.mongodb.com security: - DigestAuth: [] +- ServiceAccounts: [] tags: - description: "Returns access logs for authentication attempts made to Atlas database\ \ deployments. To view database access history, you must have either the Project\ @@ -183,6 +184,13 @@ tags: description: Set Up a Private Endpoint for a Serverless Instance Tutorial url: https://dochub.mongodb.org/core/serverless-private-endpoint name: Serverless Private Endpoints +- description: Endpoints for managing Service Accounts and secrets. Service Accounts + are used for programmatic access to the Atlas Admin API through the OAuth 2.0 + Client Credentials flow. This feature is available as a Preview feature. + externalDocs: + description: Get Started with the Atlas Administration API + url: https://www.mongodb.com/docs/atlas/configure-api-access/ + name: Service Accounts - description: Returns and adds restore jobs for shared-tier database deployments. name: Shared-Tier Restore Jobs - description: Returns and requests to download shared-tier database deployment snapshots. @@ -13763,6 +13771,435 @@ paths: summary: Update One Serverless Instance in One Project tags: - Serverless Instances + /api/atlas/v2/groups/{groupId}/serviceAccounts: + get: + description: Returns all Service Accounts for the specified Project. Available + as a preview feature. + operationId: listProjectServiceAccounts + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/pretty" + - $ref: "#/components/parameters/envelope" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedGroupServiceAccounts" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: List All Project Service Accounts + tags: + - Service Accounts + post: + description: Creates one Service Account for the specified Project. The Service + Account will automatically be added as an Organization Member to the Organization + that the specified Project is a part of. Available as a preview feature. + operationId: createProjectServiceAccount + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccountRequest" + x-xgen-version: 2024-08-05 + description: Details of the new Service Account. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create and Assign one Service Account to one Project + tags: + - Service Accounts + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}: + delete: + description: "Removes the specified Service Account from the specified project.\ + \ The Service Account will still be a part of the Organization it was created\ + \ in, and the credentials will remain active until expired or manually revoked.\ + \ Available as a preview feature." + operationId: deleteProjectServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/NoBody" + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + x-xgen-version: 2024-08-05 + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Unassign One Service Account from One Project + tags: + - Service Accounts + get: + description: Returns one Service Account in the specified Project. Available + as a preview feature. + operationId: getProjectServiceAccount + parameters: + - $ref: "#/components/parameters/groupId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Get one Project Service Account + tags: + - Service Accounts + patch: + description: Updates one Service Account in the specified Project. Available + as a preview feature. + operationId: updateProjectServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccountUpdateRequest" + description: The new details for the Service Account. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update one Project Service Account + tags: + - Service Accounts + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList: + get: + description: Returns all access list entries that you configured for the specified + Service Account for the project. Available as a preview feature. + operationId: listProjectServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/pretty" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntryView" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Access List entries for one Project Service Account + tags: + - Service Accounts + post: + description: Add Access List Entries for the specified Service Account for the + project. Resources require all API requests to originate from IP addresses + on the API access list. Available as a preview feature. + operationId: createProjectServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/pretty" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + type: array + items: + $ref: "#/components/schemas/ServiceAccountIPAccessListEntry" + x-xgen-version: 2024-08-05 + description: A list of access list entries to add to the access list of the + specified Service Account for the project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntryView" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add Access List entries for one Project Service Account + tags: + - Service Accounts + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress}: + delete: + description: Removes the specified access list entry from the specified Service + Account for the project. You can't remove the requesting IP address from the + access list. Available as a preview feature. + operationId: deleteProjectServiceAccountAccessListEntry + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pretty" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - description: "One IP address or multiple IP addresses represented as one CIDR\ + \ block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24,\ + \ use the URL-encoded value %2F for the forward slash /." + in: path + name: ipAddress + required: true + schema: + type: string + example: 192.0.2.0%2F24 + pattern: "^([0-9]{1,3}\\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\\\ + :){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\\:){1,6}\\:(%2[fF][0-9]{1,3})?$" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Access List entry from one Project Service Account + tags: + - Service Accounts + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets: + post: + description: Create a secret for the specified Service Account in the specified + Project. Available as a preview feature. + operationId: createProjectServiceAccountSecret + parameters: + - $ref: "#/components/parameters/groupId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecretRequest" + description: Details for the new secret. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecret" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create one Project Service Account Secret + tags: + - Service Accounts + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId}: + delete: + description: Deletes the specified Service Account secret. Available as a preview + feature. + operationId: deleteProjectServiceAccountSecret + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - description: Unique 24-hexadecimal digit string that identifies the secret. + in: path + name: secretId + required: true + schema: + type: string + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete one Project Service Account Secret + tags: + - Service Accounts + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite: + post: + description: Assigns the specified Service Account to the specified Project. + Available as a preview feature. + operationId: addProjectServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + type: array + items: + $ref: "#/components/schemas/GroupServiceAccountRoleAssignment" + x-xgen-version: 2024-08-05 + description: The Project permissions for the Service Account in the specified + Project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Assign One Service Account to One Project + tags: + - Service Accounts /api/atlas/v2/groups/{groupId}/settings: get: description: "Returns details about the specified project's settings. To use\ @@ -17039,52 +17476,463 @@ paths: $ref: "#/components/responses/notFound" "500": $ref: "#/components/responses/internalServerError" - summary: Update one Atlas Resource Policy + summary: Update one Atlas Resource Policy + tags: + - Resource Policies + /api/atlas/v2/orgs/{orgId}/resourcePolicies:validate: + post: + description: Validate one Atlas Resource Policy for an org. + externalDocs: + description: Atlas Resource Policies + url: https://dochub.mongodb.org/core/atlas-resource-policies + operationId: validateAtlasResourcePolicy + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicyCreateView" + x-xgen-version: 2024-08-05 + description: Atlas Resource Policy to create. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicyView" + x-xgen-version: 2024-08-05 + description: Ok + "400": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasInvalidResourcePolicyCreateErrorView" + x-xgen-version: 2024-08-05 + description: Bad request. + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Validate one Atlas Resource Policy tags: - Resource Policies - /api/atlas/v2/orgs/{orgId}/resourcePolicies:validate: + /api/atlas/v2/orgs/{orgId}/serviceAccounts: + get: + description: Returns all Service Accounts for the specified Organization. Available + as a preview feature. + operationId: listServiceAccounts + parameters: + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/pretty" + - $ref: "#/components/parameters/envelope" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedOrgServiceAccounts" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: List All Organization Service Accounts + tags: + - Service Accounts post: - description: Validate one Atlas Resource Policy for an org. - externalDocs: - description: Atlas Resource Policies - url: https://dochub.mongodb.org/core/atlas-resource-policies - operationId: validateAtlasResourcePolicy + description: Creates one Service Account for the specified Organization. Available + as a preview feature. + operationId: createServiceAccount + parameters: + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccountRequest" + description: Details of the new Service Account. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccount" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create one Organization Service Account + tags: + - Service Accounts + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}: + delete: + description: Deletes the specified Service Account. Available as a preview feature. + operationId: deleteServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete one Organization Service Account + tags: + - Service Accounts + get: + description: Returns the specified Service Account. Available as a preview feature. + operationId: getServiceAccount parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" - $ref: "#/components/parameters/envelope" - $ref: "#/components/parameters/pretty" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Get one Organization Service Account + tags: + - Service Accounts + patch: + description: Updates the specified Service Account in the specified Organization. + Available as a preview feature. + operationId: updateServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" requestBody: content: application/vnd.atlas.2024-08-05+json: schema: - $ref: "#/components/schemas/ApiAtlasResourcePolicyCreateView" + $ref: "#/components/schemas/OrgServiceAccountUpdateRequest" + description: The new details for the Service Account. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update one Organization Service Account + tags: + - Service Accounts + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList: + get: + description: Returns all access list entries that you configured for the specified + Service Account for the organization. Available as a preview feature. + operationId: listServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/pretty" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntryView" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Access List entries for one Organization Service Account + tags: + - Service Accounts + post: + description: Add Access List Entries for the specified Service Account for the + organization. Resources require all API requests to originate from IP addresses + on the API access list. Available as a preview feature. + operationId: createServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/pretty" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + type: array + items: + $ref: "#/components/schemas/ServiceAccountIPAccessListEntry" x-xgen-version: 2024-08-05 - description: Atlas Resource Policy to create. + description: A list of access list entries to add to the access list of the + specified Service Account for the organization. required: true responses: "200": content: application/vnd.atlas.2024-08-05+json: schema: - $ref: "#/components/schemas/ApiAtlasResourcePolicyView" + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntryView" x-xgen-version: 2024-08-05 - description: Ok + description: OK "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add Access List entries for one Organization Service Account + tags: + - Service Accounts + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress}: + delete: + description: Removes the specified access list entry from the specified Service + Account for the organization. You can't remove the requesting IP address from + the access list. Available as a preview feature. + operationId: deleteServiceAccountAccessListEntry + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pretty" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - description: "One IP address or multiple IP addresses represented as one CIDR\ + \ block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24,\ + \ use the URL-encoded value %2F for the forward slash /." + in: path + name: ipAddress + required: true + schema: + type: string + example: 192.0.2.0%2F24 + pattern: "^([0-9]{1,3}\\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\\\ + :){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\\:){1,6}\\:(%2[fF][0-9]{1,3})?$" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Access List entry from one Organization Service Account + tags: + - Service Accounts + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups: + get: + description: Returns a list of all projects the specified Service Account is + a part of. Available as a preview feature. + operationId: listServiceAccountProjects + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/pretty" + - $ref: "#/components/parameters/envelope" + responses: + "200": content: application/vnd.atlas.2024-08-05+json: schema: - $ref: "#/components/schemas/ApiAtlasInvalidResourcePolicyCreateErrorView" + $ref: "#/components/schemas/PaginatedServiceAccountGroup" x-xgen-version: 2024-08-05 - description: Bad request. + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Service Account Project assignments + tags: + - Service Accounts + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets: + post: + description: Create a secret for the specified Service Account. Available as + a preview feature. + operationId: createServiceAccountSecret + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecretRequest" + description: Details for the new secret. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecret" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create one Organization Service Account Secret + tags: + - Service Accounts + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId}: + delete: + description: Deletes the specified Service Account secret. Available as a preview + feature. + operationId: deleteServiceAccountSecret + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + type: string + example: mdb_sa_id_667066535bc75b03c37b3038 + pattern: "^mdb_sa_id_[a-fA-F\\d]{24}$" + - description: Unique 24-hexadecimal digit string that identifies the secret. + in: path + name: secretId + required: true + schema: + type: string + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. "401": $ref: "#/components/responses/unauthorized" "404": $ref: "#/components/responses/notFound" "500": $ref: "#/components/responses/internalServerError" - summary: Validate one Atlas Resource Policy + summary: Delete a Organization Service Account Secret tags: - - Resource Policies + - Service Accounts /api/atlas/v2/orgs/{orgId}/settings: get: description: "Returns details about the specified organization's settings. To\ @@ -45319,6 +46167,12 @@ components: type: boolean description: Flag that indicates whether to require API operations to originate from an IP Address added to the API access list for the specified organization. + maxServiceAccountSecretValidityInHours: + type: integer + format: int32 + description: Number that represents the maximum period before expiry in + hours for new Atlas Admin API Service Account secrets within the specified + organization. multiFactorAuthRequired: type: boolean description: "Flag that indicates whether to require users to set up Multi-Factor\ @@ -55791,3 +56645,10 @@ components: DigestAuth: scheme: digest type: http + ServiceAccounts: + description: "Learn more about the Preview Feature [Service Accounts](https://www.mongodb.com/docs/atlas/api/service-accounts-overview)." + flows: + clientCredentials: + scopes: {} + tokenUrl: https://cloud.mongodb.com/api/oauth/token + type: oauth2