From b62d352143419d1c9163653acd77029ddecc37e4 Mon Sep 17 00:00:00 2001 From: wtrocki <981838+wtrocki@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:38:53 +0000 Subject: [PATCH] temp: client update --- .mockery.yaml | 2 +- admin/api_events.go | 4 +- admin/api_mongo_db_cloud_users.go | 1582 ++++++++++++++- admin/api_open_api.go | 187 ++ admin/api_organizations.go | 22 +- admin/api_performance_advisor.go | 479 +++++ admin/api_projects.go | 45 +- admin/api_streams.go | 158 ++ admin/api_teams.go | 16 +- admin/atlas_client.go | 8 +- admin/client.go | 3 + admin/model_add_or_remove_group_role.go | 51 + admin/model_add_or_remove_org_role.go | 51 + admin/model_add_or_remove_user_from_team.go | 52 + admin/model_advanced_compute_auto_scaling.go | 4 +- admin/model_api_version.go | 59 + admin/model_cluster_description20240805.go | 6 +- admin/model_create_organization_request.go | 39 + admin/model_disk_backup_export_job.go | 36 +- admin/model_event_view_for_nds_group.go | 72 + admin/model_group_maintenance_window.go | 72 +- admin/model_group_role_assignment.go | 94 + admin/model_group_user_response.go | 464 +++++ admin/model_mdb_available_version.go | 2 +- admin/model_org_user_request.go | 114 ++ admin/model_org_user_response.go | 498 +++++ admin/model_org_user_roles_request.go | 86 + admin/model_org_user_roles_response.go | 94 + admin/model_org_user_update_request.go | 94 + admin/model_paginated_api_versions.go | 132 ++ admin/model_paginated_org_user.go | 132 ++ admin/model_protected_hours.go | 94 + admin/model_state_reason.go | 94 + admin/model_streams_connection.go | 70 - .../model_streams_modify_stream_processor.go | 164 ++ ...streams_modify_stream_processor_options.go | 129 ++ admin/model_team.go | 32 +- auth/clientcredentials/clientcredentials.go | 4 +- .../clientcredentials_test.go | 2 +- auth/code/device_flow.go | 2 +- auth/code/oauth.go | 2 +- auth/code/oauth_test.go | 2 +- examples/aws_cluster/aws.go | 4 +- examples/basic/basic.go | 4 +- examples/db_users/db_users.go | 4 +- examples/download/downloadLogs.go | 4 +- examples/errors.go | 2 +- examples/go.mod | 10 +- examples/invoice/invoice.go | 4 +- examples/mock/cluster_test.go | 4 +- examples/regions/regions.go | 4 +- examples/retry/retry.go | 2 +- .../sa_management.go | 2 +- .../cached_token.go | 6 +- go.mod | 2 +- mockadmin/access_tracking_api.go | 2 +- mockadmin/alert_configurations_api.go | 2 +- mockadmin/alerts_api.go | 2 +- mockadmin/atlas_search_api.go | 2 +- mockadmin/auditing_api.go | 2 +- mockadmin/aws_clusters_dns_api.go | 2 +- mockadmin/cloud_backups_api.go | 2 +- mockadmin/cloud_migration_service_api.go | 2 +- mockadmin/cloud_provider_access_api.go | 2 +- mockadmin/cluster_outage_simulation_api.go | 2 +- mockadmin/clusters_api.go | 2 +- mockadmin/collection_level_metrics_api.go | 2 +- mockadmin/custom_database_roles_api.go | 2 +- mockadmin/data_federation_api.go | 2 +- mockadmin/data_lake_pipelines_api.go | 2 +- mockadmin/database_users_api.go | 2 +- ..._rest_using_customer_key_management_api.go | 2 +- mockadmin/events_api.go | 2 +- mockadmin/federated_authentication_api.go | 2 +- mockadmin/flex_clusters_api.go | 2 +- mockadmin/flex_restore_jobs_api.go | 2 +- mockadmin/flex_snapshots_api.go | 2 +- mockadmin/global_clusters_api.go | 2 +- mockadmin/invoices_api.go | 2 +- mockadmin/ldap_configuration_api.go | 2 +- mockadmin/legacy_backup_api.go | 2 +- mockadmin/maintenance_windows_api.go | 2 +- mockadmin/mongo_db_cloud_users_api.go | 1780 +++++++++++++++-- mockadmin/monitoring_and_logs_api.go | 2 +- mockadmin/network_peering_api.go | 2 +- mockadmin/online_archive_api.go | 2 +- mockadmin/open_api_api.go | 200 ++ mockadmin/organizations_api.go | 16 +- mockadmin/performance_advisor_api.go | 488 ++++- mockadmin/private_endpoint_services_api.go | 2 +- mockadmin/programmatic_api_keys_api.go | 2 +- mockadmin/project_ip_access_list_api.go | 2 +- mockadmin/projects_api.go | 35 +- mockadmin/push_based_log_export_api.go | 2 +- mockadmin/resource_policies_api.go | 2 +- mockadmin/rolling_index_api.go | 2 +- mockadmin/root_api.go | 2 +- mockadmin/serverless_instances_api.go | 2 +- mockadmin/serverless_private_endpoints_api.go | 2 +- mockadmin/service_accounts_api.go | 2 +- mockadmin/shared_tier_restore_jobs_api.go | 2 +- mockadmin/shared_tier_snapshots_api.go | 2 +- mockadmin/streams_api.go | 166 +- mockadmin/teams_api.go | 16 +- mockadmin/third_party_integrations_api.go | 2 +- mockadmin/x509_authentication_api.go | 2 +- openapi/atlas-api-transformed.yaml | 1323 +++++++++++- openapi/atlas-api.yaml | 1000 ++++++++- openapi/versions.json | 2 +- test/example_client_test.go | 2 +- test/utils_test.go | 2 +- tools/config/go-templates/api_doc.mustache | 2 +- .../config/go-templates/atlas_client.mustache | 8 +- 113 files changed, 9794 insertions(+), 639 deletions(-) create mode 100644 admin/api_open_api.go create mode 100644 admin/model_add_or_remove_group_role.go create mode 100644 admin/model_add_or_remove_org_role.go create mode 100644 admin/model_add_or_remove_user_from_team.go create mode 100644 admin/model_api_version.go create mode 100644 admin/model_group_role_assignment.go create mode 100644 admin/model_group_user_response.go create mode 100644 admin/model_org_user_request.go create mode 100644 admin/model_org_user_response.go create mode 100644 admin/model_org_user_roles_request.go create mode 100644 admin/model_org_user_roles_response.go create mode 100644 admin/model_org_user_update_request.go create mode 100644 admin/model_paginated_api_versions.go create mode 100644 admin/model_paginated_org_user.go create mode 100644 admin/model_protected_hours.go create mode 100644 admin/model_state_reason.go create mode 100644 admin/model_streams_modify_stream_processor.go create mode 100644 admin/model_streams_modify_stream_processor_options.go create mode 100644 mockadmin/open_api_api.go diff --git a/.mockery.yaml b/.mockery.yaml index cfb77ab13..02cb53dca 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -6,6 +6,6 @@ filename: "{{ .InterfaceName | snakecase }}.go" mockname: "{{.InterfaceName}}" packages: - go.mongodb.org/atlas-sdk/v20241113001/admin: + github.com/mongodb/atlas-sdk-go/admin: config: include-regex: ".*Api" diff --git a/admin/api_events.go b/admin/api_events.go index 69702d71c..542fbbd4e 100644 --- a/admin/api_events.go +++ b/admin/api_events.go @@ -116,7 +116,7 @@ type EventsApi interface { /* ListProjectEvents Return All Events from One Project - Returns one event for the specified project. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting API Key must have the Project Read Only role. + Returns all events for the specified project. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting API Key must have the Project Read Only role. This resource remains under revision and may change. @@ -888,7 +888,7 @@ func (r ListProjectEventsApiRequest) Execute() (*GroupPaginatedEvent, *http.Resp /* ListProjectEvents Return All Events from One Project -Returns one event for the specified project. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting API Key must have the Project Read Only role. +Returns all events for the specified project. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting API Key must have the Project Read Only role. This resource remains under revision and may change. diff --git a/admin/api_mongo_db_cloud_users.go b/admin/api_mongo_db_cloud_users.go index 121b0731b..ec0421b30 100644 --- a/admin/api_mongo_db_cloud_users.go +++ b/admin/api_mongo_db_cloud_users.go @@ -12,6 +12,115 @@ import ( type MongoDBCloudUsersApi interface { + /* + AddOrganizationRole Add One Organization Role to One MongoDB Cloud User + + Adds one organization-level role to the MongoDB Cloud user. You can add a role to an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: This operation is atomic. + + **Note**: This resource cannot be used to add a role to users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + @param addOrRemoveOrgRole Organization-level role to assign to the MongoDB Cloud user. + @return AddOrganizationRoleApiRequest + */ + AddOrganizationRole(ctx context.Context, orgId string, userId string, addOrRemoveOrgRole *AddOrRemoveOrgRole) AddOrganizationRoleApiRequest + /* + AddOrganizationRole Add One Organization Role to One MongoDB Cloud User + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param AddOrganizationRoleApiParams - Parameters for the request + @return AddOrganizationRoleApiRequest + */ + AddOrganizationRoleWithParams(ctx context.Context, args *AddOrganizationRoleApiParams) AddOrganizationRoleApiRequest + + // Method available only for mocking purposes + AddOrganizationRoleExecute(r AddOrganizationRoleApiRequest) (*OrgUserResponse, *http.Response, error) + + /* + AddProjectRole Add One Project Role to One MongoDB Cloud User + + Adds one project-level role to the MongoDB Cloud user. You can add a role to an active user or a user that has been invited to join the project. To use this resource, the requesting API Key must have the Project Owner role. + + **Note**: This resource cannot be used to add a role to users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the project. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Project resource and filter by username. + @param addOrRemoveGroupRole Project-level role to assign to the MongoDB Cloud user. + @return AddProjectRoleApiRequest + */ + AddProjectRole(ctx context.Context, groupId string, userId string, addOrRemoveGroupRole *AddOrRemoveGroupRole) AddProjectRoleApiRequest + /* + AddProjectRole Add One Project Role to One MongoDB Cloud User + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param AddProjectRoleApiParams - Parameters for the request + @return AddProjectRoleApiRequest + */ + AddProjectRoleWithParams(ctx context.Context, args *AddProjectRoleApiParams) AddProjectRoleApiRequest + + // Method available only for mocking purposes + AddProjectRoleExecute(r AddProjectRoleApiRequest) (*OrgUserResponse, *http.Response, error) + + /* + AddUserToTeam Add One MongoDB Cloud User to One Team + + Adds one MongoDB Cloud user to one team. You can add an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: This resource cannot be used to add a user invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 teamId Unique 24-hexadecimal digit string that identifies the team to add the MongoDB Cloud user to. + @param addOrRemoveUserFromTeam The active or pending MongoDB Cloud user that you want to add to the specified team. + @return AddUserToTeamApiRequest + */ + AddUserToTeam(ctx context.Context, orgId string, teamId string, addOrRemoveUserFromTeam *AddOrRemoveUserFromTeam) AddUserToTeamApiRequest + /* + AddUserToTeam Add One MongoDB Cloud User to One Team + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param AddUserToTeamApiParams - Parameters for the request + @return AddUserToTeamApiRequest + */ + AddUserToTeamWithParams(ctx context.Context, args *AddUserToTeamApiParams) AddUserToTeamApiRequest + + // Method available only for mocking purposes + AddUserToTeamExecute(r AddUserToTeamApiRequest) (*OrgUserResponse, *http.Response, error) + + /* + CreateOrganizationUser Create One MongoDB Cloud User in One Organization + + Invites one new or existing MongoDB Cloud user to join the organization. The invitation to join the organization will be sent to the username provided and must be accepted within 30 days. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: If the user does not have an existing MongoDB Cloud account, they will be prompted to finish setting up an account upon accepting the invitation. If the user already has an account, they will still receive an invitation to access the organization. + + @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 orgUserRequest Represents the MongoDB Cloud user to be created within the organization. + @return CreateOrganizationUserApiRequest + */ + CreateOrganizationUser(ctx context.Context, orgId string, orgUserRequest *OrgUserRequest) CreateOrganizationUserApiRequest + /* + CreateOrganizationUser Create One MongoDB Cloud User in One Organization + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param CreateOrganizationUserApiParams - Parameters for the request + @return CreateOrganizationUserApiRequest + */ + CreateOrganizationUserWithParams(ctx context.Context, args *CreateOrganizationUserApiParams) CreateOrganizationUserApiRequest + + // Method available only for mocking purposes + CreateOrganizationUserExecute(r CreateOrganizationUserApiRequest) (*OrgUserResponse, *http.Response, error) + /* CreateUser Create One MongoDB Cloud User @@ -39,6 +148,62 @@ type MongoDBCloudUsersApi interface { // Method available only for mocking purposes CreateUserExecute(r CreateUserApiRequest) (*CloudAppUser, *http.Response, error) + /* + GetOrganizationUser Return One MongoDB Cloud User in One Organization + + Returns information about the specified MongoDB Cloud user within the context of the specified organization. To use this resource, the requesting API Key must have the Organization Read Only role. + + **Note**: This resource can only be used to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + + **Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + @return GetOrganizationUserApiRequest + */ + GetOrganizationUser(ctx context.Context, orgId string, userId string) GetOrganizationUserApiRequest + /* + GetOrganizationUser Return One MongoDB Cloud User in One Organization + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param GetOrganizationUserApiParams - Parameters for the request + @return GetOrganizationUserApiRequest + */ + GetOrganizationUserWithParams(ctx context.Context, args *GetOrganizationUserApiParams) GetOrganizationUserApiRequest + + // Method available only for mocking purposes + GetOrganizationUserExecute(r GetOrganizationUserApiRequest) (*OrgUserResponse, *http.Response, error) + + /* + GetProjectUser Return One MongoDB Cloud User in One Project + + Returns information about the specified MongoDB Cloud user within the context of the specified project. To use this resource, the requesting API Key must have the Group Read Only role. + + **Note**: You can only use this resource to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + + **Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the project. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Project resource and filter by username. + @return GetProjectUserApiRequest + */ + GetProjectUser(ctx context.Context, groupId string, userId string) GetProjectUserApiRequest + /* + GetProjectUser Return One MongoDB Cloud User in One Project + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param GetProjectUserApiParams - Parameters for the request + @return GetProjectUserApiRequest + */ + GetProjectUserWithParams(ctx context.Context, args *GetProjectUserApiParams) GetProjectUserApiRequest + + // Method available only for mocking purposes + GetProjectUserExecute(r GetProjectUserApiRequest) (*GroupUserResponse, *http.Response, error) + /* GetUser Return One MongoDB Cloud User using Its ID @@ -84,80 +249,177 @@ type MongoDBCloudUsersApi interface { // Method available only for mocking purposes GetUserByUsernameExecute(r GetUserByUsernameApiRequest) (*CloudAppUser, *http.Response, error) + + /* + RemoveOrganizationRole Remove One Organization Role from One MongoDB Cloud User + + Removes one organization-level role from the MongoDB Cloud user. You can remove a role from an active user or a user that has not yet accepted the invitation to join the organization. To replace a user's only role, add the new role before removing the old role. A user must have at least one role at all times. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: This operation is atomic. + + **Note**: This resource cannot be used to remove a role from users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + @param addOrRemoveOrgRole Organization-level role to remove from the MongoDB Cloud user. + @return RemoveOrganizationRoleApiRequest + */ + RemoveOrganizationRole(ctx context.Context, orgId string, userId string, addOrRemoveOrgRole *AddOrRemoveOrgRole) RemoveOrganizationRoleApiRequest + /* + RemoveOrganizationRole Remove One Organization Role from One MongoDB Cloud User + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param RemoveOrganizationRoleApiParams - Parameters for the request + @return RemoveOrganizationRoleApiRequest + */ + RemoveOrganizationRoleWithParams(ctx context.Context, args *RemoveOrganizationRoleApiParams) RemoveOrganizationRoleApiRequest + + // Method available only for mocking purposes + RemoveOrganizationRoleExecute(r RemoveOrganizationRoleApiRequest) (*OrgUserResponse, *http.Response, error) + + /* + RemoveUserFromTeam Remove One MongoDB Cloud User from One Team + + Removes one MongoDB Cloud user from one team. You can remove an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: This resource cannot be used to remove a user invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 teamId Unique 24-hexadecimal digit string that identifies the team to remove the MongoDB user from. + @param addOrRemoveUserFromTeam The id of the active or pending MongoDB Cloud user that you want to remove from the specified team. + @return RemoveUserFromTeamApiRequest + */ + RemoveUserFromTeam(ctx context.Context, orgId string, teamId string, addOrRemoveUserFromTeam *AddOrRemoveUserFromTeam) RemoveUserFromTeamApiRequest + /* + RemoveUserFromTeam Remove One MongoDB Cloud User from One Team + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param RemoveUserFromTeamApiParams - Parameters for the request + @return RemoveUserFromTeamApiRequest + */ + RemoveUserFromTeamWithParams(ctx context.Context, args *RemoveUserFromTeamApiParams) RemoveUserFromTeamApiRequest + + // Method available only for mocking purposes + RemoveUserFromTeamExecute(r RemoveUserFromTeamApiRequest) (*OrgUserResponse, *http.Response, error) + + /* + UpdateOrganizationUser Update One MongoDB Cloud User in One Organization + + Updates one MongoDB Cloud user in the specified organization. You can update an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: Only include the fields you wish to update in the request body. Supplying a field with an empty value will reset that field on the user. + + **Note**: This resource cannot be used to update pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + @param orgUserUpdateRequest Represents the roles and teams to assign the MongoDB Cloud user. + @return UpdateOrganizationUserApiRequest + */ + UpdateOrganizationUser(ctx context.Context, orgId string, userId string, orgUserUpdateRequest *OrgUserUpdateRequest) UpdateOrganizationUserApiRequest + /* + UpdateOrganizationUser Update One MongoDB Cloud User in One Organization + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param UpdateOrganizationUserApiParams - Parameters for the request + @return UpdateOrganizationUserApiRequest + */ + UpdateOrganizationUserWithParams(ctx context.Context, args *UpdateOrganizationUserApiParams) UpdateOrganizationUserApiRequest + + // Method available only for mocking purposes + UpdateOrganizationUserExecute(r UpdateOrganizationUserApiRequest) (*OrgUserResponse, *http.Response, error) } // MongoDBCloudUsersApiService MongoDBCloudUsersApi service type MongoDBCloudUsersApiService service -type CreateUserApiRequest struct { - ctx context.Context - ApiService MongoDBCloudUsersApi - cloudAppUser *CloudAppUser +type AddOrganizationRoleApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + orgId string + userId string + addOrRemoveOrgRole *AddOrRemoveOrgRole } -type CreateUserApiParams struct { - CloudAppUser *CloudAppUser +type AddOrganizationRoleApiParams struct { + OrgId string + UserId string + AddOrRemoveOrgRole *AddOrRemoveOrgRole } -func (a *MongoDBCloudUsersApiService) CreateUserWithParams(ctx context.Context, args *CreateUserApiParams) CreateUserApiRequest { - return CreateUserApiRequest{ - ApiService: a, - ctx: ctx, - cloudAppUser: args.CloudAppUser, +func (a *MongoDBCloudUsersApiService) AddOrganizationRoleWithParams(ctx context.Context, args *AddOrganizationRoleApiParams) AddOrganizationRoleApiRequest { + return AddOrganizationRoleApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + userId: args.UserId, + addOrRemoveOrgRole: args.AddOrRemoveOrgRole, } } -func (r CreateUserApiRequest) Execute() (*CloudAppUser, *http.Response, error) { - return r.ApiService.CreateUserExecute(r) +func (r AddOrganizationRoleApiRequest) Execute() (*OrgUserResponse, *http.Response, error) { + return r.ApiService.AddOrganizationRoleExecute(r) } /* -CreateUser Create One MongoDB Cloud User +AddOrganizationRole Add One Organization Role to One MongoDB Cloud User -Creates one MongoDB Cloud user account. A MongoDB Cloud user account grants access to only the MongoDB Cloud application. To grant database access, create a database user. MongoDB Cloud sends an email to the users you specify, inviting them to join the project. Invited users don't have access to the project until they accept the invitation. Invitations expire after 30 days. +Adds one organization-level role to the MongoDB Cloud user. You can add a role to an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. - MongoDB Cloud limits MongoDB Cloud user membership to a maximum of 250 MongoDB Cloud users per team. MongoDB Cloud limits MongoDB Cloud user membership to 500 MongoDB Cloud users per project and 500 MongoDB Cloud users per organization, which includes the combined membership of all projects in the organization. MongoDB Cloud raises an error if an operation exceeds these limits. For example, if you have an organization with five projects, and each project has 100 MongoDB Cloud users, and each MongoDB Cloud user belongs to only one project, you can't add any MongoDB Cloud users to this organization without first removing existing MongoDB Cloud users from the organization. +**Note**: This operation is atomic. - To use this resource, the requesting API Key can have any role. +**Note**: This resource cannot be used to add a role to users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return CreateUserApiRequest + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + @return AddOrganizationRoleApiRequest */ -func (a *MongoDBCloudUsersApiService) CreateUser(ctx context.Context, cloudAppUser *CloudAppUser) CreateUserApiRequest { - return CreateUserApiRequest{ - ApiService: a, - ctx: ctx, - cloudAppUser: cloudAppUser, +func (a *MongoDBCloudUsersApiService) AddOrganizationRole(ctx context.Context, orgId string, userId string, addOrRemoveOrgRole *AddOrRemoveOrgRole) AddOrganizationRoleApiRequest { + return AddOrganizationRoleApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + userId: userId, + addOrRemoveOrgRole: addOrRemoveOrgRole, } } -// CreateUserExecute executes the request +// AddOrganizationRoleExecute executes the request // -// @return CloudAppUser -func (a *MongoDBCloudUsersApiService) CreateUserExecute(r CreateUserApiRequest) (*CloudAppUser, *http.Response, error) { +// @return OrgUserResponse +func (a *MongoDBCloudUsersApiService) AddOrganizationRoleExecute(r AddOrganizationRoleApiRequest) (*OrgUserResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody any formFiles []formFile - localVarReturnValue *CloudAppUser + localVarReturnValue *OrgUserResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.CreateUser") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.AddOrganizationRole") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/atlas/v2/users" + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/users/{userId}:addRole" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(r.userId), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.cloudAppUser == nil { - return localVarReturnValue, nil, reportError("cloudAppUser is required and must be specified") + if r.addOrRemoveOrgRole == nil { + return localVarReturnValue, nil, reportError("addOrRemoveOrgRole is required and must be specified") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/vnd.atlas.2023-01-01+json"} + localVarHTTPContentTypes := []string{"application/vnd.atlas.2025-01-01+json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -166,7 +428,7 @@ func (a *MongoDBCloudUsersApiService) CreateUserExecute(r CreateUserApiRequest) } // to determine the Accept header (only first one) - localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json"} + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -174,7 +436,7 @@ func (a *MongoDBCloudUsersApiService) CreateUserExecute(r CreateUserApiRequest) localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.cloudAppUser + localVarPostBody = r.addOrRemoveOrgRole req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -207,70 +469,85 @@ func (a *MongoDBCloudUsersApiService) CreateUserExecute(r CreateUserApiRequest) return localVarReturnValue, localVarHTTPResponse, nil } -type GetUserApiRequest struct { - ctx context.Context - ApiService MongoDBCloudUsersApi - userId string +type AddProjectRoleApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + groupId string + userId string + addOrRemoveGroupRole *AddOrRemoveGroupRole } -type GetUserApiParams struct { - UserId string +type AddProjectRoleApiParams struct { + GroupId string + UserId string + AddOrRemoveGroupRole *AddOrRemoveGroupRole } -func (a *MongoDBCloudUsersApiService) GetUserWithParams(ctx context.Context, args *GetUserApiParams) GetUserApiRequest { - return GetUserApiRequest{ - ApiService: a, - ctx: ctx, - userId: args.UserId, +func (a *MongoDBCloudUsersApiService) AddProjectRoleWithParams(ctx context.Context, args *AddProjectRoleApiParams) AddProjectRoleApiRequest { + return AddProjectRoleApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + userId: args.UserId, + addOrRemoveGroupRole: args.AddOrRemoveGroupRole, } } -func (r GetUserApiRequest) Execute() (*CloudAppUser, *http.Response, error) { - return r.ApiService.GetUserExecute(r) +func (r AddProjectRoleApiRequest) Execute() (*OrgUserResponse, *http.Response, error) { + return r.ApiService.AddProjectRoleExecute(r) } /* -GetUser Return One MongoDB Cloud User using Its ID +AddProjectRole Add One Project Role to One MongoDB Cloud User -Returns the details for one MongoDB Cloud user account with the specified unique identifier for the user. You can't use this endpoint to return information on an API Key. To return information about an API Key, use the [Return One Organization](#tag/Organizations/operation/getOrganization) API Key endpoint. You can always retrieve your own user account. If you are the owner of a MongoDB Cloud organization or project, you can also retrieve the user profile for any user with membership in that organization or project. To use this resource, the requesting API Key can have any role. +Adds one project-level role to the MongoDB Cloud user. You can add a role to an active user or a user that has been invited to join the project. To use this resource, the requesting API Key must have the Project Owner role. + +**Note**: This resource cannot be used to add a role to users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param userId Unique 24-hexadecimal digit string that identifies this user. - @return GetUserApiRequest + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the project. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Project resource and filter by username. + @return AddProjectRoleApiRequest */ -func (a *MongoDBCloudUsersApiService) GetUser(ctx context.Context, userId string) GetUserApiRequest { - return GetUserApiRequest{ - ApiService: a, - ctx: ctx, - userId: userId, +func (a *MongoDBCloudUsersApiService) AddProjectRole(ctx context.Context, groupId string, userId string, addOrRemoveGroupRole *AddOrRemoveGroupRole) AddProjectRoleApiRequest { + return AddProjectRoleApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + userId: userId, + addOrRemoveGroupRole: addOrRemoveGroupRole, } } -// GetUserExecute executes the request +// AddProjectRoleExecute executes the request // -// @return CloudAppUser -func (a *MongoDBCloudUsersApiService) GetUserExecute(r GetUserApiRequest) (*CloudAppUser, *http.Response, error) { +// @return OrgUserResponse +func (a *MongoDBCloudUsersApiService) AddProjectRoleExecute(r AddProjectRoleApiRequest) (*OrgUserResponse, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPost localVarPostBody any formFiles []formFile - localVarReturnValue *CloudAppUser + localVarReturnValue *OrgUserResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.GetUser") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.AddProjectRole") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/atlas/v2/users/{userId}" + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/users/{userId}:addRole" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(r.userId), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.addOrRemoveGroupRole == nil { + return localVarReturnValue, nil, reportError("addOrRemoveGroupRole is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/vnd.atlas.2025-01-01+json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -279,13 +556,15 @@ func (a *MongoDBCloudUsersApiService) GetUserExecute(r GetUserApiRequest) (*Clou } // to determine the Accept header (only first one) - localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json"} + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.addOrRemoveGroupRole req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -318,70 +597,85 @@ func (a *MongoDBCloudUsersApiService) GetUserExecute(r GetUserApiRequest) (*Clou return localVarReturnValue, localVarHTTPResponse, nil } -type GetUserByUsernameApiRequest struct { - ctx context.Context - ApiService MongoDBCloudUsersApi - userName string +type AddUserToTeamApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + orgId string + teamId string + addOrRemoveUserFromTeam *AddOrRemoveUserFromTeam } -type GetUserByUsernameApiParams struct { - UserName string +type AddUserToTeamApiParams struct { + OrgId string + TeamId string + AddOrRemoveUserFromTeam *AddOrRemoveUserFromTeam } -func (a *MongoDBCloudUsersApiService) GetUserByUsernameWithParams(ctx context.Context, args *GetUserByUsernameApiParams) GetUserByUsernameApiRequest { - return GetUserByUsernameApiRequest{ - ApiService: a, - ctx: ctx, - userName: args.UserName, +func (a *MongoDBCloudUsersApiService) AddUserToTeamWithParams(ctx context.Context, args *AddUserToTeamApiParams) AddUserToTeamApiRequest { + return AddUserToTeamApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + teamId: args.TeamId, + addOrRemoveUserFromTeam: args.AddOrRemoveUserFromTeam, } } -func (r GetUserByUsernameApiRequest) Execute() (*CloudAppUser, *http.Response, error) { - return r.ApiService.GetUserByUsernameExecute(r) +func (r AddUserToTeamApiRequest) Execute() (*OrgUserResponse, *http.Response, error) { + return r.ApiService.AddUserToTeamExecute(r) } /* -GetUserByUsername Return One MongoDB Cloud User using Their Username +AddUserToTeam Add One MongoDB Cloud User to One Team -Returns the details for one MongoDB Cloud user account with the specified username. You can't use this endpoint to return information about an API Key. To return information about an API Key, use the [Return One Organization](#tag/Organizations/operation/getOrganization) API Key endpoint. To use this resource, the requesting API Key can have any role. +Adds one MongoDB Cloud user to one team. You can add an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + +**Note**: This resource cannot be used to add a user invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param userName Email address that belongs to the MongoDB Cloud user account. You cannot modify this address after creating the user. - @return GetUserByUsernameApiRequest + @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 teamId Unique 24-hexadecimal digit string that identifies the team to add the MongoDB Cloud user to. + @return AddUserToTeamApiRequest */ -func (a *MongoDBCloudUsersApiService) GetUserByUsername(ctx context.Context, userName string) GetUserByUsernameApiRequest { - return GetUserByUsernameApiRequest{ - ApiService: a, - ctx: ctx, - userName: userName, +func (a *MongoDBCloudUsersApiService) AddUserToTeam(ctx context.Context, orgId string, teamId string, addOrRemoveUserFromTeam *AddOrRemoveUserFromTeam) AddUserToTeamApiRequest { + return AddUserToTeamApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + teamId: teamId, + addOrRemoveUserFromTeam: addOrRemoveUserFromTeam, } } -// GetUserByUsernameExecute executes the request +// AddUserToTeamExecute executes the request // -// @return CloudAppUser -func (a *MongoDBCloudUsersApiService) GetUserByUsernameExecute(r GetUserByUsernameApiRequest) (*CloudAppUser, *http.Response, error) { +// @return OrgUserResponse +func (a *MongoDBCloudUsersApiService) AddUserToTeamExecute(r AddUserToTeamApiRequest) (*OrgUserResponse, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPost localVarPostBody any formFiles []formFile - localVarReturnValue *CloudAppUser + localVarReturnValue *OrgUserResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.GetUserByUsername") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.AddUserToTeam") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/atlas/v2/users/byName/{userName}" - localVarPath = strings.Replace(localVarPath, "{"+"userName"+"}", url.PathEscape(r.userName), -1) + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/teams/{teamId}:addUser" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"teamId"+"}", url.PathEscape(r.teamId), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.addOrRemoveUserFromTeam == nil { + return localVarReturnValue, nil, reportError("addOrRemoveUserFromTeam is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/vnd.atlas.2025-01-01+json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -390,13 +684,1107 @@ func (a *MongoDBCloudUsersApiService) GetUserByUsernameExecute(r GetUserByUserna } // to determine the Accept header (only first one) - localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json"} + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.addOrRemoveUserFromTeam + 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 CreateOrganizationUserApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + orgId string + orgUserRequest *OrgUserRequest +} + +type CreateOrganizationUserApiParams struct { + OrgId string + OrgUserRequest *OrgUserRequest +} + +func (a *MongoDBCloudUsersApiService) CreateOrganizationUserWithParams(ctx context.Context, args *CreateOrganizationUserApiParams) CreateOrganizationUserApiRequest { + return CreateOrganizationUserApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + orgUserRequest: args.OrgUserRequest, + } +} + +func (r CreateOrganizationUserApiRequest) Execute() (*OrgUserResponse, *http.Response, error) { + return r.ApiService.CreateOrganizationUserExecute(r) +} + +/* +CreateOrganizationUser Create One MongoDB Cloud User in One Organization + +Invites one new or existing MongoDB Cloud user to join the organization. The invitation to join the organization will be sent to the username provided and must be accepted within 30 days. To use this resource, the requesting API Key must have the Organization Owner role. + +**Note**: If the user does not have an existing MongoDB Cloud account, they will be prompted to finish setting up an account upon accepting the invitation. If the user already has an account, they will still receive an invitation to access the organization. + + @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 CreateOrganizationUserApiRequest +*/ +func (a *MongoDBCloudUsersApiService) CreateOrganizationUser(ctx context.Context, orgId string, orgUserRequest *OrgUserRequest) CreateOrganizationUserApiRequest { + return CreateOrganizationUserApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + orgUserRequest: orgUserRequest, + } +} + +// CreateOrganizationUserExecute executes the request +// +// @return OrgUserResponse +func (a *MongoDBCloudUsersApiService) CreateOrganizationUserExecute(r CreateOrganizationUserApiRequest) (*OrgUserResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *OrgUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.CreateOrganizationUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/users" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.orgUserRequest == nil { + return localVarReturnValue, nil, reportError("orgUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2025-01-01+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.orgUserRequest + 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 CreateUserApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + cloudAppUser *CloudAppUser +} + +type CreateUserApiParams struct { + CloudAppUser *CloudAppUser +} + +func (a *MongoDBCloudUsersApiService) CreateUserWithParams(ctx context.Context, args *CreateUserApiParams) CreateUserApiRequest { + return CreateUserApiRequest{ + ApiService: a, + ctx: ctx, + cloudAppUser: args.CloudAppUser, + } +} + +func (r CreateUserApiRequest) Execute() (*CloudAppUser, *http.Response, error) { + return r.ApiService.CreateUserExecute(r) +} + +/* +CreateUser Create One MongoDB Cloud User + +Creates one MongoDB Cloud user account. A MongoDB Cloud user account grants access to only the MongoDB Cloud application. To grant database access, create a database user. MongoDB Cloud sends an email to the users you specify, inviting them to join the project. Invited users don't have access to the project until they accept the invitation. Invitations expire after 30 days. + + MongoDB Cloud limits MongoDB Cloud user membership to a maximum of 250 MongoDB Cloud users per team. MongoDB Cloud limits MongoDB Cloud user membership to 500 MongoDB Cloud users per project and 500 MongoDB Cloud users per organization, which includes the combined membership of all projects in the organization. MongoDB Cloud raises an error if an operation exceeds these limits. For example, if you have an organization with five projects, and each project has 100 MongoDB Cloud users, and each MongoDB Cloud user belongs to only one project, you can't add any MongoDB Cloud users to this organization without first removing existing MongoDB Cloud users from the organization. + + To use this resource, the requesting API Key can have any role. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return CreateUserApiRequest +*/ +func (a *MongoDBCloudUsersApiService) CreateUser(ctx context.Context, cloudAppUser *CloudAppUser) CreateUserApiRequest { + return CreateUserApiRequest{ + ApiService: a, + ctx: ctx, + cloudAppUser: cloudAppUser, + } +} + +// CreateUserExecute executes the request +// +// @return CloudAppUser +func (a *MongoDBCloudUsersApiService) CreateUserExecute(r CreateUserApiRequest) (*CloudAppUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *CloudAppUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.CreateUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cloudAppUser == nil { + return localVarReturnValue, nil, reportError("cloudAppUser is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2023-01-01+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.cloudAppUser + 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 GetOrganizationUserApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + orgId string + userId string +} + +type GetOrganizationUserApiParams struct { + OrgId string + UserId string +} + +func (a *MongoDBCloudUsersApiService) GetOrganizationUserWithParams(ctx context.Context, args *GetOrganizationUserApiParams) GetOrganizationUserApiRequest { + return GetOrganizationUserApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + userId: args.UserId, + } +} + +func (r GetOrganizationUserApiRequest) Execute() (*OrgUserResponse, *http.Response, error) { + return r.ApiService.GetOrganizationUserExecute(r) +} + +/* +GetOrganizationUser Return One MongoDB Cloud User in One Organization + +Returns information about the specified MongoDB Cloud user within the context of the specified organization. To use this resource, the requesting API Key must have the Organization Read Only role. + +**Note**: This resource can only be used to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + +**Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + @return GetOrganizationUserApiRequest +*/ +func (a *MongoDBCloudUsersApiService) GetOrganizationUser(ctx context.Context, orgId string, userId string) GetOrganizationUserApiRequest { + return GetOrganizationUserApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + userId: userId, + } +} + +// GetOrganizationUserExecute executes the request +// +// @return OrgUserResponse +func (a *MongoDBCloudUsersApiService) GetOrganizationUserExecute(r GetOrganizationUserApiRequest) (*OrgUserResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *OrgUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.GetOrganizationUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(r.userId), -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 (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+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 GetProjectUserApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + groupId string + userId string +} + +type GetProjectUserApiParams struct { + GroupId string + UserId string +} + +func (a *MongoDBCloudUsersApiService) GetProjectUserWithParams(ctx context.Context, args *GetProjectUserApiParams) GetProjectUserApiRequest { + return GetProjectUserApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + userId: args.UserId, + } +} + +func (r GetProjectUserApiRequest) Execute() (*GroupUserResponse, *http.Response, error) { + return r.ApiService.GetProjectUserExecute(r) +} + +/* +GetProjectUser Return One MongoDB Cloud User in One Project + +Returns information about the specified MongoDB Cloud user within the context of the specified project. To use this resource, the requesting API Key must have the Group Read Only role. + +**Note**: You can only use this resource to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + +**Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the project. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Project resource and filter by username. + @return GetProjectUserApiRequest +*/ +func (a *MongoDBCloudUsersApiService) GetProjectUser(ctx context.Context, groupId string, userId string) GetProjectUserApiRequest { + return GetProjectUserApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + userId: userId, + } +} + +// GetProjectUserExecute executes the request +// +// @return GroupUserResponse +func (a *MongoDBCloudUsersApiService) GetProjectUserExecute(r GetProjectUserApiRequest) (*GroupUserResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *GroupUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.GetProjectUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(r.userId), -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 (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+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 GetUserApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + userId string +} + +type GetUserApiParams struct { + UserId string +} + +func (a *MongoDBCloudUsersApiService) GetUserWithParams(ctx context.Context, args *GetUserApiParams) GetUserApiRequest { + return GetUserApiRequest{ + ApiService: a, + ctx: ctx, + userId: args.UserId, + } +} + +func (r GetUserApiRequest) Execute() (*CloudAppUser, *http.Response, error) { + return r.ApiService.GetUserExecute(r) +} + +/* +GetUser Return One MongoDB Cloud User using Its ID + +Returns the details for one MongoDB Cloud user account with the specified unique identifier for the user. You can't use this endpoint to return information on an API Key. To return information about an API Key, use the [Return One Organization](#tag/Organizations/operation/getOrganization) API Key endpoint. You can always retrieve your own user account. If you are the owner of a MongoDB Cloud organization or project, you can also retrieve the user profile for any user with membership in that organization or project. To use this resource, the requesting API Key can have any role. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userId Unique 24-hexadecimal digit string that identifies this user. + @return GetUserApiRequest +*/ +func (a *MongoDBCloudUsersApiService) GetUser(ctx context.Context, userId string) GetUserApiRequest { + return GetUserApiRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + } +} + +// GetUserExecute executes the request +// +// @return CloudAppUser +func (a *MongoDBCloudUsersApiService) GetUserExecute(r GetUserApiRequest) (*CloudAppUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *CloudAppUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.GetUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(r.userId), -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 (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+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 GetUserByUsernameApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + userName string +} + +type GetUserByUsernameApiParams struct { + UserName string +} + +func (a *MongoDBCloudUsersApiService) GetUserByUsernameWithParams(ctx context.Context, args *GetUserByUsernameApiParams) GetUserByUsernameApiRequest { + return GetUserByUsernameApiRequest{ + ApiService: a, + ctx: ctx, + userName: args.UserName, + } +} + +func (r GetUserByUsernameApiRequest) Execute() (*CloudAppUser, *http.Response, error) { + return r.ApiService.GetUserByUsernameExecute(r) +} + +/* +GetUserByUsername Return One MongoDB Cloud User using Their Username + +Returns the details for one MongoDB Cloud user account with the specified username. You can't use this endpoint to return information about an API Key. To return information about an API Key, use the [Return One Organization](#tag/Organizations/operation/getOrganization) API Key endpoint. To use this resource, the requesting API Key can have any role. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userName Email address that belongs to the MongoDB Cloud user account. You cannot modify this address after creating the user. + @return GetUserByUsernameApiRequest +*/ +func (a *MongoDBCloudUsersApiService) GetUserByUsername(ctx context.Context, userName string) GetUserByUsernameApiRequest { + return GetUserByUsernameApiRequest{ + ApiService: a, + ctx: ctx, + userName: userName, + } +} + +// GetUserByUsernameExecute executes the request +// +// @return CloudAppUser +func (a *MongoDBCloudUsersApiService) GetUserByUsernameExecute(r GetUserByUsernameApiRequest) (*CloudAppUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *CloudAppUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.GetUserByUsername") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/users/byName/{userName}" + localVarPath = strings.Replace(localVarPath, "{"+"userName"+"}", url.PathEscape(r.userName), -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 (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+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 RemoveOrganizationRoleApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + orgId string + userId string + addOrRemoveOrgRole *AddOrRemoveOrgRole +} + +type RemoveOrganizationRoleApiParams struct { + OrgId string + UserId string + AddOrRemoveOrgRole *AddOrRemoveOrgRole +} + +func (a *MongoDBCloudUsersApiService) RemoveOrganizationRoleWithParams(ctx context.Context, args *RemoveOrganizationRoleApiParams) RemoveOrganizationRoleApiRequest { + return RemoveOrganizationRoleApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + userId: args.UserId, + addOrRemoveOrgRole: args.AddOrRemoveOrgRole, + } +} + +func (r RemoveOrganizationRoleApiRequest) Execute() (*OrgUserResponse, *http.Response, error) { + return r.ApiService.RemoveOrganizationRoleExecute(r) +} + +/* +RemoveOrganizationRole Remove One Organization Role from One MongoDB Cloud User + +Removes one organization-level role from the MongoDB Cloud user. You can remove a role from an active user or a user that has not yet accepted the invitation to join the organization. To replace a user's only role, add the new role before removing the old role. A user must have at least one role at all times. To use this resource, the requesting API Key must have the Organization Owner role. + +**Note**: This operation is atomic. + +**Note**: This resource cannot be used to remove a role from users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + @return RemoveOrganizationRoleApiRequest +*/ +func (a *MongoDBCloudUsersApiService) RemoveOrganizationRole(ctx context.Context, orgId string, userId string, addOrRemoveOrgRole *AddOrRemoveOrgRole) RemoveOrganizationRoleApiRequest { + return RemoveOrganizationRoleApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + userId: userId, + addOrRemoveOrgRole: addOrRemoveOrgRole, + } +} + +// RemoveOrganizationRoleExecute executes the request +// +// @return OrgUserResponse +func (a *MongoDBCloudUsersApiService) RemoveOrganizationRoleExecute(r RemoveOrganizationRoleApiRequest) (*OrgUserResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *OrgUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.RemoveOrganizationRole") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(r.userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.addOrRemoveOrgRole == nil { + return localVarReturnValue, nil, reportError("addOrRemoveOrgRole is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2025-01-01+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addOrRemoveOrgRole + 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 RemoveUserFromTeamApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + orgId string + teamId string + addOrRemoveUserFromTeam *AddOrRemoveUserFromTeam +} + +type RemoveUserFromTeamApiParams struct { + OrgId string + TeamId string + AddOrRemoveUserFromTeam *AddOrRemoveUserFromTeam +} + +func (a *MongoDBCloudUsersApiService) RemoveUserFromTeamWithParams(ctx context.Context, args *RemoveUserFromTeamApiParams) RemoveUserFromTeamApiRequest { + return RemoveUserFromTeamApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + teamId: args.TeamId, + addOrRemoveUserFromTeam: args.AddOrRemoveUserFromTeam, + } +} + +func (r RemoveUserFromTeamApiRequest) Execute() (*OrgUserResponse, *http.Response, error) { + return r.ApiService.RemoveUserFromTeamExecute(r) +} + +/* +RemoveUserFromTeam Remove One MongoDB Cloud User from One Team + +Removes one MongoDB Cloud user from one team. You can remove an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + +**Note**: This resource cannot be used to remove a user invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 teamId Unique 24-hexadecimal digit string that identifies the team to remove the MongoDB user from. + @return RemoveUserFromTeamApiRequest +*/ +func (a *MongoDBCloudUsersApiService) RemoveUserFromTeam(ctx context.Context, orgId string, teamId string, addOrRemoveUserFromTeam *AddOrRemoveUserFromTeam) RemoveUserFromTeamApiRequest { + return RemoveUserFromTeamApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + teamId: teamId, + addOrRemoveUserFromTeam: addOrRemoveUserFromTeam, + } +} + +// RemoveUserFromTeamExecute executes the request +// +// @return OrgUserResponse +func (a *MongoDBCloudUsersApiService) RemoveUserFromTeamExecute(r RemoveUserFromTeamApiRequest) (*OrgUserResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *OrgUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.RemoveUserFromTeam") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/teams/{teamId}:removeUser" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"teamId"+"}", url.PathEscape(r.teamId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.addOrRemoveUserFromTeam == nil { + return localVarReturnValue, nil, reportError("addOrRemoveUserFromTeam is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2025-01-01+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addOrRemoveUserFromTeam + 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 UpdateOrganizationUserApiRequest struct { + ctx context.Context + ApiService MongoDBCloudUsersApi + orgId string + userId string + orgUserUpdateRequest *OrgUserUpdateRequest +} + +type UpdateOrganizationUserApiParams struct { + OrgId string + UserId string + OrgUserUpdateRequest *OrgUserUpdateRequest +} + +func (a *MongoDBCloudUsersApiService) UpdateOrganizationUserWithParams(ctx context.Context, args *UpdateOrganizationUserApiParams) UpdateOrganizationUserApiRequest { + return UpdateOrganizationUserApiRequest{ + ApiService: a, + ctx: ctx, + orgId: args.OrgId, + userId: args.UserId, + orgUserUpdateRequest: args.OrgUserUpdateRequest, + } +} + +func (r UpdateOrganizationUserApiRequest) Execute() (*OrgUserResponse, *http.Response, error) { + return r.ApiService.UpdateOrganizationUserExecute(r) +} + +/* +UpdateOrganizationUser Update One MongoDB Cloud User in One Organization + +Updates one MongoDB Cloud user in the specified organization. You can update an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + +**Note**: Only include the fields you wish to update in the request body. Supplying a field with an empty value will reset that field on the user. + +**Note**: This resource cannot be used to update pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + @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 userId Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + @return UpdateOrganizationUserApiRequest +*/ +func (a *MongoDBCloudUsersApiService) UpdateOrganizationUser(ctx context.Context, orgId string, userId string, orgUserUpdateRequest *OrgUserUpdateRequest) UpdateOrganizationUserApiRequest { + return UpdateOrganizationUserApiRequest{ + ApiService: a, + ctx: ctx, + orgId: orgId, + userId: userId, + orgUserUpdateRequest: orgUserUpdateRequest, + } +} + +// UpdateOrganizationUserExecute executes the request +// +// @return OrgUserResponse +func (a *MongoDBCloudUsersApiService) UpdateOrganizationUserExecute(r UpdateOrganizationUserApiRequest) (*OrgUserResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody any + formFiles []formFile + localVarReturnValue *OrgUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MongoDBCloudUsersApiService.UpdateOrganizationUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/orgs/{orgId}/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(r.orgId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(r.userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.orgUserUpdateRequest == nil { + return localVarReturnValue, nil, reportError("orgUserUpdateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2025-01-01+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.orgUserUpdateRequest req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err diff --git a/admin/api_open_api.go b/admin/api_open_api.go new file mode 100644 index 000000000..dddb1d9a3 --- /dev/null +++ b/admin/api_open_api.go @@ -0,0 +1,187 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +import ( + "context" + "io" + "net/http" + "net/url" +) + +type OpenAPIApi interface { + + /* + GetApiVersions Provides a list of versions for a given environment. + + API that provides a list of available versionsfor a given environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return GetApiVersionsApiRequest + */ + GetApiVersions(ctx context.Context) GetApiVersionsApiRequest + /* + GetApiVersions Provides a list of versions for a given environment. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param GetApiVersionsApiParams - Parameters for the request + @return GetApiVersionsApiRequest + */ + GetApiVersionsWithParams(ctx context.Context, args *GetApiVersionsApiParams) GetApiVersionsApiRequest + + // Method available only for mocking purposes + GetApiVersionsExecute(r GetApiVersionsApiRequest) (*PaginatedApiVersions, *http.Response, error) +} + +// OpenAPIApiService OpenAPIApi service +type OpenAPIApiService service + +type GetApiVersionsApiRequest struct { + ctx context.Context + ApiService OpenAPIApi + itemsPerPage *int + pageNum *int + env *string +} + +type GetApiVersionsApiParams struct { + ItemsPerPage *int + PageNum *int + Env *string +} + +func (a *OpenAPIApiService) GetApiVersionsWithParams(ctx context.Context, args *GetApiVersionsApiParams) GetApiVersionsApiRequest { + return GetApiVersionsApiRequest{ + ApiService: a, + ctx: ctx, + itemsPerPage: args.ItemsPerPage, + pageNum: args.PageNum, + env: args.Env, + } +} + +// Number of items that the response returns per page. +func (r GetApiVersionsApiRequest) ItemsPerPage(itemsPerPage int) GetApiVersionsApiRequest { + r.itemsPerPage = &itemsPerPage + return r +} + +// Number of the page that displays the current set of the total objects that the response returns. +func (r GetApiVersionsApiRequest) PageNum(pageNum int) GetApiVersionsApiRequest { + r.pageNum = &pageNum + return r +} + +// The environment to get the versions from. If not provided, it returnsthe versions for the given MongoDB URL. (E.g. prod for cloud.mongodb.com) +func (r GetApiVersionsApiRequest) Env(env string) GetApiVersionsApiRequest { + r.env = &env + return r +} + +func (r GetApiVersionsApiRequest) Execute() (*PaginatedApiVersions, *http.Response, error) { + return r.ApiService.GetApiVersionsExecute(r) +} + +/* +GetApiVersions Provides a list of versions for a given environment. + +API that provides a list of available versionsfor a given environment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return GetApiVersionsApiRequest +*/ +func (a *OpenAPIApiService) GetApiVersions(ctx context.Context) GetApiVersionsApiRequest { + return GetApiVersionsApiRequest{ + ApiService: a, + ctx: ctx, + } +} + +// GetApiVersionsExecute executes the request +// +// @return PaginatedApiVersions +func (a *OpenAPIApiService) GetApiVersionsExecute(r GetApiVersionsApiRequest) (*PaginatedApiVersions, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *PaginatedApiVersions + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OpenAPIApiService.GetApiVersions") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/unauth/openapi/versions" + + 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, "") + } + if r.env != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "env", r.env, "") + } + // 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 (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+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 +} diff --git a/admin/api_organizations.go b/admin/api_organizations.go index a2c9a7abc..44fe4744d 100644 --- a/admin/api_organizations.go +++ b/admin/api_organizations.go @@ -236,7 +236,7 @@ type OrganizationsApi interface { /* ListOrganizationUsers Return All MongoDB Cloud Users in One Organization - Returns details about the MongoDB Cloud users associated with the specified organization. Each MongoDB Cloud user returned must belong to the specified organization or to a project within the specified organization. To use this resource, the requesting API Key must have the Organization Member role. + Returns details about the MongoDB Cloud users associated with the specified organization. Each MongoDB Cloud user returned must belong to the specified organization or to a project within the specified organization. To use this resource, the requesting API Key must have the Organization Member role. Deprecated versions: v2-{2023-01-01} @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. @@ -254,7 +254,7 @@ type OrganizationsApi interface { ListOrganizationUsersWithParams(ctx context.Context, args *ListOrganizationUsersApiParams) ListOrganizationUsersApiRequest // Method available only for mocking purposes - ListOrganizationUsersExecute(r ListOrganizationUsersApiRequest) (*PaginatedAppUser, *http.Response, error) + ListOrganizationUsersExecute(r ListOrganizationUsersApiRequest) (*PaginatedOrgUser, *http.Response, error) /* ListOrganizations Return All Organizations @@ -281,7 +281,7 @@ type OrganizationsApi interface { /* RemoveOrganizationUser Remove One MongoDB Cloud User From One Organization - Removes one MongoDB Cloud user from the specified organization. To use this resource, the requesting API Key must have the Organization User Admin role. + Removes one MongoDB Cloud user from the specified organization. To use this resource, the requesting API Key must have the Organization User Admin role. Deprecated versions: v2-{2023-01-01} @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. @@ -1580,14 +1580,14 @@ func (r ListOrganizationUsersApiRequest) PageNum(pageNum int) ListOrganizationUs return r } -func (r ListOrganizationUsersApiRequest) Execute() (*PaginatedAppUser, *http.Response, error) { +func (r ListOrganizationUsersApiRequest) Execute() (*PaginatedOrgUser, *http.Response, error) { return r.ApiService.ListOrganizationUsersExecute(r) } /* ListOrganizationUsers Return All MongoDB Cloud Users in One Organization -Returns details about the MongoDB Cloud users associated with the specified organization. Each MongoDB Cloud user returned must belong to the specified organization or to a project within the specified organization. To use this resource, the requesting API Key must have the Organization Member role. +Returns details about the MongoDB Cloud users associated with the specified organization. Each MongoDB Cloud user returned must belong to the specified organization or to a project within the specified organization. To use this resource, the requesting API Key must have the Organization Member role. Deprecated versions: v2-{2023-01-01} @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. @@ -1603,13 +1603,13 @@ func (a *OrganizationsApiService) ListOrganizationUsers(ctx context.Context, org // ListOrganizationUsersExecute executes the request // -// @return PaginatedAppUser -func (a *OrganizationsApiService) ListOrganizationUsersExecute(r ListOrganizationUsersApiRequest) (*PaginatedAppUser, *http.Response, error) { +// @return PaginatedOrgUser +func (a *OrganizationsApiService) ListOrganizationUsersExecute(r ListOrganizationUsersApiRequest) (*PaginatedOrgUser, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody any formFiles []formFile - localVarReturnValue *PaginatedAppUser + localVarReturnValue *PaginatedOrgUser ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.ListOrganizationUsers") @@ -1655,7 +1655,7 @@ func (a *OrganizationsApiService) ListOrganizationUsersExecute(r ListOrganizatio } // to determine the Accept header (only first one) - localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json"} + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1887,7 +1887,7 @@ func (r RemoveOrganizationUserApiRequest) Execute() (any, *http.Response, error) /* RemoveOrganizationUser Remove One MongoDB Cloud User From One Organization -Removes one MongoDB Cloud user from the specified organization. To use this resource, the requesting API Key must have the Organization User Admin role. +Removes one MongoDB Cloud user from the specified organization. To use this resource, the requesting API Key must have the Organization User Admin role. Deprecated versions: v2-{2023-01-01} @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. @@ -1937,7 +1937,7 @@ func (a *OrganizationsApiService) RemoveOrganizationUserExecute(r RemoveOrganiza } // to determine the Accept header (only first one) - localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json"} + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) diff --git a/admin/api_performance_advisor.go b/admin/api_performance_advisor.go index 6aaf27d11..c10d54919 100644 --- a/admin/api_performance_advisor.go +++ b/admin/api_performance_advisor.go @@ -106,6 +106,78 @@ type PerformanceAdvisorApi interface { // Method available only for mocking purposes GetServerlessAutoIndexingExecute(r GetServerlessAutoIndexingApiRequest) (bool, *http.Response, error) + /* + ListClusterSuggestedIndexes Return Suggested Indexes + + Returns the indexes that the Performance Advisor suggests. The Performance Advisor monitors queries that MongoDB considers slow and suggests new indexes to improve query performance. To use this resource, the requesting API Key must have the Project Read Only role. + + @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 clusterName Human-readable label that identifies the cluster. + @return ListClusterSuggestedIndexesApiRequest + */ + ListClusterSuggestedIndexes(ctx context.Context, groupId string, clusterName string) ListClusterSuggestedIndexesApiRequest + /* + ListClusterSuggestedIndexes Return Suggested Indexes + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ListClusterSuggestedIndexesApiParams - Parameters for the request + @return ListClusterSuggestedIndexesApiRequest + */ + ListClusterSuggestedIndexesWithParams(ctx context.Context, args *ListClusterSuggestedIndexesApiParams) ListClusterSuggestedIndexesApiRequest + + // Method available only for mocking purposes + ListClusterSuggestedIndexesExecute(r ListClusterSuggestedIndexesApiRequest) (*PerformanceAdvisorResponse, *http.Response, error) + + /* + ListDropIndexes Returns Suggested Indexes to Drop + + Returns the indexes that the Performance Advisor suggests to drop. The Performance Advisor suggests dropping unused, redundant, and hidden indexes to improve write performance and increase storage space. To use this resource, the requesting API Key must have the Project Read Only role. + + @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 clusterName Human-readable label that identifies the cluster. + @return ListDropIndexesApiRequest + */ + ListDropIndexes(ctx context.Context, groupId string, clusterName string) ListDropIndexesApiRequest + /* + ListDropIndexes Returns Suggested Indexes to Drop + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ListDropIndexesApiParams - Parameters for the request + @return ListDropIndexesApiRequest + */ + ListDropIndexesWithParams(ctx context.Context, args *ListDropIndexesApiParams) ListDropIndexesApiRequest + + // Method available only for mocking purposes + ListDropIndexesExecute(r ListDropIndexesApiRequest) (*PerformanceAdvisorResponse, *http.Response, error) + + /* + ListSchemaAdvice Return Schema Advice + + Returns the schema suggestions that the Performance Advisor detects. The Performance Advisor provides holistic schema recommendations for your cluster by sampling documents in your most active collections and collections with slow-running queries. To use this resource, the requesting API Key must have the Project Read Only role. + + @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 clusterName Human-readable label that identifies the cluster. + @return ListSchemaAdviceApiRequest + */ + ListSchemaAdvice(ctx context.Context, groupId string, clusterName string) ListSchemaAdviceApiRequest + /* + ListSchemaAdvice Return Schema Advice + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ListSchemaAdviceApiParams - Parameters for the request + @return ListSchemaAdviceApiRequest + */ + ListSchemaAdviceWithParams(ctx context.Context, args *ListSchemaAdviceApiParams) ListSchemaAdviceApiRequest + + // Method available only for mocking purposes + ListSchemaAdviceExecute(r ListSchemaAdviceApiRequest) (*PerformanceAdvisorResponse, *http.Response, error) + /* ListSlowQueries Return Slow Queries @@ -605,6 +677,413 @@ func (a *PerformanceAdvisorApiService) GetServerlessAutoIndexingExecute(r GetSer return localVarReturnValue, localVarHTTPResponse, nil } +type ListClusterSuggestedIndexesApiRequest struct { + ctx context.Context + ApiService PerformanceAdvisorApi + groupId string + clusterName string + processIds *[]string + namespaces *[]string + since *int64 + until *int64 +} + +type ListClusterSuggestedIndexesApiParams struct { + GroupId string + ClusterName string + ProcessIds *[]string + Namespaces *[]string + Since *int64 + Until *int64 +} + +func (a *PerformanceAdvisorApiService) ListClusterSuggestedIndexesWithParams(ctx context.Context, args *ListClusterSuggestedIndexesApiParams) ListClusterSuggestedIndexesApiRequest { + return ListClusterSuggestedIndexesApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + clusterName: args.ClusterName, + processIds: args.ProcessIds, + namespaces: args.Namespaces, + since: args.Since, + until: args.Until, + } +} + +// ProcessIds from which to retrieve suggested indexes. A processId is a combination of host and port that serves the MongoDB process. The host must be the hostname, FQDN, IPv4 address, or IPv6 address of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. To include multiple processIds, pass the parameter multiple times delimited with an ampersand (`&`) between each processId. +func (r ListClusterSuggestedIndexesApiRequest) ProcessIds(processIds []string) ListClusterSuggestedIndexesApiRequest { + r.processIds = &processIds + return r +} + +// Namespaces from which to retrieve suggested indexes. A namespace consists of one database and one collection resource written as `.`: `<database>.<collection>`. To include multiple namespaces, pass the parameter multiple times delimited with an ampersand (`&`) between each namespace. Omit this parameter to return results for all namespaces. +func (r ListClusterSuggestedIndexesApiRequest) Namespaces(namespaces []string) ListClusterSuggestedIndexesApiRequest { + r.namespaces = &namespaces + return r +} + +// Date and time from which the query retrieves the suggested indexes. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). - If you don't specify the **until** parameter, the endpoint returns data covering from the **since** value and the current time. - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours. +func (r ListClusterSuggestedIndexesApiRequest) Since(since int64) ListClusterSuggestedIndexesApiRequest { + r.since = &since + return r +} + +// Date and time up until which the query retrieves the suggested indexes. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). - If you specify the **until** parameter, you must specify the **since** parameter. - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours. +func (r ListClusterSuggestedIndexesApiRequest) Until(until int64) ListClusterSuggestedIndexesApiRequest { + r.until = &until + return r +} + +func (r ListClusterSuggestedIndexesApiRequest) Execute() (*PerformanceAdvisorResponse, *http.Response, error) { + return r.ApiService.ListClusterSuggestedIndexesExecute(r) +} + +/* +ListClusterSuggestedIndexes Return Suggested Indexes + +Returns the indexes that the Performance Advisor suggests. The Performance Advisor monitors queries that MongoDB considers slow and suggests new indexes to improve query performance. To use this resource, the requesting API Key must have the Project Read Only role. + + @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 clusterName Human-readable label that identifies the cluster. + @return ListClusterSuggestedIndexesApiRequest +*/ +func (a *PerformanceAdvisorApiService) ListClusterSuggestedIndexes(ctx context.Context, groupId string, clusterName string) ListClusterSuggestedIndexesApiRequest { + return ListClusterSuggestedIndexesApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + clusterName: clusterName, + } +} + +// ListClusterSuggestedIndexesExecute executes the request +// +// @return PerformanceAdvisorResponse +func (a *PerformanceAdvisorApiService) ListClusterSuggestedIndexesExecute(r ListClusterSuggestedIndexesApiRequest) (*PerformanceAdvisorResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *PerformanceAdvisorResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PerformanceAdvisorApiService.ListClusterSuggestedIndexes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/suggestedIndexes" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(r.clusterName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.processIds != nil { + t := *r.processIds + // Workaround for unused import + _ = reflect.Append + parameterAddToHeaderOrQuery(localVarQueryParams, "processIds", t, "multi") + + } + if r.namespaces != nil { + t := *r.namespaces + // Workaround for unused import + _ = reflect.Append + parameterAddToHeaderOrQuery(localVarQueryParams, "namespaces", t, "multi") + + } + if r.since != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "since", r.since, "") + } + if r.until != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "until", r.until, "") + } + // 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 (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+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 ListDropIndexesApiRequest struct { + ctx context.Context + ApiService PerformanceAdvisorApi + groupId string + clusterName string +} + +type ListDropIndexesApiParams struct { + GroupId string + ClusterName string +} + +func (a *PerformanceAdvisorApiService) ListDropIndexesWithParams(ctx context.Context, args *ListDropIndexesApiParams) ListDropIndexesApiRequest { + return ListDropIndexesApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + clusterName: args.ClusterName, + } +} + +func (r ListDropIndexesApiRequest) Execute() (*PerformanceAdvisorResponse, *http.Response, error) { + return r.ApiService.ListDropIndexesExecute(r) +} + +/* +ListDropIndexes Returns Suggested Indexes to Drop + +Returns the indexes that the Performance Advisor suggests to drop. The Performance Advisor suggests dropping unused, redundant, and hidden indexes to improve write performance and increase storage space. To use this resource, the requesting API Key must have the Project Read Only role. + + @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 clusterName Human-readable label that identifies the cluster. + @return ListDropIndexesApiRequest +*/ +func (a *PerformanceAdvisorApiService) ListDropIndexes(ctx context.Context, groupId string, clusterName string) ListDropIndexesApiRequest { + return ListDropIndexesApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + clusterName: clusterName, + } +} + +// ListDropIndexesExecute executes the request +// +// @return PerformanceAdvisorResponse +func (a *PerformanceAdvisorApiService) ListDropIndexesExecute(r ListDropIndexesApiRequest) (*PerformanceAdvisorResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *PerformanceAdvisorResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PerformanceAdvisorApiService.ListDropIndexes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/dropIndexSuggestions" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(r.clusterName), -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 (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+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 ListSchemaAdviceApiRequest struct { + ctx context.Context + ApiService PerformanceAdvisorApi + groupId string + clusterName string +} + +type ListSchemaAdviceApiParams struct { + GroupId string + ClusterName string +} + +func (a *PerformanceAdvisorApiService) ListSchemaAdviceWithParams(ctx context.Context, args *ListSchemaAdviceApiParams) ListSchemaAdviceApiRequest { + return ListSchemaAdviceApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + clusterName: args.ClusterName, + } +} + +func (r ListSchemaAdviceApiRequest) Execute() (*PerformanceAdvisorResponse, *http.Response, error) { + return r.ApiService.ListSchemaAdviceExecute(r) +} + +/* +ListSchemaAdvice Return Schema Advice + +Returns the schema suggestions that the Performance Advisor detects. The Performance Advisor provides holistic schema recommendations for your cluster by sampling documents in your most active collections and collections with slow-running queries. To use this resource, the requesting API Key must have the Project Read Only role. + + @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 clusterName Human-readable label that identifies the cluster. + @return ListSchemaAdviceApiRequest +*/ +func (a *PerformanceAdvisorApiService) ListSchemaAdvice(ctx context.Context, groupId string, clusterName string) ListSchemaAdviceApiRequest { + return ListSchemaAdviceApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + clusterName: clusterName, + } +} + +// ListSchemaAdviceExecute executes the request +// +// @return PerformanceAdvisorResponse +func (a *PerformanceAdvisorApiService) ListSchemaAdviceExecute(r ListSchemaAdviceApiRequest) (*PerformanceAdvisorResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *PerformanceAdvisorResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PerformanceAdvisorApiService.ListSchemaAdvice") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clusterName"+"}", url.PathEscape(r.clusterName), -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 (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-08-05+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 ListSlowQueriesApiRequest struct { ctx context.Context ApiService PerformanceAdvisorApi diff --git a/admin/api_projects.go b/admin/api_projects.go index 32a66f0e5..96259bca0 100644 --- a/admin/api_projects.go +++ b/admin/api_projects.go @@ -428,7 +428,7 @@ type ProjectsApi interface { /* RemoveProjectUser Remove One User from One Project - Removes the specified user from the specified project. To use this resource, the requesting API Key must have the Project Owner role. + Removes the specified user from the specified project. To use this resource, the requesting API Key must have the Project Owner role. Deprecated versions: v2-{2023-01-01} @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. @@ -447,7 +447,7 @@ type ProjectsApi interface { RemoveProjectUserWithParams(ctx context.Context, args *RemoveProjectUserApiParams) RemoveProjectUserApiRequest // Method available only for mocking purposes - RemoveProjectUserExecute(r RemoveProjectUserApiRequest) (*http.Response, error) + RemoveProjectUserExecute(r RemoveProjectUserApiRequest) (any, *http.Response, error) /* ReturnAllIpAddresses Return All IP Addresses for One Project @@ -2825,14 +2825,14 @@ func (a *ProjectsApiService) RemoveProjectUserWithParams(ctx context.Context, ar } } -func (r RemoveProjectUserApiRequest) Execute() (*http.Response, error) { +func (r RemoveProjectUserApiRequest) Execute() (any, *http.Response, error) { return r.ApiService.RemoveProjectUserExecute(r) } /* RemoveProjectUser Remove One User from One Project -Removes the specified user from the specified project. To use this resource, the requesting API Key must have the Project Owner role. +Removes the specified user from the specified project. To use this resource, the requesting API Key must have the Project Owner role. Deprecated versions: v2-{2023-01-01} @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. @@ -2849,16 +2849,19 @@ func (a *ProjectsApiService) RemoveProjectUser(ctx context.Context, groupId stri } // RemoveProjectUserExecute executes the request -func (a *ProjectsApiService) RemoveProjectUserExecute(r RemoveProjectUserApiRequest) (*http.Response, error) { +// +// @return any +func (a *ProjectsApiService) RemoveProjectUserExecute(r RemoveProjectUserApiRequest) (any, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody any - formFiles []formFile + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + localVarReturnValue any ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.RemoveProjectUser") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/users/{userId}" @@ -2879,7 +2882,7 @@ func (a *ProjectsApiService) RemoveProjectUserExecute(r RemoveProjectUserApiRequ } // to determine the Accept header (only first one) - localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json"} + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -2888,20 +2891,34 @@ func (a *ProjectsApiService) RemoveProjectUserExecute(r RemoveProjectUserApiRequ } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := a.client.makeApiError(localVarHTTPResponse, localVarHTTPMethod, localVarPath) - return localVarHTTPResponse, newErr + 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 localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } type ReturnAllIpAddressesApiRequest struct { diff --git a/admin/api_streams.go b/admin/api_streams.go index 34bf3d4e3..01abe866d 100644 --- a/admin/api_streams.go +++ b/admin/api_streams.go @@ -543,6 +543,32 @@ type StreamsApi interface { // Method available only for mocking purposes ListStreamProcessorsExecute(r ListStreamProcessorsApiRequest) (*PaginatedApiStreamsStreamProcessorWithStats, *http.Response, error) + /* + ModifyStreamProcessor Modify One Stream Processor + + Modify one existing Stream Processor within the specified stream instance. To use this resource, the requesting API Key must have the Project Owner role or Project Stream Processing Owner role. + + @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 tenantName Human-readable label that identifies the stream instance. + @param processorName Human-readable label that identifies the stream processor. + @param streamsModifyStreamProcessor Modifications to apply to the stream processor. + @return ModifyStreamProcessorApiRequest + */ + ModifyStreamProcessor(ctx context.Context, groupId string, tenantName string, processorName string, streamsModifyStreamProcessor *StreamsModifyStreamProcessor) ModifyStreamProcessorApiRequest + /* + ModifyStreamProcessor Modify One Stream Processor + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ModifyStreamProcessorApiParams - Parameters for the request + @return ModifyStreamProcessorApiRequest + */ + ModifyStreamProcessorWithParams(ctx context.Context, args *ModifyStreamProcessorApiParams) ModifyStreamProcessorApiRequest + + // Method available only for mocking purposes + ModifyStreamProcessorExecute(r ModifyStreamProcessorApiRequest) (*StreamsProcessorWithStats, *http.Response, error) + /* RejectVpcPeeringConnection Requests the rejection of an incoming VPC Peering connection. @@ -3499,6 +3525,138 @@ func (a *StreamsApiService) ListStreamProcessorsExecute(r ListStreamProcessorsAp return localVarReturnValue, localVarHTTPResponse, nil } +type ModifyStreamProcessorApiRequest struct { + ctx context.Context + ApiService StreamsApi + groupId string + tenantName string + processorName string + streamsModifyStreamProcessor *StreamsModifyStreamProcessor +} + +type ModifyStreamProcessorApiParams struct { + GroupId string + TenantName string + ProcessorName string + StreamsModifyStreamProcessor *StreamsModifyStreamProcessor +} + +func (a *StreamsApiService) ModifyStreamProcessorWithParams(ctx context.Context, args *ModifyStreamProcessorApiParams) ModifyStreamProcessorApiRequest { + return ModifyStreamProcessorApiRequest{ + ApiService: a, + ctx: ctx, + groupId: args.GroupId, + tenantName: args.TenantName, + processorName: args.ProcessorName, + streamsModifyStreamProcessor: args.StreamsModifyStreamProcessor, + } +} + +func (r ModifyStreamProcessorApiRequest) Execute() (*StreamsProcessorWithStats, *http.Response, error) { + return r.ApiService.ModifyStreamProcessorExecute(r) +} + +/* +ModifyStreamProcessor Modify One Stream Processor + +Modify one existing Stream Processor within the specified stream instance. To use this resource, the requesting API Key must have the Project Owner role or Project Stream Processing Owner role. + + @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 tenantName Human-readable label that identifies the stream instance. + @param processorName Human-readable label that identifies the stream processor. + @return ModifyStreamProcessorApiRequest +*/ +func (a *StreamsApiService) ModifyStreamProcessor(ctx context.Context, groupId string, tenantName string, processorName string, streamsModifyStreamProcessor *StreamsModifyStreamProcessor) ModifyStreamProcessorApiRequest { + return ModifyStreamProcessorApiRequest{ + ApiService: a, + ctx: ctx, + groupId: groupId, + tenantName: tenantName, + processorName: processorName, + streamsModifyStreamProcessor: streamsModifyStreamProcessor, + } +} + +// ModifyStreamProcessorExecute executes the request +// +// @return StreamsProcessorWithStats +func (a *StreamsApiService) ModifyStreamProcessorExecute(r ModifyStreamProcessorApiRequest) (*StreamsProcessorWithStats, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody any + formFiles []formFile + localVarReturnValue *StreamsProcessorWithStats + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StreamsApiService.ModifyStreamProcessor") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}" + localVarPath = strings.Replace(localVarPath, "{"+"groupId"+"}", url.PathEscape(r.groupId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"tenantName"+"}", url.PathEscape(r.tenantName), -1) + localVarPath = strings.Replace(localVarPath, "{"+"processorName"+"}", url.PathEscape(r.processorName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.streamsModifyStreamProcessor == nil { + return localVarReturnValue, nil, reportError("streamsModifyStreamProcessor is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/vnd.atlas.2024-05-30+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header (only first one) + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2024-05-30+json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.streamsModifyStreamProcessor + 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 RejectVpcPeeringConnectionApiRequest struct { ctx context.Context ApiService StreamsApi diff --git a/admin/api_teams.go b/admin/api_teams.go index cd533871d..e273df280 100644 --- a/admin/api_teams.go +++ b/admin/api_teams.go @@ -206,7 +206,7 @@ type TeamsApi interface { /* ListTeamUsers Return All MongoDB Cloud Users Assigned to One Team - Returns all MongoDB Cloud users assigned to the team specified using its unique 24-hexadecimal digit identifier. This team belongs to one organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting API Key must have the Organization Member role. + Returns all MongoDB Cloud users assigned to the team specified using its unique 24-hexadecimal digit identifier. This team belongs to one organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting API Key must have the Organization Member role. Deprecated versions: v2-{2023-01-01} @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. @@ -225,7 +225,7 @@ type TeamsApi interface { ListTeamUsersWithParams(ctx context.Context, args *ListTeamUsersApiParams) ListTeamUsersApiRequest // Method available only for mocking purposes - ListTeamUsersExecute(r ListTeamUsersApiRequest) (*PaginatedAppUser, *http.Response, error) + ListTeamUsersExecute(r ListTeamUsersApiRequest) (*PaginatedOrgUser, *http.Response, error) /* RemoveProjectTeam Remove One Team from One Project @@ -1404,14 +1404,14 @@ func (r ListTeamUsersApiRequest) PageNum(pageNum int) ListTeamUsersApiRequest { return r } -func (r ListTeamUsersApiRequest) Execute() (*PaginatedAppUser, *http.Response, error) { +func (r ListTeamUsersApiRequest) Execute() (*PaginatedOrgUser, *http.Response, error) { return r.ApiService.ListTeamUsersExecute(r) } /* ListTeamUsers Return All MongoDB Cloud Users Assigned to One Team -Returns all MongoDB Cloud users assigned to the team specified using its unique 24-hexadecimal digit identifier. This team belongs to one organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting API Key must have the Organization Member role. +Returns all MongoDB Cloud users assigned to the team specified using its unique 24-hexadecimal digit identifier. This team belongs to one organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting API Key must have the Organization Member role. Deprecated versions: v2-{2023-01-01} @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. @@ -1429,13 +1429,13 @@ func (a *TeamsApiService) ListTeamUsers(ctx context.Context, orgId string, teamI // ListTeamUsersExecute executes the request // -// @return PaginatedAppUser -func (a *TeamsApiService) ListTeamUsersExecute(r ListTeamUsersApiRequest) (*PaginatedAppUser, *http.Response, error) { +// @return PaginatedOrgUser +func (a *TeamsApiService) ListTeamUsersExecute(r ListTeamUsersApiRequest) (*PaginatedOrgUser, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody any formFiles []formFile - localVarReturnValue *PaginatedAppUser + localVarReturnValue *PaginatedOrgUser ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TeamsApiService.ListTeamUsers") @@ -1475,7 +1475,7 @@ func (a *TeamsApiService) ListTeamUsersExecute(r ListTeamUsersApiRequest) (*Pagi } // to determine the Accept header (only first one) - localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2023-01-01+json"} + localVarHTTPHeaderAccepts := []string{"application/vnd.atlas.2025-01-01+json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) diff --git a/admin/atlas_client.go b/admin/atlas_client.go index 311c0b0b8..d15277975 100644 --- a/admin/atlas_client.go +++ b/admin/atlas_client.go @@ -1,4 +1,4 @@ -package admin // import "go.mongodb.org/atlas-sdk/v20241113001/admin" +package admin // import "github.com/mongodb/atlas-sdk-go/admin" import ( "context" @@ -7,9 +7,9 @@ import ( "strings" "github.com/mongodb-forks/digest" - "go.mongodb.org/atlas-sdk/v20241113001/auth" - "go.mongodb.org/atlas-sdk/v20241113001/auth/clientcredentials" - "go.mongodb.org/atlas-sdk/v20241113001/internal/core" + "github.com/mongodb/atlas-sdk-go/auth" + "github.com/mongodb/atlas-sdk-go/auth/clientcredentials" + "github.com/mongodb/atlas-sdk-go/internal/core" ) const ( diff --git a/admin/client.go b/admin/client.go index c09944c28..802d2070f 100644 --- a/admin/client.go +++ b/admin/client.go @@ -101,6 +101,8 @@ type APIClient struct { OnlineArchiveApi OnlineArchiveApi + OpenAPIApi OpenAPIApi + OrganizationsApi OrganizationsApi PerformanceAdvisorApi PerformanceAdvisorApi @@ -187,6 +189,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.MonitoringAndLogsApi = (*MonitoringAndLogsApiService)(&c.common) c.NetworkPeeringApi = (*NetworkPeeringApiService)(&c.common) c.OnlineArchiveApi = (*OnlineArchiveApiService)(&c.common) + c.OpenAPIApi = (*OpenAPIApiService)(&c.common) c.OrganizationsApi = (*OrganizationsApiService)(&c.common) c.PerformanceAdvisorApi = (*PerformanceAdvisorApiService)(&c.common) c.PrivateEndpointServicesApi = (*PrivateEndpointServicesApiService)(&c.common) diff --git a/admin/model_add_or_remove_group_role.go b/admin/model_add_or_remove_group_role.go new file mode 100644 index 000000000..aa625a076 --- /dev/null +++ b/admin/model_add_or_remove_group_role.go @@ -0,0 +1,51 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// AddOrRemoveGroupRole struct for AddOrRemoveGroupRole +type AddOrRemoveGroupRole struct { + // Project-level role. + GroupRole string `json:"groupRole"` +} + +// NewAddOrRemoveGroupRole instantiates a new AddOrRemoveGroupRole 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 NewAddOrRemoveGroupRole(groupRole string) *AddOrRemoveGroupRole { + this := AddOrRemoveGroupRole{} + this.GroupRole = groupRole + return &this +} + +// NewAddOrRemoveGroupRoleWithDefaults instantiates a new AddOrRemoveGroupRole 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 NewAddOrRemoveGroupRoleWithDefaults() *AddOrRemoveGroupRole { + this := AddOrRemoveGroupRole{} + return &this +} + +// GetGroupRole returns the GroupRole field value +func (o *AddOrRemoveGroupRole) GetGroupRole() string { + if o == nil { + var ret string + return ret + } + + return o.GroupRole +} + +// GetGroupRoleOk returns a tuple with the GroupRole field value +// and a boolean to check if the value has been set. +func (o *AddOrRemoveGroupRole) GetGroupRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GroupRole, true +} + +// SetGroupRole sets field value +func (o *AddOrRemoveGroupRole) SetGroupRole(v string) { + o.GroupRole = v +} diff --git a/admin/model_add_or_remove_org_role.go b/admin/model_add_or_remove_org_role.go new file mode 100644 index 000000000..20928d5bd --- /dev/null +++ b/admin/model_add_or_remove_org_role.go @@ -0,0 +1,51 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// AddOrRemoveOrgRole struct for AddOrRemoveOrgRole +type AddOrRemoveOrgRole struct { + // Organization-level role. + OrgRole string `json:"orgRole"` +} + +// NewAddOrRemoveOrgRole instantiates a new AddOrRemoveOrgRole 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 NewAddOrRemoveOrgRole(orgRole string) *AddOrRemoveOrgRole { + this := AddOrRemoveOrgRole{} + this.OrgRole = orgRole + return &this +} + +// NewAddOrRemoveOrgRoleWithDefaults instantiates a new AddOrRemoveOrgRole 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 NewAddOrRemoveOrgRoleWithDefaults() *AddOrRemoveOrgRole { + this := AddOrRemoveOrgRole{} + return &this +} + +// GetOrgRole returns the OrgRole field value +func (o *AddOrRemoveOrgRole) GetOrgRole() string { + if o == nil { + var ret string + return ret + } + + return o.OrgRole +} + +// GetOrgRoleOk returns a tuple with the OrgRole field value +// and a boolean to check if the value has been set. +func (o *AddOrRemoveOrgRole) GetOrgRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrgRole, true +} + +// SetOrgRole sets field value +func (o *AddOrRemoveOrgRole) SetOrgRole(v string) { + o.OrgRole = v +} diff --git a/admin/model_add_or_remove_user_from_team.go b/admin/model_add_or_remove_user_from_team.go new file mode 100644 index 000000000..c834a26e9 --- /dev/null +++ b/admin/model_add_or_remove_user_from_team.go @@ -0,0 +1,52 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// AddOrRemoveUserFromTeam struct for AddOrRemoveUserFromTeam +type AddOrRemoveUserFromTeam struct { + // Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. + // Write only field. + Id string `json:"id"` +} + +// NewAddOrRemoveUserFromTeam instantiates a new AddOrRemoveUserFromTeam 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 NewAddOrRemoveUserFromTeam(id string) *AddOrRemoveUserFromTeam { + this := AddOrRemoveUserFromTeam{} + this.Id = id + return &this +} + +// NewAddOrRemoveUserFromTeamWithDefaults instantiates a new AddOrRemoveUserFromTeam 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 NewAddOrRemoveUserFromTeamWithDefaults() *AddOrRemoveUserFromTeam { + this := AddOrRemoveUserFromTeam{} + return &this +} + +// GetId returns the Id field value +func (o *AddOrRemoveUserFromTeam) 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 *AddOrRemoveUserFromTeam) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *AddOrRemoveUserFromTeam) SetId(v string) { + o.Id = v +} diff --git a/admin/model_advanced_compute_auto_scaling.go b/admin/model_advanced_compute_auto_scaling.go index b1be0ea42..871b1645b 100644 --- a/admin/model_advanced_compute_auto_scaling.go +++ b/admin/model_advanced_compute_auto_scaling.go @@ -6,9 +6,9 @@ package admin type AdvancedComputeAutoScaling struct { // Flag that indicates whether someone enabled instance size auto-scaling. - Set to `true` to enable instance size auto-scaling. If enabled, you must specify a value for **replicationSpecs[n].regionConfigs[m].autoScaling.compute.maxInstanceSize**. - Set to `false` to disable instance size automatic scaling. Enabled *bool `json:"enabled,omitempty"` - // Minimum instance size to which your cluster can automatically scale. MongoDB Cloud requires this parameter if `\"replicationSpecs[n].regionConfigs[m].autoScaling.compute.scaleDownEnabled\" : true`. + // Instance size boundary to which your cluster can automatically scale. MaxInstanceSize *string `json:"maxInstanceSize,omitempty"` - // Minimum instance size to which your cluster can automatically scale. MongoDB Cloud requires this parameter if `\"replicationSpecs[n].regionConfigs[m].autoScaling.compute.scaleDownEnabled\" : true`. + // Instance size boundary to which your cluster can automatically scale. MinInstanceSize *string `json:"minInstanceSize,omitempty"` // Flag that indicates whether the instance size may scale down. MongoDB Cloud requires this parameter if `\"replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled\" : true`. If you enable this option, specify a value for **replicationSpecs[n].regionConfigs[m].autoScaling.compute.minInstanceSize**. ScaleDownEnabled *bool `json:"scaleDownEnabled,omitempty"` diff --git a/admin/model_api_version.go b/admin/model_api_version.go new file mode 100644 index 000000000..3e3511811 --- /dev/null +++ b/admin/model_api_version.go @@ -0,0 +1,59 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// ApiVersion struct for ApiVersion +type ApiVersion struct { + // Object representing a version of the Atlas Admin API. + Version *string `json:"version,omitempty"` +} + +// NewApiVersion instantiates a new ApiVersion 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 NewApiVersion() *ApiVersion { + this := ApiVersion{} + return &this +} + +// NewApiVersionWithDefaults instantiates a new ApiVersion 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 NewApiVersionWithDefaults() *ApiVersion { + this := ApiVersion{} + return &this +} + +// GetVersion returns the Version field value if set, zero value otherwise +func (o *ApiVersion) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiVersion) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *ApiVersion) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *ApiVersion) SetVersion(v string) { + o.Version = &v +} diff --git a/admin/model_cluster_description20240805.go b/admin/model_cluster_description20240805.go index d53f31917..b94181200 100644 --- a/admin/model_cluster_description20240805.go +++ b/admin/model_cluster_description20240805.go @@ -28,10 +28,10 @@ type ClusterDescription20240805 struct { DiskWarmingMode *string `json:"diskWarmingMode,omitempty"` // Cloud service provider that manages your customer keys to provide an additional layer of encryption at rest for the cluster. To enable customer key management for encryption at rest, the cluster **replicationSpecs[n].regionConfigs[m].{type}Specs.instanceSize** setting must be `M10` or higher and `\"backupEnabled\" : false` or omitted entirely. EncryptionAtRestProvider *string `json:"encryptionAtRestProvider,omitempty"` - // Feature compatibility version of the cluster. + // Feature compatibility version of the cluster. This will always appear regardless of whether FCV is pinned. // Read only field. FeatureCompatibilityVersion *string `json:"featureCompatibilityVersion,omitempty"` - // Feature compatibility version expiration date. + // Feature compatibility version expiration date. Will only appear if FCV is pinned. // Read only field. FeatureCompatibilityVersionExpirationDate *time.Time `json:"featureCompatibilityVersionExpirationDate,omitempty"` // Set this field to configure the Sharding Management Mode when creating a new Global Cluster. When set to false, the management mode is set to Atlas-Managed Sharding. This mode fully manages the sharding of your Global Cluster and is built to provide a seamless deployment experience. When set to true, the management mode is set to Self-Managed Sharding. This mode leaves the management of shards in your hands and is built to provide an advanced and flexible deployment experience. This setting cannot be changed once the cluster is deployed. @@ -49,7 +49,7 @@ type ClusterDescription20240805 struct { // Read only field. Links *[]Link `json:"links,omitempty"` MongoDBEmployeeAccessGrant *EmployeeAccessGrant `json:"mongoDBEmployeeAccessGrant,omitempty"` - // MongoDB major version of the cluster. On creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLTSVersions). On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version. + // MongoDB major version of the cluster. Set to the binary major version. On creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLtsVersions). On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version. MongoDBMajorVersion *string `json:"mongoDBMajorVersion,omitempty"` // Version of MongoDB that the cluster runs. // Read only field. diff --git a/admin/model_create_organization_request.go b/admin/model_create_organization_request.go index 095d3fab2..5beac4c0d 100644 --- a/admin/model_create_organization_request.go +++ b/admin/model_create_organization_request.go @@ -11,6 +11,8 @@ type CreateOrganizationRequest struct { Name string `json:"name"` // Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user that you want to assign the Organization Owner role. This user must be a member of the same organization as the calling API key. If you provide `federationSettingsId`, this user must instead have the Organization Owner role on an organization in the specified federation. This parameter is required only when you authenticate with Programmatic API Keys. OrgOwnerId *string `json:"orgOwnerId,omitempty"` + // Disables automatic alert creation. When set to true, no organization level alerts will be created automatically. + SkipDefaultAlertsSettings *bool `json:"skipDefaultAlertsSettings,omitempty"` } // NewCreateOrganizationRequest instantiates a new CreateOrganizationRequest object @@ -20,6 +22,8 @@ type CreateOrganizationRequest struct { func NewCreateOrganizationRequest(name string) *CreateOrganizationRequest { this := CreateOrganizationRequest{} this.Name = name + var skipDefaultAlertsSettings bool = false + this.SkipDefaultAlertsSettings = &skipDefaultAlertsSettings return &this } @@ -28,6 +32,8 @@ func NewCreateOrganizationRequest(name string) *CreateOrganizationRequest { // but it doesn't guarantee that properties required by API are set func NewCreateOrganizationRequestWithDefaults() *CreateOrganizationRequest { this := CreateOrganizationRequest{} + var skipDefaultAlertsSettings bool = false + this.SkipDefaultAlertsSettings = &skipDefaultAlertsSettings return &this } @@ -153,3 +159,36 @@ func (o *CreateOrganizationRequest) HasOrgOwnerId() bool { func (o *CreateOrganizationRequest) SetOrgOwnerId(v string) { o.OrgOwnerId = &v } + +// GetSkipDefaultAlertsSettings returns the SkipDefaultAlertsSettings field value if set, zero value otherwise +func (o *CreateOrganizationRequest) GetSkipDefaultAlertsSettings() bool { + if o == nil || IsNil(o.SkipDefaultAlertsSettings) { + var ret bool + return ret + } + return *o.SkipDefaultAlertsSettings +} + +// GetSkipDefaultAlertsSettingsOk returns a tuple with the SkipDefaultAlertsSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateOrganizationRequest) GetSkipDefaultAlertsSettingsOk() (*bool, bool) { + if o == nil || IsNil(o.SkipDefaultAlertsSettings) { + return nil, false + } + + return o.SkipDefaultAlertsSettings, true +} + +// HasSkipDefaultAlertsSettings returns a boolean if a field has been set. +func (o *CreateOrganizationRequest) HasSkipDefaultAlertsSettings() bool { + if o != nil && !IsNil(o.SkipDefaultAlertsSettings) { + return true + } + + return false +} + +// SetSkipDefaultAlertsSettings gets a reference to the given bool and assigns it to the SkipDefaultAlertsSettings field. +func (o *CreateOrganizationRequest) SetSkipDefaultAlertsSettings(v bool) { + o.SkipDefaultAlertsSettings = &v +} diff --git a/admin/model_disk_backup_export_job.go b/admin/model_disk_backup_export_job.go index a65d628b9..9e6e8ec57 100644 --- a/admin/model_disk_backup_export_job.go +++ b/admin/model_disk_backup_export_job.go @@ -36,7 +36,8 @@ type DiskBackupExportJob struct { SnapshotId *string `json:"snapshotId,omitempty"` // State of the Export Job. // Read only field. - State *string `json:"state,omitempty"` + State *string `json:"state,omitempty"` + StateReason *StateReason `json:"stateReason,omitempty"` } // NewDiskBackupExportJob instantiates a new DiskBackupExportJob object @@ -410,3 +411,36 @@ func (o *DiskBackupExportJob) HasState() bool { func (o *DiskBackupExportJob) SetState(v string) { o.State = &v } + +// GetStateReason returns the StateReason field value if set, zero value otherwise +func (o *DiskBackupExportJob) GetStateReason() StateReason { + if o == nil || IsNil(o.StateReason) { + var ret StateReason + return ret + } + return *o.StateReason +} + +// GetStateReasonOk returns a tuple with the StateReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DiskBackupExportJob) GetStateReasonOk() (*StateReason, bool) { + if o == nil || IsNil(o.StateReason) { + return nil, false + } + + return o.StateReason, true +} + +// HasStateReason returns a boolean if a field has been set. +func (o *DiskBackupExportJob) HasStateReason() bool { + if o != nil && !IsNil(o.StateReason) { + return true + } + + return false +} + +// SetStateReason gets a reference to the given StateReason and assigns it to the StateReason field. +func (o *DiskBackupExportJob) SetStateReason(v StateReason) { + o.StateReason = &v +} diff --git a/admin/model_event_view_for_nds_group.go b/admin/model_event_view_for_nds_group.go index 2a9c5a32b..e1edaccfe 100644 --- a/admin/model_event_view_for_nds_group.go +++ b/admin/model_event_view_for_nds_group.go @@ -68,6 +68,12 @@ type EventViewForNdsGroup struct { // Action that the database attempted to execute when the event triggered. The response returns this parameter when `eventTypeName\" : \"DATA_EXPLORER\"`. // Read only field. OpType *string `json:"opType,omitempty"` + // Desk location of MongoDB employee associated with the event. + // Read only field. + DeskLocation *string `json:"deskLocation,omitempty"` + // Identifier of MongoDB employee associated with the event. + // Read only field. + EmployeeIdentifier *string `json:"employeeIdentifier,omitempty"` // IANA port on which the MongoDB process listens for requests. // Read only field. Port *int `json:"port,omitempty"` @@ -825,6 +831,72 @@ func (o *EventViewForNdsGroup) SetOpType(v string) { o.OpType = &v } +// GetDeskLocation returns the DeskLocation field value if set, zero value otherwise +func (o *EventViewForNdsGroup) GetDeskLocation() string { + if o == nil || IsNil(o.DeskLocation) { + var ret string + return ret + } + return *o.DeskLocation +} + +// GetDeskLocationOk returns a tuple with the DeskLocation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventViewForNdsGroup) GetDeskLocationOk() (*string, bool) { + if o == nil || IsNil(o.DeskLocation) { + return nil, false + } + + return o.DeskLocation, true +} + +// HasDeskLocation returns a boolean if a field has been set. +func (o *EventViewForNdsGroup) HasDeskLocation() bool { + if o != nil && !IsNil(o.DeskLocation) { + return true + } + + return false +} + +// SetDeskLocation gets a reference to the given string and assigns it to the DeskLocation field. +func (o *EventViewForNdsGroup) SetDeskLocation(v string) { + o.DeskLocation = &v +} + +// GetEmployeeIdentifier returns the EmployeeIdentifier field value if set, zero value otherwise +func (o *EventViewForNdsGroup) GetEmployeeIdentifier() string { + if o == nil || IsNil(o.EmployeeIdentifier) { + var ret string + return ret + } + return *o.EmployeeIdentifier +} + +// GetEmployeeIdentifierOk returns a tuple with the EmployeeIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventViewForNdsGroup) GetEmployeeIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.EmployeeIdentifier) { + return nil, false + } + + return o.EmployeeIdentifier, true +} + +// HasEmployeeIdentifier returns a boolean if a field has been set. +func (o *EventViewForNdsGroup) HasEmployeeIdentifier() bool { + if o != nil && !IsNil(o.EmployeeIdentifier) { + return true + } + + return false +} + +// SetEmployeeIdentifier gets a reference to the given string and assigns it to the EmployeeIdentifier field. +func (o *EventViewForNdsGroup) SetEmployeeIdentifier(v string) { + o.EmployeeIdentifier = &v +} + // GetPort returns the Port field value if set, zero value otherwise func (o *EventViewForNdsGroup) GetPort() int { if o == nil || IsNil(o.Port) { diff --git a/admin/model_group_maintenance_window.go b/admin/model_group_maintenance_window.go index dd12c9dfb..f67385858 100644 --- a/admin/model_group_maintenance_window.go +++ b/admin/model_group_maintenance_window.go @@ -12,9 +12,13 @@ type GroupMaintenanceWindow struct { HourOfDay *int `json:"hourOfDay,omitempty"` // Number of times the current maintenance event for this project has been deferred. // Read only field. - NumberOfDeferrals *int `json:"numberOfDeferrals,omitempty"` + NumberOfDeferrals *int `json:"numberOfDeferrals,omitempty"` + ProtectedHours *ProtectedHours `json:"protectedHours,omitempty"` // Flag that indicates whether MongoDB Cloud starts the maintenance window immediately upon receiving this request. To start the maintenance window immediately for your project, MongoDB Cloud must have maintenance scheduled and you must set a maintenance window. This flag resets to `false` after MongoDB Cloud completes maintenance. StartASAP *bool `json:"startASAP,omitempty"` + // Identifier for the current time zone of the maintenance window. This can only be updated via the Project Settings UI. + // Read only field. + TimeZoneId *string `json:"timeZoneId,omitempty"` } // NewGroupMaintenanceWindow instantiates a new GroupMaintenanceWindow object @@ -158,6 +162,39 @@ func (o *GroupMaintenanceWindow) SetNumberOfDeferrals(v int) { o.NumberOfDeferrals = &v } +// GetProtectedHours returns the ProtectedHours field value if set, zero value otherwise +func (o *GroupMaintenanceWindow) GetProtectedHours() ProtectedHours { + if o == nil || IsNil(o.ProtectedHours) { + var ret ProtectedHours + return ret + } + return *o.ProtectedHours +} + +// GetProtectedHoursOk returns a tuple with the ProtectedHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupMaintenanceWindow) GetProtectedHoursOk() (*ProtectedHours, bool) { + if o == nil || IsNil(o.ProtectedHours) { + return nil, false + } + + return o.ProtectedHours, true +} + +// HasProtectedHours returns a boolean if a field has been set. +func (o *GroupMaintenanceWindow) HasProtectedHours() bool { + if o != nil && !IsNil(o.ProtectedHours) { + return true + } + + return false +} + +// SetProtectedHours gets a reference to the given ProtectedHours and assigns it to the ProtectedHours field. +func (o *GroupMaintenanceWindow) SetProtectedHours(v ProtectedHours) { + o.ProtectedHours = &v +} + // GetStartASAP returns the StartASAP field value if set, zero value otherwise func (o *GroupMaintenanceWindow) GetStartASAP() bool { if o == nil || IsNil(o.StartASAP) { @@ -190,3 +227,36 @@ func (o *GroupMaintenanceWindow) HasStartASAP() bool { func (o *GroupMaintenanceWindow) SetStartASAP(v bool) { o.StartASAP = &v } + +// GetTimeZoneId returns the TimeZoneId field value if set, zero value otherwise +func (o *GroupMaintenanceWindow) GetTimeZoneId() string { + if o == nil || IsNil(o.TimeZoneId) { + var ret string + return ret + } + return *o.TimeZoneId +} + +// GetTimeZoneIdOk returns a tuple with the TimeZoneId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupMaintenanceWindow) GetTimeZoneIdOk() (*string, bool) { + if o == nil || IsNil(o.TimeZoneId) { + return nil, false + } + + return o.TimeZoneId, true +} + +// HasTimeZoneId returns a boolean if a field has been set. +func (o *GroupMaintenanceWindow) HasTimeZoneId() bool { + if o != nil && !IsNil(o.TimeZoneId) { + return true + } + + return false +} + +// SetTimeZoneId gets a reference to the given string and assigns it to the TimeZoneId field. +func (o *GroupMaintenanceWindow) SetTimeZoneId(v string) { + o.TimeZoneId = &v +} diff --git a/admin/model_group_role_assignment.go b/admin/model_group_role_assignment.go new file mode 100644 index 000000000..3e4aa7fc8 --- /dev/null +++ b/admin/model_group_role_assignment.go @@ -0,0 +1,94 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// GroupRoleAssignment struct for GroupRoleAssignment +type GroupRoleAssignment struct { + // Unique 24-hexadecimal digit string that identifies the project to which these roles belong. + GroupId *string `json:"groupId,omitempty"` + // One or more project-level roles assigned to the MongoDB Cloud user. + GroupRoles *[]string `json:"groupRoles,omitempty"` +} + +// NewGroupRoleAssignment instantiates a new GroupRoleAssignment 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 NewGroupRoleAssignment() *GroupRoleAssignment { + this := GroupRoleAssignment{} + return &this +} + +// NewGroupRoleAssignmentWithDefaults instantiates a new GroupRoleAssignment 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 NewGroupRoleAssignmentWithDefaults() *GroupRoleAssignment { + this := GroupRoleAssignment{} + return &this +} + +// GetGroupId returns the GroupId field value if set, zero value otherwise +func (o *GroupRoleAssignment) 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 *GroupRoleAssignment) 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 *GroupRoleAssignment) 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 *GroupRoleAssignment) SetGroupId(v string) { + o.GroupId = &v +} + +// GetGroupRoles returns the GroupRoles field value if set, zero value otherwise +func (o *GroupRoleAssignment) GetGroupRoles() []string { + if o == nil || IsNil(o.GroupRoles) { + var ret []string + return ret + } + return *o.GroupRoles +} + +// GetGroupRolesOk returns a tuple with the GroupRoles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupRoleAssignment) GetGroupRolesOk() (*[]string, bool) { + if o == nil || IsNil(o.GroupRoles) { + return nil, false + } + + return o.GroupRoles, true +} + +// HasGroupRoles returns a boolean if a field has been set. +func (o *GroupRoleAssignment) HasGroupRoles() bool { + if o != nil && !IsNil(o.GroupRoles) { + return true + } + + return false +} + +// SetGroupRoles gets a reference to the given []string and assigns it to the GroupRoles field. +func (o *GroupRoleAssignment) SetGroupRoles(v []string) { + o.GroupRoles = &v +} diff --git a/admin/model_group_user_response.go b/admin/model_group_user_response.go new file mode 100644 index 000000000..39adef2de --- /dev/null +++ b/admin/model_group_user_response.go @@ -0,0 +1,464 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +import ( + "time" +) + +// GroupUserResponse struct for GroupUserResponse +type GroupUserResponse struct { + // Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. + // Read only field. + Id string `json:"id"` + // String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization. + // Read only field. + OrgMembershipStatus string `json:"orgMembershipStatus"` + // One or more project-level roles assigned to the MongoDB Cloud user. + // Read only field. + Roles []string `json:"roles"` + // Email address that represents the username of the MongoDB Cloud user. + // Read only field. + Username string `json:"username"` + // Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + // Read only field. + InvitationCreatedAt *time.Time `json:"invitationCreatedAt,omitempty"` + // Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + // Read only field. + InvitationExpiresAt *time.Time `json:"invitationExpiresAt,omitempty"` + // Username of the MongoDB Cloud user who sent the invitation to join the organization. + // Read only field. + InviterUsername *string `json:"inviterUsername,omitempty"` + // Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format. + // Read only field. + Country *string `json:"country,omitempty"` + // Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC. + // Read only field. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // First or given name that belongs to the MongoDB Cloud user. + // Read only field. + FirstName *string `json:"firstName,omitempty"` + // Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC. + // Read only field. + LastAuth *time.Time `json:"lastAuth,omitempty"` + // Last name, family name, or surname that belongs to the MongoDB Cloud user. + // Read only field. + LastName *string `json:"lastName,omitempty"` + // Mobile phone number that belongs to the MongoDB Cloud user. + // Read only field. + MobileNumber *string `json:"mobileNumber,omitempty"` +} + +// NewGroupUserResponse instantiates a new GroupUserResponse 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 NewGroupUserResponse(id string, orgMembershipStatus string, roles []string, username string) *GroupUserResponse { + this := GroupUserResponse{} + this.Id = id + this.OrgMembershipStatus = orgMembershipStatus + this.Roles = roles + this.Username = username + return &this +} + +// NewGroupUserResponseWithDefaults instantiates a new GroupUserResponse 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 NewGroupUserResponseWithDefaults() *GroupUserResponse { + this := GroupUserResponse{} + return &this +} + +// GetId returns the Id field value +func (o *GroupUserResponse) 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 *GroupUserResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GroupUserResponse) SetId(v string) { + o.Id = v +} + +// GetOrgMembershipStatus returns the OrgMembershipStatus field value +func (o *GroupUserResponse) GetOrgMembershipStatus() string { + if o == nil { + var ret string + return ret + } + + return o.OrgMembershipStatus +} + +// GetOrgMembershipStatusOk returns a tuple with the OrgMembershipStatus field value +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetOrgMembershipStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrgMembershipStatus, true +} + +// SetOrgMembershipStatus sets field value +func (o *GroupUserResponse) SetOrgMembershipStatus(v string) { + o.OrgMembershipStatus = v +} + +// GetRoles returns the Roles field value +func (o *GroupUserResponse) 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 *GroupUserResponse) GetRolesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Roles, true +} + +// SetRoles sets field value +func (o *GroupUserResponse) SetRoles(v []string) { + o.Roles = v +} + +// GetUsername returns the Username field value +func (o *GroupUserResponse) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *GroupUserResponse) SetUsername(v string) { + o.Username = v +} + +// GetInvitationCreatedAt returns the InvitationCreatedAt field value if set, zero value otherwise +func (o *GroupUserResponse) GetInvitationCreatedAt() time.Time { + if o == nil || IsNil(o.InvitationCreatedAt) { + var ret time.Time + return ret + } + return *o.InvitationCreatedAt +} + +// GetInvitationCreatedAtOk returns a tuple with the InvitationCreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetInvitationCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.InvitationCreatedAt) { + return nil, false + } + + return o.InvitationCreatedAt, true +} + +// HasInvitationCreatedAt returns a boolean if a field has been set. +func (o *GroupUserResponse) HasInvitationCreatedAt() bool { + if o != nil && !IsNil(o.InvitationCreatedAt) { + return true + } + + return false +} + +// SetInvitationCreatedAt gets a reference to the given time.Time and assigns it to the InvitationCreatedAt field. +func (o *GroupUserResponse) SetInvitationCreatedAt(v time.Time) { + o.InvitationCreatedAt = &v +} + +// GetInvitationExpiresAt returns the InvitationExpiresAt field value if set, zero value otherwise +func (o *GroupUserResponse) GetInvitationExpiresAt() time.Time { + if o == nil || IsNil(o.InvitationExpiresAt) { + var ret time.Time + return ret + } + return *o.InvitationExpiresAt +} + +// GetInvitationExpiresAtOk returns a tuple with the InvitationExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetInvitationExpiresAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.InvitationExpiresAt) { + return nil, false + } + + return o.InvitationExpiresAt, true +} + +// HasInvitationExpiresAt returns a boolean if a field has been set. +func (o *GroupUserResponse) HasInvitationExpiresAt() bool { + if o != nil && !IsNil(o.InvitationExpiresAt) { + return true + } + + return false +} + +// SetInvitationExpiresAt gets a reference to the given time.Time and assigns it to the InvitationExpiresAt field. +func (o *GroupUserResponse) SetInvitationExpiresAt(v time.Time) { + o.InvitationExpiresAt = &v +} + +// GetInviterUsername returns the InviterUsername field value if set, zero value otherwise +func (o *GroupUserResponse) GetInviterUsername() string { + if o == nil || IsNil(o.InviterUsername) { + var ret string + return ret + } + return *o.InviterUsername +} + +// GetInviterUsernameOk returns a tuple with the InviterUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetInviterUsernameOk() (*string, bool) { + if o == nil || IsNil(o.InviterUsername) { + return nil, false + } + + return o.InviterUsername, true +} + +// HasInviterUsername returns a boolean if a field has been set. +func (o *GroupUserResponse) HasInviterUsername() bool { + if o != nil && !IsNil(o.InviterUsername) { + return true + } + + return false +} + +// SetInviterUsername gets a reference to the given string and assigns it to the InviterUsername field. +func (o *GroupUserResponse) SetInviterUsername(v string) { + o.InviterUsername = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise +func (o *GroupUserResponse) GetCountry() string { + if o == nil || IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetCountryOk() (*string, bool) { + if o == nil || IsNil(o.Country) { + return nil, false + } + + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *GroupUserResponse) HasCountry() bool { + if o != nil && !IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *GroupUserResponse) SetCountry(v string) { + o.Country = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise +func (o *GroupUserResponse) 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 *GroupUserResponse) 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 *GroupUserResponse) 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 *GroupUserResponse) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise +func (o *GroupUserResponse) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *GroupUserResponse) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *GroupUserResponse) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastAuth returns the LastAuth field value if set, zero value otherwise +func (o *GroupUserResponse) GetLastAuth() time.Time { + if o == nil || IsNil(o.LastAuth) { + var ret time.Time + return ret + } + return *o.LastAuth +} + +// GetLastAuthOk returns a tuple with the LastAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetLastAuthOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastAuth) { + return nil, false + } + + return o.LastAuth, true +} + +// HasLastAuth returns a boolean if a field has been set. +func (o *GroupUserResponse) HasLastAuth() bool { + if o != nil && !IsNil(o.LastAuth) { + return true + } + + return false +} + +// SetLastAuth gets a reference to the given time.Time and assigns it to the LastAuth field. +func (o *GroupUserResponse) SetLastAuth(v time.Time) { + o.LastAuth = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise +func (o *GroupUserResponse) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *GroupUserResponse) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *GroupUserResponse) SetLastName(v string) { + o.LastName = &v +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise +func (o *GroupUserResponse) GetMobileNumber() string { + if o == nil || IsNil(o.MobileNumber) { + var ret string + return ret + } + return *o.MobileNumber +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupUserResponse) GetMobileNumberOk() (*string, bool) { + if o == nil || IsNil(o.MobileNumber) { + return nil, false + } + + return o.MobileNumber, true +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *GroupUserResponse) HasMobileNumber() bool { + if o != nil && !IsNil(o.MobileNumber) { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given string and assigns it to the MobileNumber field. +func (o *GroupUserResponse) SetMobileNumber(v string) { + o.MobileNumber = &v +} diff --git a/admin/model_mdb_available_version.go b/admin/model_mdb_available_version.go index 8a3bac0e1..f892f04fa 100644 --- a/admin/model_mdb_available_version.go +++ b/admin/model_mdb_available_version.go @@ -8,7 +8,7 @@ type MdbAvailableVersion struct { CloudProvider *string `json:"cloudProvider,omitempty"` // Whether the version is the current default for the Instance Size and Cloud Provider. DefaultStatus *string `json:"defaultStatus,omitempty"` - // Minimum instance size to which your cluster can automatically scale. MongoDB Cloud requires this parameter if `\"replicationSpecs[n].regionConfigs[m].autoScaling.compute.scaleDownEnabled\" : true`. + // Instance size boundary to which your cluster can automatically scale. InstanceSize *string `json:"instanceSize,omitempty"` // 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. diff --git a/admin/model_org_user_request.go b/admin/model_org_user_request.go new file mode 100644 index 000000000..373751614 --- /dev/null +++ b/admin/model_org_user_request.go @@ -0,0 +1,114 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// OrgUserRequest struct for OrgUserRequest +type OrgUserRequest struct { + Roles OrgUserRolesRequest `json:"roles"` + // List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs. + // Write only field. + TeamIds *[]string `json:"teamIds,omitempty"` + // Email address that represents the username of the MongoDB Cloud user. + // Write only field. + Username string `json:"username"` +} + +// NewOrgUserRequest instantiates a new OrgUserRequest 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 NewOrgUserRequest(roles OrgUserRolesRequest, username string) *OrgUserRequest { + this := OrgUserRequest{} + this.Roles = roles + this.Username = username + return &this +} + +// NewOrgUserRequestWithDefaults instantiates a new OrgUserRequest 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 NewOrgUserRequestWithDefaults() *OrgUserRequest { + this := OrgUserRequest{} + return &this +} + +// GetRoles returns the Roles field value +func (o *OrgUserRequest) GetRoles() OrgUserRolesRequest { + if o == nil { + var ret OrgUserRolesRequest + 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 *OrgUserRequest) GetRolesOk() (*OrgUserRolesRequest, bool) { + if o == nil { + return nil, false + } + return &o.Roles, true +} + +// SetRoles sets field value +func (o *OrgUserRequest) SetRoles(v OrgUserRolesRequest) { + o.Roles = v +} + +// GetTeamIds returns the TeamIds field value if set, zero value otherwise +func (o *OrgUserRequest) GetTeamIds() []string { + if o == nil || IsNil(o.TeamIds) { + var ret []string + return ret + } + return *o.TeamIds +} + +// GetTeamIdsOk returns a tuple with the TeamIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserRequest) GetTeamIdsOk() (*[]string, bool) { + if o == nil || IsNil(o.TeamIds) { + return nil, false + } + + return o.TeamIds, true +} + +// HasTeamIds returns a boolean if a field has been set. +func (o *OrgUserRequest) HasTeamIds() bool { + if o != nil && !IsNil(o.TeamIds) { + return true + } + + return false +} + +// SetTeamIds gets a reference to the given []string and assigns it to the TeamIds field. +func (o *OrgUserRequest) SetTeamIds(v []string) { + o.TeamIds = &v +} + +// GetUsername returns the Username field value +func (o *OrgUserRequest) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *OrgUserRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *OrgUserRequest) SetUsername(v string) { + o.Username = v +} diff --git a/admin/model_org_user_response.go b/admin/model_org_user_response.go new file mode 100644 index 000000000..448109209 --- /dev/null +++ b/admin/model_org_user_response.go @@ -0,0 +1,498 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +import ( + "time" +) + +// OrgUserResponse struct for OrgUserResponse +type OrgUserResponse struct { + // Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. + // Read only field. + Id string `json:"id"` + // String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization. + // Read only field. + OrgMembershipStatus string `json:"orgMembershipStatus"` + Roles OrgUserRolesResponse `json:"roles"` + // List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs. + // Read only field. + TeamIds *[]string `json:"teamIds,omitempty"` + // Email address that represents the username of the MongoDB Cloud user. + // Read only field. + Username string `json:"username"` + // Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + // Read only field. + InvitationCreatedAt *time.Time `json:"invitationCreatedAt,omitempty"` + // Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + // Read only field. + InvitationExpiresAt *time.Time `json:"invitationExpiresAt,omitempty"` + // Username of the MongoDB Cloud user who sent the invitation to join the organization. + // Read only field. + InviterUsername *string `json:"inviterUsername,omitempty"` + // Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format. + // Read only field. + Country *string `json:"country,omitempty"` + // Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC. + // Read only field. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // First or given name that belongs to the MongoDB Cloud user. + // Read only field. + FirstName *string `json:"firstName,omitempty"` + // Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC. + // Read only field. + LastAuth *time.Time `json:"lastAuth,omitempty"` + // Last name, family name, or surname that belongs to the MongoDB Cloud user. + // Read only field. + LastName *string `json:"lastName,omitempty"` + // Mobile phone number that belongs to the MongoDB Cloud user. + // Read only field. + MobileNumber *string `json:"mobileNumber,omitempty"` +} + +// NewOrgUserResponse instantiates a new OrgUserResponse 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 NewOrgUserResponse(id string, orgMembershipStatus string, roles OrgUserRolesResponse, username string) *OrgUserResponse { + this := OrgUserResponse{} + this.Id = id + this.OrgMembershipStatus = orgMembershipStatus + this.Roles = roles + this.Username = username + return &this +} + +// NewOrgUserResponseWithDefaults instantiates a new OrgUserResponse 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 NewOrgUserResponseWithDefaults() *OrgUserResponse { + this := OrgUserResponse{} + return &this +} + +// GetId returns the Id field value +func (o *OrgUserResponse) 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 *OrgUserResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *OrgUserResponse) SetId(v string) { + o.Id = v +} + +// GetOrgMembershipStatus returns the OrgMembershipStatus field value +func (o *OrgUserResponse) GetOrgMembershipStatus() string { + if o == nil { + var ret string + return ret + } + + return o.OrgMembershipStatus +} + +// GetOrgMembershipStatusOk returns a tuple with the OrgMembershipStatus field value +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetOrgMembershipStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrgMembershipStatus, true +} + +// SetOrgMembershipStatus sets field value +func (o *OrgUserResponse) SetOrgMembershipStatus(v string) { + o.OrgMembershipStatus = v +} + +// GetRoles returns the Roles field value +func (o *OrgUserResponse) GetRoles() OrgUserRolesResponse { + if o == nil { + var ret OrgUserRolesResponse + 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 *OrgUserResponse) GetRolesOk() (*OrgUserRolesResponse, bool) { + if o == nil { + return nil, false + } + return &o.Roles, true +} + +// SetRoles sets field value +func (o *OrgUserResponse) SetRoles(v OrgUserRolesResponse) { + o.Roles = v +} + +// GetTeamIds returns the TeamIds field value if set, zero value otherwise +func (o *OrgUserResponse) GetTeamIds() []string { + if o == nil || IsNil(o.TeamIds) { + var ret []string + return ret + } + return *o.TeamIds +} + +// GetTeamIdsOk returns a tuple with the TeamIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetTeamIdsOk() (*[]string, bool) { + if o == nil || IsNil(o.TeamIds) { + return nil, false + } + + return o.TeamIds, true +} + +// HasTeamIds returns a boolean if a field has been set. +func (o *OrgUserResponse) HasTeamIds() bool { + if o != nil && !IsNil(o.TeamIds) { + return true + } + + return false +} + +// SetTeamIds gets a reference to the given []string and assigns it to the TeamIds field. +func (o *OrgUserResponse) SetTeamIds(v []string) { + o.TeamIds = &v +} + +// GetUsername returns the Username field value +func (o *OrgUserResponse) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *OrgUserResponse) SetUsername(v string) { + o.Username = v +} + +// GetInvitationCreatedAt returns the InvitationCreatedAt field value if set, zero value otherwise +func (o *OrgUserResponse) GetInvitationCreatedAt() time.Time { + if o == nil || IsNil(o.InvitationCreatedAt) { + var ret time.Time + return ret + } + return *o.InvitationCreatedAt +} + +// GetInvitationCreatedAtOk returns a tuple with the InvitationCreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetInvitationCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.InvitationCreatedAt) { + return nil, false + } + + return o.InvitationCreatedAt, true +} + +// HasInvitationCreatedAt returns a boolean if a field has been set. +func (o *OrgUserResponse) HasInvitationCreatedAt() bool { + if o != nil && !IsNil(o.InvitationCreatedAt) { + return true + } + + return false +} + +// SetInvitationCreatedAt gets a reference to the given time.Time and assigns it to the InvitationCreatedAt field. +func (o *OrgUserResponse) SetInvitationCreatedAt(v time.Time) { + o.InvitationCreatedAt = &v +} + +// GetInvitationExpiresAt returns the InvitationExpiresAt field value if set, zero value otherwise +func (o *OrgUserResponse) GetInvitationExpiresAt() time.Time { + if o == nil || IsNil(o.InvitationExpiresAt) { + var ret time.Time + return ret + } + return *o.InvitationExpiresAt +} + +// GetInvitationExpiresAtOk returns a tuple with the InvitationExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetInvitationExpiresAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.InvitationExpiresAt) { + return nil, false + } + + return o.InvitationExpiresAt, true +} + +// HasInvitationExpiresAt returns a boolean if a field has been set. +func (o *OrgUserResponse) HasInvitationExpiresAt() bool { + if o != nil && !IsNil(o.InvitationExpiresAt) { + return true + } + + return false +} + +// SetInvitationExpiresAt gets a reference to the given time.Time and assigns it to the InvitationExpiresAt field. +func (o *OrgUserResponse) SetInvitationExpiresAt(v time.Time) { + o.InvitationExpiresAt = &v +} + +// GetInviterUsername returns the InviterUsername field value if set, zero value otherwise +func (o *OrgUserResponse) GetInviterUsername() string { + if o == nil || IsNil(o.InviterUsername) { + var ret string + return ret + } + return *o.InviterUsername +} + +// GetInviterUsernameOk returns a tuple with the InviterUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetInviterUsernameOk() (*string, bool) { + if o == nil || IsNil(o.InviterUsername) { + return nil, false + } + + return o.InviterUsername, true +} + +// HasInviterUsername returns a boolean if a field has been set. +func (o *OrgUserResponse) HasInviterUsername() bool { + if o != nil && !IsNil(o.InviterUsername) { + return true + } + + return false +} + +// SetInviterUsername gets a reference to the given string and assigns it to the InviterUsername field. +func (o *OrgUserResponse) SetInviterUsername(v string) { + o.InviterUsername = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise +func (o *OrgUserResponse) GetCountry() string { + if o == nil || IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetCountryOk() (*string, bool) { + if o == nil || IsNil(o.Country) { + return nil, false + } + + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *OrgUserResponse) HasCountry() bool { + if o != nil && !IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *OrgUserResponse) SetCountry(v string) { + o.Country = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise +func (o *OrgUserResponse) 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 *OrgUserResponse) 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 *OrgUserResponse) 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 *OrgUserResponse) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise +func (o *OrgUserResponse) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *OrgUserResponse) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *OrgUserResponse) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastAuth returns the LastAuth field value if set, zero value otherwise +func (o *OrgUserResponse) GetLastAuth() time.Time { + if o == nil || IsNil(o.LastAuth) { + var ret time.Time + return ret + } + return *o.LastAuth +} + +// GetLastAuthOk returns a tuple with the LastAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetLastAuthOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastAuth) { + return nil, false + } + + return o.LastAuth, true +} + +// HasLastAuth returns a boolean if a field has been set. +func (o *OrgUserResponse) HasLastAuth() bool { + if o != nil && !IsNil(o.LastAuth) { + return true + } + + return false +} + +// SetLastAuth gets a reference to the given time.Time and assigns it to the LastAuth field. +func (o *OrgUserResponse) SetLastAuth(v time.Time) { + o.LastAuth = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise +func (o *OrgUserResponse) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *OrgUserResponse) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *OrgUserResponse) SetLastName(v string) { + o.LastName = &v +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise +func (o *OrgUserResponse) GetMobileNumber() string { + if o == nil || IsNil(o.MobileNumber) { + var ret string + return ret + } + return *o.MobileNumber +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserResponse) GetMobileNumberOk() (*string, bool) { + if o == nil || IsNil(o.MobileNumber) { + return nil, false + } + + return o.MobileNumber, true +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *OrgUserResponse) HasMobileNumber() bool { + if o != nil && !IsNil(o.MobileNumber) { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given string and assigns it to the MobileNumber field. +func (o *OrgUserResponse) SetMobileNumber(v string) { + o.MobileNumber = &v +} diff --git a/admin/model_org_user_roles_request.go b/admin/model_org_user_roles_request.go new file mode 100644 index 000000000..f8fd53f70 --- /dev/null +++ b/admin/model_org_user_roles_request.go @@ -0,0 +1,86 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// OrgUserRolesRequest Organization and project level roles to assign the MongoDB Cloud user within one organization. +type OrgUserRolesRequest struct { + // List of project level role assignments to assign the MongoDB Cloud user. + GroupRoleAssignments *[]GroupRoleAssignment `json:"groupRoleAssignments,omitempty"` + // One or more organization level roles to assign the MongoDB Cloud user. + OrgRoles []string `json:"orgRoles"` +} + +// NewOrgUserRolesRequest instantiates a new OrgUserRolesRequest 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 NewOrgUserRolesRequest(orgRoles []string) *OrgUserRolesRequest { + this := OrgUserRolesRequest{} + this.OrgRoles = orgRoles + return &this +} + +// NewOrgUserRolesRequestWithDefaults instantiates a new OrgUserRolesRequest 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 NewOrgUserRolesRequestWithDefaults() *OrgUserRolesRequest { + this := OrgUserRolesRequest{} + return &this +} + +// GetGroupRoleAssignments returns the GroupRoleAssignments field value if set, zero value otherwise +func (o *OrgUserRolesRequest) GetGroupRoleAssignments() []GroupRoleAssignment { + if o == nil || IsNil(o.GroupRoleAssignments) { + var ret []GroupRoleAssignment + return ret + } + return *o.GroupRoleAssignments +} + +// GetGroupRoleAssignmentsOk returns a tuple with the GroupRoleAssignments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserRolesRequest) GetGroupRoleAssignmentsOk() (*[]GroupRoleAssignment, bool) { + if o == nil || IsNil(o.GroupRoleAssignments) { + return nil, false + } + + return o.GroupRoleAssignments, true +} + +// HasGroupRoleAssignments returns a boolean if a field has been set. +func (o *OrgUserRolesRequest) HasGroupRoleAssignments() bool { + if o != nil && !IsNil(o.GroupRoleAssignments) { + return true + } + + return false +} + +// SetGroupRoleAssignments gets a reference to the given []GroupRoleAssignment and assigns it to the GroupRoleAssignments field. +func (o *OrgUserRolesRequest) SetGroupRoleAssignments(v []GroupRoleAssignment) { + o.GroupRoleAssignments = &v +} + +// GetOrgRoles returns the OrgRoles field value +func (o *OrgUserRolesRequest) GetOrgRoles() []string { + if o == nil { + var ret []string + return ret + } + + return o.OrgRoles +} + +// GetOrgRolesOk returns a tuple with the OrgRoles field value +// and a boolean to check if the value has been set. +func (o *OrgUserRolesRequest) GetOrgRolesOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.OrgRoles, true +} + +// SetOrgRoles sets field value +func (o *OrgUserRolesRequest) SetOrgRoles(v []string) { + o.OrgRoles = v +} diff --git a/admin/model_org_user_roles_response.go b/admin/model_org_user_roles_response.go new file mode 100644 index 000000000..2a0e020b6 --- /dev/null +++ b/admin/model_org_user_roles_response.go @@ -0,0 +1,94 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// OrgUserRolesResponse Organization- and project-level roles assigned to one MongoDB Cloud user within one organization. +type OrgUserRolesResponse struct { + // List of project-level role assignments assigned to the MongoDB Cloud user. + GroupRoleAssignments *[]GroupRoleAssignment `json:"groupRoleAssignments,omitempty"` + // One or more organization-level roles assigned to the MongoDB Cloud user. + OrgRoles *[]string `json:"orgRoles,omitempty"` +} + +// NewOrgUserRolesResponse instantiates a new OrgUserRolesResponse 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 NewOrgUserRolesResponse() *OrgUserRolesResponse { + this := OrgUserRolesResponse{} + return &this +} + +// NewOrgUserRolesResponseWithDefaults instantiates a new OrgUserRolesResponse 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 NewOrgUserRolesResponseWithDefaults() *OrgUserRolesResponse { + this := OrgUserRolesResponse{} + return &this +} + +// GetGroupRoleAssignments returns the GroupRoleAssignments field value if set, zero value otherwise +func (o *OrgUserRolesResponse) GetGroupRoleAssignments() []GroupRoleAssignment { + if o == nil || IsNil(o.GroupRoleAssignments) { + var ret []GroupRoleAssignment + return ret + } + return *o.GroupRoleAssignments +} + +// GetGroupRoleAssignmentsOk returns a tuple with the GroupRoleAssignments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserRolesResponse) GetGroupRoleAssignmentsOk() (*[]GroupRoleAssignment, bool) { + if o == nil || IsNil(o.GroupRoleAssignments) { + return nil, false + } + + return o.GroupRoleAssignments, true +} + +// HasGroupRoleAssignments returns a boolean if a field has been set. +func (o *OrgUserRolesResponse) HasGroupRoleAssignments() bool { + if o != nil && !IsNil(o.GroupRoleAssignments) { + return true + } + + return false +} + +// SetGroupRoleAssignments gets a reference to the given []GroupRoleAssignment and assigns it to the GroupRoleAssignments field. +func (o *OrgUserRolesResponse) SetGroupRoleAssignments(v []GroupRoleAssignment) { + o.GroupRoleAssignments = &v +} + +// GetOrgRoles returns the OrgRoles field value if set, zero value otherwise +func (o *OrgUserRolesResponse) GetOrgRoles() []string { + if o == nil || IsNil(o.OrgRoles) { + var ret []string + return ret + } + return *o.OrgRoles +} + +// GetOrgRolesOk returns a tuple with the OrgRoles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserRolesResponse) GetOrgRolesOk() (*[]string, bool) { + if o == nil || IsNil(o.OrgRoles) { + return nil, false + } + + return o.OrgRoles, true +} + +// HasOrgRoles returns a boolean if a field has been set. +func (o *OrgUserRolesResponse) HasOrgRoles() bool { + if o != nil && !IsNil(o.OrgRoles) { + return true + } + + return false +} + +// SetOrgRoles gets a reference to the given []string and assigns it to the OrgRoles field. +func (o *OrgUserRolesResponse) SetOrgRoles(v []string) { + o.OrgRoles = &v +} diff --git a/admin/model_org_user_update_request.go b/admin/model_org_user_update_request.go new file mode 100644 index 000000000..9044b4aa3 --- /dev/null +++ b/admin/model_org_user_update_request.go @@ -0,0 +1,94 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// OrgUserUpdateRequest struct for OrgUserUpdateRequest +type OrgUserUpdateRequest struct { + Roles *OrgUserRolesRequest `json:"roles,omitempty"` + // List of unique 24-hexadecimal digit strings that identifies the teams to assign the MongoDB Cloud user. + // Write only field. + TeamIds *[]string `json:"teamIds,omitempty"` +} + +// NewOrgUserUpdateRequest instantiates a new OrgUserUpdateRequest 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 NewOrgUserUpdateRequest() *OrgUserUpdateRequest { + this := OrgUserUpdateRequest{} + return &this +} + +// NewOrgUserUpdateRequestWithDefaults instantiates a new OrgUserUpdateRequest 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 NewOrgUserUpdateRequestWithDefaults() *OrgUserUpdateRequest { + this := OrgUserUpdateRequest{} + return &this +} + +// GetRoles returns the Roles field value if set, zero value otherwise +func (o *OrgUserUpdateRequest) GetRoles() OrgUserRolesRequest { + if o == nil || IsNil(o.Roles) { + var ret OrgUserRolesRequest + 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 *OrgUserUpdateRequest) GetRolesOk() (*OrgUserRolesRequest, 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 *OrgUserUpdateRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given OrgUserRolesRequest and assigns it to the Roles field. +func (o *OrgUserUpdateRequest) SetRoles(v OrgUserRolesRequest) { + o.Roles = &v +} + +// GetTeamIds returns the TeamIds field value if set, zero value otherwise +func (o *OrgUserUpdateRequest) GetTeamIds() []string { + if o == nil || IsNil(o.TeamIds) { + var ret []string + return ret + } + return *o.TeamIds +} + +// GetTeamIdsOk returns a tuple with the TeamIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgUserUpdateRequest) GetTeamIdsOk() (*[]string, bool) { + if o == nil || IsNil(o.TeamIds) { + return nil, false + } + + return o.TeamIds, true +} + +// HasTeamIds returns a boolean if a field has been set. +func (o *OrgUserUpdateRequest) HasTeamIds() bool { + if o != nil && !IsNil(o.TeamIds) { + return true + } + + return false +} + +// SetTeamIds gets a reference to the given []string and assigns it to the TeamIds field. +func (o *OrgUserUpdateRequest) SetTeamIds(v []string) { + o.TeamIds = &v +} diff --git a/admin/model_paginated_api_versions.go b/admin/model_paginated_api_versions.go new file mode 100644 index 000000000..cfa328629 --- /dev/null +++ b/admin/model_paginated_api_versions.go @@ -0,0 +1,132 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// PaginatedApiVersions struct for PaginatedApiVersions +type PaginatedApiVersions 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 *[]ApiVersion `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"` +} + +// NewPaginatedApiVersions instantiates a new PaginatedApiVersions 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 NewPaginatedApiVersions() *PaginatedApiVersions { + this := PaginatedApiVersions{} + return &this +} + +// NewPaginatedApiVersionsWithDefaults instantiates a new PaginatedApiVersions 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 NewPaginatedApiVersionsWithDefaults() *PaginatedApiVersions { + this := PaginatedApiVersions{} + return &this +} + +// GetLinks returns the Links field value if set, zero value otherwise +func (o *PaginatedApiVersions) 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 *PaginatedApiVersions) 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 *PaginatedApiVersions) 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 *PaginatedApiVersions) SetLinks(v []Link) { + o.Links = &v +} + +// GetResults returns the Results field value if set, zero value otherwise +func (o *PaginatedApiVersions) GetResults() []ApiVersion { + if o == nil || IsNil(o.Results) { + var ret []ApiVersion + 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 *PaginatedApiVersions) GetResultsOk() (*[]ApiVersion, 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 *PaginatedApiVersions) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []ApiVersion and assigns it to the Results field. +func (o *PaginatedApiVersions) SetResults(v []ApiVersion) { + o.Results = &v +} + +// GetTotalCount returns the TotalCount field value if set, zero value otherwise +func (o *PaginatedApiVersions) 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 *PaginatedApiVersions) 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 *PaginatedApiVersions) 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 *PaginatedApiVersions) SetTotalCount(v int) { + o.TotalCount = &v +} diff --git a/admin/model_paginated_org_user.go b/admin/model_paginated_org_user.go new file mode 100644 index 000000000..719dde2cb --- /dev/null +++ b/admin/model_paginated_org_user.go @@ -0,0 +1,132 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// PaginatedOrgUser struct for PaginatedOrgUser +type PaginatedOrgUser 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 *[]OrgUserResponse `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"` +} + +// NewPaginatedOrgUser instantiates a new PaginatedOrgUser 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 NewPaginatedOrgUser() *PaginatedOrgUser { + this := PaginatedOrgUser{} + return &this +} + +// NewPaginatedOrgUserWithDefaults instantiates a new PaginatedOrgUser 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 NewPaginatedOrgUserWithDefaults() *PaginatedOrgUser { + this := PaginatedOrgUser{} + return &this +} + +// GetLinks returns the Links field value if set, zero value otherwise +func (o *PaginatedOrgUser) 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 *PaginatedOrgUser) 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 *PaginatedOrgUser) 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 *PaginatedOrgUser) SetLinks(v []Link) { + o.Links = &v +} + +// GetResults returns the Results field value if set, zero value otherwise +func (o *PaginatedOrgUser) GetResults() []OrgUserResponse { + if o == nil || IsNil(o.Results) { + var ret []OrgUserResponse + 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 *PaginatedOrgUser) GetResultsOk() (*[]OrgUserResponse, 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 *PaginatedOrgUser) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []OrgUserResponse and assigns it to the Results field. +func (o *PaginatedOrgUser) SetResults(v []OrgUserResponse) { + o.Results = &v +} + +// GetTotalCount returns the TotalCount field value if set, zero value otherwise +func (o *PaginatedOrgUser) 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 *PaginatedOrgUser) 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 *PaginatedOrgUser) 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 *PaginatedOrgUser) SetTotalCount(v int) { + o.TotalCount = &v +} diff --git a/admin/model_protected_hours.go b/admin/model_protected_hours.go new file mode 100644 index 000000000..9d56ad080 --- /dev/null +++ b/admin/model_protected_hours.go @@ -0,0 +1,94 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// ProtectedHours Defines the a window where maintenance will not begin within. +type ProtectedHours struct { + // Zero-based integer that represents the end hour of the of the day that the maintenance will not begin in. + EndHourOfDay *int `json:"endHourOfDay,omitempty"` + // Zero-based integer that represents the beginning hour of the of the day that the maintenance will not begin in. + StartHourOfDay *int `json:"startHourOfDay,omitempty"` +} + +// NewProtectedHours instantiates a new ProtectedHours 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 NewProtectedHours() *ProtectedHours { + this := ProtectedHours{} + return &this +} + +// NewProtectedHoursWithDefaults instantiates a new ProtectedHours 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 NewProtectedHoursWithDefaults() *ProtectedHours { + this := ProtectedHours{} + return &this +} + +// GetEndHourOfDay returns the EndHourOfDay field value if set, zero value otherwise +func (o *ProtectedHours) GetEndHourOfDay() int { + if o == nil || IsNil(o.EndHourOfDay) { + var ret int + return ret + } + return *o.EndHourOfDay +} + +// GetEndHourOfDayOk returns a tuple with the EndHourOfDay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtectedHours) GetEndHourOfDayOk() (*int, bool) { + if o == nil || IsNil(o.EndHourOfDay) { + return nil, false + } + + return o.EndHourOfDay, true +} + +// HasEndHourOfDay returns a boolean if a field has been set. +func (o *ProtectedHours) HasEndHourOfDay() bool { + if o != nil && !IsNil(o.EndHourOfDay) { + return true + } + + return false +} + +// SetEndHourOfDay gets a reference to the given int and assigns it to the EndHourOfDay field. +func (o *ProtectedHours) SetEndHourOfDay(v int) { + o.EndHourOfDay = &v +} + +// GetStartHourOfDay returns the StartHourOfDay field value if set, zero value otherwise +func (o *ProtectedHours) GetStartHourOfDay() int { + if o == nil || IsNil(o.StartHourOfDay) { + var ret int + return ret + } + return *o.StartHourOfDay +} + +// GetStartHourOfDayOk returns a tuple with the StartHourOfDay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtectedHours) GetStartHourOfDayOk() (*int, bool) { + if o == nil || IsNil(o.StartHourOfDay) { + return nil, false + } + + return o.StartHourOfDay, true +} + +// HasStartHourOfDay returns a boolean if a field has been set. +func (o *ProtectedHours) HasStartHourOfDay() bool { + if o != nil && !IsNil(o.StartHourOfDay) { + return true + } + + return false +} + +// SetStartHourOfDay gets a reference to the given int and assigns it to the StartHourOfDay field. +func (o *ProtectedHours) SetStartHourOfDay(v int) { + o.StartHourOfDay = &v +} diff --git a/admin/model_state_reason.go b/admin/model_state_reason.go new file mode 100644 index 000000000..bd6212cdb --- /dev/null +++ b/admin/model_state_reason.go @@ -0,0 +1,94 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// StateReason State reason of the Job. This is set when the job state is \"Failed\". +type StateReason struct { + // Error code relating to state. + ErrorCode *string `json:"errorCode,omitempty"` + // Message describing error or state. + Message *string `json:"message,omitempty"` +} + +// NewStateReason instantiates a new StateReason 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 NewStateReason() *StateReason { + this := StateReason{} + return &this +} + +// NewStateReasonWithDefaults instantiates a new StateReason 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 NewStateReasonWithDefaults() *StateReason { + this := StateReason{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise +func (o *StateReason) GetErrorCode() string { + if o == nil || IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StateReason) GetErrorCodeOk() (*string, bool) { + if o == nil || IsNil(o.ErrorCode) { + return nil, false + } + + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *StateReason) HasErrorCode() bool { + if o != nil && !IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *StateReason) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise +func (o *StateReason) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StateReason) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *StateReason) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *StateReason) SetMessage(v string) { + o.Message = &v +} diff --git a/admin/model_streams_connection.go b/admin/model_streams_connection.go index 1ca464d6a..1e2640bf9 100644 --- a/admin/model_streams_connection.go +++ b/admin/model_streams_connection.go @@ -21,12 +21,8 @@ type StreamsConnection struct { Config *map[string]string `json:"config,omitempty"` Networking *StreamsKafkaNetworking `json:"networking,omitempty"` Security *StreamsKafkaSecurity `json:"security,omitempty"` - // The amount of seconds to wait before timing out a connection. - ConnectionTimeoutSec *int `json:"connectionTimeoutSec,omitempty"` // A map of key-value pairs that will be passed as headers for the request. Headers *map[string]string `json:"headers,omitempty"` - // The amount of seconds to wait before timing out a request. - RequestTimeoutSec *int `json:"requestTimeoutSec,omitempty"` // The url to be used for the request. Url *string `json:"url,omitempty"` } @@ -378,39 +374,6 @@ func (o *StreamsConnection) SetSecurity(v StreamsKafkaSecurity) { o.Security = &v } -// GetConnectionTimeoutSec returns the ConnectionTimeoutSec field value if set, zero value otherwise -func (o *StreamsConnection) GetConnectionTimeoutSec() int { - if o == nil || IsNil(o.ConnectionTimeoutSec) { - var ret int - return ret - } - return *o.ConnectionTimeoutSec -} - -// GetConnectionTimeoutSecOk returns a tuple with the ConnectionTimeoutSec field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StreamsConnection) GetConnectionTimeoutSecOk() (*int, bool) { - if o == nil || IsNil(o.ConnectionTimeoutSec) { - return nil, false - } - - return o.ConnectionTimeoutSec, true -} - -// HasConnectionTimeoutSec returns a boolean if a field has been set. -func (o *StreamsConnection) HasConnectionTimeoutSec() bool { - if o != nil && !IsNil(o.ConnectionTimeoutSec) { - return true - } - - return false -} - -// SetConnectionTimeoutSec gets a reference to the given int and assigns it to the ConnectionTimeoutSec field. -func (o *StreamsConnection) SetConnectionTimeoutSec(v int) { - o.ConnectionTimeoutSec = &v -} - // GetHeaders returns the Headers field value if set, zero value otherwise func (o *StreamsConnection) GetHeaders() map[string]string { if o == nil || IsNil(o.Headers) { @@ -444,39 +407,6 @@ func (o *StreamsConnection) SetHeaders(v map[string]string) { o.Headers = &v } -// GetRequestTimeoutSec returns the RequestTimeoutSec field value if set, zero value otherwise -func (o *StreamsConnection) GetRequestTimeoutSec() int { - if o == nil || IsNil(o.RequestTimeoutSec) { - var ret int - return ret - } - return *o.RequestTimeoutSec -} - -// GetRequestTimeoutSecOk returns a tuple with the RequestTimeoutSec field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *StreamsConnection) GetRequestTimeoutSecOk() (*int, bool) { - if o == nil || IsNil(o.RequestTimeoutSec) { - return nil, false - } - - return o.RequestTimeoutSec, true -} - -// HasRequestTimeoutSec returns a boolean if a field has been set. -func (o *StreamsConnection) HasRequestTimeoutSec() bool { - if o != nil && !IsNil(o.RequestTimeoutSec) { - return true - } - - return false -} - -// SetRequestTimeoutSec gets a reference to the given int and assigns it to the RequestTimeoutSec field. -func (o *StreamsConnection) SetRequestTimeoutSec(v int) { - o.RequestTimeoutSec = &v -} - // GetUrl returns the Url field value if set, zero value otherwise func (o *StreamsConnection) GetUrl() string { if o == nil || IsNil(o.Url) { diff --git a/admin/model_streams_modify_stream_processor.go b/admin/model_streams_modify_stream_processor.go new file mode 100644 index 000000000..f049fcdc9 --- /dev/null +++ b/admin/model_streams_modify_stream_processor.go @@ -0,0 +1,164 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// StreamsModifyStreamProcessor A request to modify an existing stream processor +type StreamsModifyStreamProcessor 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"` + // New name for the stream processor. + Name *string `json:"name,omitempty"` + Options *StreamsModifyStreamProcessorOptions `json:"options,omitempty"` + // New pipeline for the stream processor. + Pipeline *[]any `json:"pipeline,omitempty"` +} + +// NewStreamsModifyStreamProcessor instantiates a new StreamsModifyStreamProcessor 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 NewStreamsModifyStreamProcessor() *StreamsModifyStreamProcessor { + this := StreamsModifyStreamProcessor{} + return &this +} + +// NewStreamsModifyStreamProcessorWithDefaults instantiates a new StreamsModifyStreamProcessor 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 NewStreamsModifyStreamProcessorWithDefaults() *StreamsModifyStreamProcessor { + this := StreamsModifyStreamProcessor{} + return &this +} + +// GetLinks returns the Links field value if set, zero value otherwise +func (o *StreamsModifyStreamProcessor) 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 *StreamsModifyStreamProcessor) 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 *StreamsModifyStreamProcessor) 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 *StreamsModifyStreamProcessor) SetLinks(v []Link) { + o.Links = &v +} + +// GetName returns the Name field value if set, zero value otherwise +func (o *StreamsModifyStreamProcessor) 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 *StreamsModifyStreamProcessor) 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 *StreamsModifyStreamProcessor) 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 *StreamsModifyStreamProcessor) SetName(v string) { + o.Name = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise +func (o *StreamsModifyStreamProcessor) GetOptions() StreamsModifyStreamProcessorOptions { + if o == nil || IsNil(o.Options) { + var ret StreamsModifyStreamProcessorOptions + return ret + } + return *o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamsModifyStreamProcessor) GetOptionsOk() (*StreamsModifyStreamProcessorOptions, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *StreamsModifyStreamProcessor) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given StreamsModifyStreamProcessorOptions and assigns it to the Options field. +func (o *StreamsModifyStreamProcessor) SetOptions(v StreamsModifyStreamProcessorOptions) { + o.Options = &v +} + +// GetPipeline returns the Pipeline field value if set, zero value otherwise +func (o *StreamsModifyStreamProcessor) GetPipeline() []any { + if o == nil || IsNil(o.Pipeline) { + var ret []any + return ret + } + return *o.Pipeline +} + +// GetPipelineOk returns a tuple with the Pipeline field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamsModifyStreamProcessor) GetPipelineOk() (*[]any, bool) { + if o == nil || IsNil(o.Pipeline) { + return nil, false + } + + return o.Pipeline, true +} + +// HasPipeline returns a boolean if a field has been set. +func (o *StreamsModifyStreamProcessor) HasPipeline() bool { + if o != nil && !IsNil(o.Pipeline) { + return true + } + + return false +} + +// SetPipeline gets a reference to the given []any and assigns it to the Pipeline field. +func (o *StreamsModifyStreamProcessor) SetPipeline(v []any) { + o.Pipeline = &v +} diff --git a/admin/model_streams_modify_stream_processor_options.go b/admin/model_streams_modify_stream_processor_options.go new file mode 100644 index 000000000..a0e002677 --- /dev/null +++ b/admin/model_streams_modify_stream_processor_options.go @@ -0,0 +1,129 @@ +// Code based on the AtlasAPI V2 OpenAPI file + +package admin + +// StreamsModifyStreamProcessorOptions Additional options for modifying a stream processor. +type StreamsModifyStreamProcessorOptions struct { + Dlq *StreamsDLQ `json:"dlq,omitempty"` + // 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"` + // When true, the modified stream processor resumes from its last checkpoint. + ResumeFromCheckpoint *bool `json:"resumeFromCheckpoint,omitempty"` +} + +// NewStreamsModifyStreamProcessorOptions instantiates a new StreamsModifyStreamProcessorOptions 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 NewStreamsModifyStreamProcessorOptions() *StreamsModifyStreamProcessorOptions { + this := StreamsModifyStreamProcessorOptions{} + return &this +} + +// NewStreamsModifyStreamProcessorOptionsWithDefaults instantiates a new StreamsModifyStreamProcessorOptions 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 NewStreamsModifyStreamProcessorOptionsWithDefaults() *StreamsModifyStreamProcessorOptions { + this := StreamsModifyStreamProcessorOptions{} + return &this +} + +// GetDlq returns the Dlq field value if set, zero value otherwise +func (o *StreamsModifyStreamProcessorOptions) GetDlq() StreamsDLQ { + if o == nil || IsNil(o.Dlq) { + var ret StreamsDLQ + return ret + } + return *o.Dlq +} + +// GetDlqOk returns a tuple with the Dlq field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamsModifyStreamProcessorOptions) GetDlqOk() (*StreamsDLQ, bool) { + if o == nil || IsNil(o.Dlq) { + return nil, false + } + + return o.Dlq, true +} + +// HasDlq returns a boolean if a field has been set. +func (o *StreamsModifyStreamProcessorOptions) HasDlq() bool { + if o != nil && !IsNil(o.Dlq) { + return true + } + + return false +} + +// SetDlq gets a reference to the given StreamsDLQ and assigns it to the Dlq field. +func (o *StreamsModifyStreamProcessorOptions) SetDlq(v StreamsDLQ) { + o.Dlq = &v +} + +// GetLinks returns the Links field value if set, zero value otherwise +func (o *StreamsModifyStreamProcessorOptions) 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 *StreamsModifyStreamProcessorOptions) 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 *StreamsModifyStreamProcessorOptions) 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 *StreamsModifyStreamProcessorOptions) SetLinks(v []Link) { + o.Links = &v +} + +// GetResumeFromCheckpoint returns the ResumeFromCheckpoint field value if set, zero value otherwise +func (o *StreamsModifyStreamProcessorOptions) GetResumeFromCheckpoint() bool { + if o == nil || IsNil(o.ResumeFromCheckpoint) { + var ret bool + return ret + } + return *o.ResumeFromCheckpoint +} + +// GetResumeFromCheckpointOk returns a tuple with the ResumeFromCheckpoint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StreamsModifyStreamProcessorOptions) GetResumeFromCheckpointOk() (*bool, bool) { + if o == nil || IsNil(o.ResumeFromCheckpoint) { + return nil, false + } + + return o.ResumeFromCheckpoint, true +} + +// HasResumeFromCheckpoint returns a boolean if a field has been set. +func (o *StreamsModifyStreamProcessorOptions) HasResumeFromCheckpoint() bool { + if o != nil && !IsNil(o.ResumeFromCheckpoint) { + return true + } + + return false +} + +// SetResumeFromCheckpoint gets a reference to the given bool and assigns it to the ResumeFromCheckpoint field. +func (o *StreamsModifyStreamProcessorOptions) SetResumeFromCheckpoint(v bool) { + o.ResumeFromCheckpoint = &v +} diff --git a/admin/model_team.go b/admin/model_team.go index 8889fe369..d8918f0f7 100644 --- a/admin/model_team.go +++ b/admin/model_team.go @@ -13,16 +13,17 @@ type Team struct { // Human-readable label that identifies the team. Name string `json:"name"` // List that contains the MongoDB Cloud users in this team. - Usernames *[]string `json:"usernames,omitempty"` + Usernames []string `json:"usernames"` } // NewTeam instantiates a new Team 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 NewTeam(name string) *Team { +func NewTeam(name string, usernames []string) *Team { this := Team{} this.Name = name + this.Usernames = usernames return &this } @@ -124,35 +125,26 @@ func (o *Team) SetName(v string) { o.Name = v } -// GetUsernames returns the Usernames field value if set, zero value otherwise +// GetUsernames returns the Usernames field value func (o *Team) GetUsernames() []string { - if o == nil || IsNil(o.Usernames) { + if o == nil { var ret []string return ret } - return *o.Usernames + + return o.Usernames } -// GetUsernamesOk returns a tuple with the Usernames field value if set, nil otherwise +// GetUsernamesOk returns a tuple with the Usernames field value // and a boolean to check if the value has been set. func (o *Team) GetUsernamesOk() (*[]string, bool) { - if o == nil || IsNil(o.Usernames) { + if o == nil { return nil, false } - - return o.Usernames, true -} - -// HasUsernames returns a boolean if a field has been set. -func (o *Team) HasUsernames() bool { - if o != nil && !IsNil(o.Usernames) { - return true - } - - return false + return &o.Usernames, true } -// SetUsernames gets a reference to the given []string and assigns it to the Usernames field. +// SetUsernames sets field value func (o *Team) SetUsernames(v []string) { - o.Usernames = &v + o.Usernames = v } diff --git a/auth/clientcredentials/clientcredentials.go b/auth/clientcredentials/clientcredentials.go index 2ca20ffe2..5d92c7c0f 100644 --- a/auth/clientcredentials/clientcredentials.go +++ b/auth/clientcredentials/clientcredentials.go @@ -10,8 +10,8 @@ import ( "net/url" "strings" - "go.mongodb.org/atlas-sdk/v20241113001/auth" - "go.mongodb.org/atlas-sdk/v20241113001/internal/core" + "github.com/mongodb/atlas-sdk-go/auth" + "github.com/mongodb/atlas-sdk-go/internal/core" "golang.org/x/oauth2/clientcredentials" ) diff --git a/auth/clientcredentials/clientcredentials_test.go b/auth/clientcredentials/clientcredentials_test.go index 35eea5a1e..20f431fc7 100644 --- a/auth/clientcredentials/clientcredentials_test.go +++ b/auth/clientcredentials/clientcredentials_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "go.mongodb.org/atlas-sdk/v20241113001/auth" + "github.com/mongodb/atlas-sdk-go/auth" ) // mockOAuthRevokeEndpoint creates a mock OAuth revoke endpoint, diff --git a/auth/code/device_flow.go b/auth/code/device_flow.go index f195e963c..6d353bddb 100644 --- a/auth/code/device_flow.go +++ b/auth/code/device_flow.go @@ -22,7 +22,7 @@ import ( "strings" "time" - core "go.mongodb.org/atlas-sdk/v20241113001/internal/core" + core "github.com/mongodb/atlas-sdk-go/internal/core" ) const authExpiredError = "DEVICE_AUTHORIZATION_EXPIRED" diff --git a/auth/code/oauth.go b/auth/code/oauth.go index 8cd68f770..f9e4a9bd5 100644 --- a/auth/code/oauth.go +++ b/auth/code/oauth.go @@ -26,7 +26,7 @@ import ( "runtime" "strings" - "go.mongodb.org/atlas-sdk/v20241113001/internal/core" + "github.com/mongodb/atlas-sdk-go/internal/core" ) const defaultBaseURL = "https://cloud.mongodb.com/" diff --git a/auth/code/oauth_test.go b/auth/code/oauth_test.go index a500e7d71..1234427b1 100644 --- a/auth/code/oauth_test.go +++ b/auth/code/oauth_test.go @@ -24,7 +24,7 @@ import ( "reflect" "testing" - core "go.mongodb.org/atlas-sdk/v20241113001/internal/core" + core "github.com/mongodb/atlas-sdk-go/internal/core" ) const ( diff --git a/examples/aws_cluster/aws.go b/examples/aws_cluster/aws.go index c76b3f87a..c12a81352 100644 --- a/examples/aws_cluster/aws.go +++ b/examples/aws_cluster/aws.go @@ -10,8 +10,8 @@ import ( "context" - "go.mongodb.org/atlas-sdk/v20241113001/admin" - "go.mongodb.org/atlas-sdk/v20241113001/examples" + "github.com/mongodb/atlas-sdk-go/admin" + "github.com/mongodb/atlas-sdk-go/examples" ) /* diff --git a/examples/basic/basic.go b/examples/basic/basic.go index 265ec7dc3..731342a99 100644 --- a/examples/basic/basic.go +++ b/examples/basic/basic.go @@ -7,8 +7,8 @@ import ( "context" - "go.mongodb.org/atlas-sdk/v20241113001/admin" - "go.mongodb.org/atlas-sdk/v20241113001/examples" + "github.com/mongodb/atlas-sdk-go/admin" + "github.com/mongodb/atlas-sdk-go/examples" ) /* diff --git a/examples/db_users/db_users.go b/examples/db_users/db_users.go index 2ddd59a1b..0ba40cbd5 100644 --- a/examples/db_users/db_users.go +++ b/examples/db_users/db_users.go @@ -6,8 +6,8 @@ import ( "context" - "go.mongodb.org/atlas-sdk/v20241113001/admin" - "go.mongodb.org/atlas-sdk/v20241113001/examples" + "github.com/mongodb/atlas-sdk-go/admin" + "github.com/mongodb/atlas-sdk-go/examples" ) const ( diff --git a/examples/download/downloadLogs.go b/examples/download/downloadLogs.go index 73a5057ff..7b1ca274f 100644 --- a/examples/download/downloadLogs.go +++ b/examples/download/downloadLogs.go @@ -7,8 +7,8 @@ import ( "context" - "go.mongodb.org/atlas-sdk/v20241113001/admin" - "go.mongodb.org/atlas-sdk/v20241113001/examples" + "github.com/mongodb/atlas-sdk-go/admin" + "github.com/mongodb/atlas-sdk-go/examples" ) /* diff --git a/examples/errors.go b/examples/errors.go index e77f0ef68..7c6a28ad7 100644 --- a/examples/errors.go +++ b/examples/errors.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "go.mongodb.org/atlas-sdk/v20241113001/admin" + "github.com/mongodb/atlas-sdk-go/admin" ) func HandleErr(err error, resp *http.Response) { diff --git a/examples/go.mod b/examples/go.mod index a7ccf52f4..43b3cc9d4 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -1,18 +1,20 @@ -module go.mongodb.org/atlas-sdk/v20241113001/examples +module github.com/mongodb/atlas-sdk-go/examples go 1.22.0 toolchain go1.23.1 -replace go.mongodb.org/atlas-sdk/v20241113001 => ../ +replace github.com/mongodb/atlas-sdk-go => ../ require ( github.com/hashicorp/go-retryablehttp v0.7.7 github.com/mongodb-forks/digest v1.1.0 - go.mongodb.org/atlas-sdk/v20241113001 v20241113001.1.0 ) -require golang.org/x/oauth2 v0.24.0 // indirect +require ( + github.com/mongodb/atlas-sdk-go v1.0.0 // indirect + golang.org/x/oauth2 v0.24.0 // indirect +) require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/examples/invoice/invoice.go b/examples/invoice/invoice.go index 2f2c6e397..f5e41b040 100644 --- a/examples/invoice/invoice.go +++ b/examples/invoice/invoice.go @@ -7,8 +7,8 @@ import ( "context" - "go.mongodb.org/atlas-sdk/v20241113001/admin" - "go.mongodb.org/atlas-sdk/v20241113001/examples" + "github.com/mongodb/atlas-sdk-go/admin" + "github.com/mongodb/atlas-sdk-go/examples" ) func main() { diff --git a/examples/mock/cluster_test.go b/examples/mock/cluster_test.go index 75d6f7c94..087433514 100644 --- a/examples/mock/cluster_test.go +++ b/examples/mock/cluster_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "go.mongodb.org/atlas-sdk/v20241113001/admin" - "go.mongodb.org/atlas-sdk/v20241113001/mockadmin" + "github.com/mongodb/atlas-sdk-go/admin" + "github.com/mongodb/atlas-sdk-go/mockadmin" ) func myFunctionCallingListClusters(clusterAPI admin.ClustersApi) (int, error) { diff --git a/examples/regions/regions.go b/examples/regions/regions.go index acd1aad03..25e110610 100644 --- a/examples/regions/regions.go +++ b/examples/regions/regions.go @@ -7,8 +7,8 @@ import ( "context" - "go.mongodb.org/atlas-sdk/v20241113001/admin" - "go.mongodb.org/atlas-sdk/v20241113001/examples" + "github.com/mongodb/atlas-sdk-go/admin" + "github.com/mongodb/atlas-sdk-go/examples" ) /* diff --git a/examples/retry/retry.go b/examples/retry/retry.go index 51b7740f9..420790b1c 100644 --- a/examples/retry/retry.go +++ b/examples/retry/retry.go @@ -8,7 +8,7 @@ import ( "context" - "go.mongodb.org/atlas-sdk/v20241113001/admin" + "github.com/mongodb/atlas-sdk-go/admin" retryablehttp "github.com/hashicorp/go-retryablehttp" "github.com/mongodb-forks/digest" diff --git a/examples/service_account_management/sa_management.go b/examples/service_account_management/sa_management.go index b31c19781..25223b88c 100644 --- a/examples/service_account_management/sa_management.go +++ b/examples/service_account_management/sa_management.go @@ -6,7 +6,7 @@ import ( "log" "os" - "go.mongodb.org/atlas-sdk/v20241113001/admin" + "github.com/mongodb/atlas-sdk-go/admin" ) // Example for Service Account Management API diff --git a/examples/service_account_token_store/cached_token.go b/examples/service_account_token_store/cached_token.go index 80de30604..d11bead22 100644 --- a/examples/service_account_token_store/cached_token.go +++ b/examples/service_account_token_store/cached_token.go @@ -4,13 +4,13 @@ import ( "context" "encoding/json" "fmt" - "go.mongodb.org/atlas-sdk/v20241113001/auth" + "github.com/mongodb/atlas-sdk-go/auth" "log" "os" "strings" - "go.mongodb.org/atlas-sdk/v20241113001/admin" - "go.mongodb.org/atlas-sdk/v20241113001/auth/clientcredentials" + "github.com/mongodb/atlas-sdk-go/admin" + "github.com/mongodb/atlas-sdk-go/auth/clientcredentials" ) // Variable provided as example. diff --git a/go.mod b/go.mod index d031790f2..ca9299011 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module go.mongodb.org/atlas-sdk/v20241113001 +module github.com/mongodb/atlas-sdk-go go 1.22.0 diff --git a/mockadmin/access_tracking_api.go b/mockadmin/access_tracking_api.go index ff487299f..727d3feaf 100644 --- a/mockadmin/access_tracking_api.go +++ b/mockadmin/access_tracking_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/alert_configurations_api.go b/mockadmin/alert_configurations_api.go index 485d46dad..09d640271 100644 --- a/mockadmin/alert_configurations_api.go +++ b/mockadmin/alert_configurations_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/alerts_api.go b/mockadmin/alerts_api.go index f03b5bb9b..dd7b998b4 100644 --- a/mockadmin/alerts_api.go +++ b/mockadmin/alerts_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/atlas_search_api.go b/mockadmin/atlas_search_api.go index b9d82948a..c4f6e606d 100644 --- a/mockadmin/atlas_search_api.go +++ b/mockadmin/atlas_search_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/auditing_api.go b/mockadmin/auditing_api.go index b421612f3..d76a7ec84 100644 --- a/mockadmin/auditing_api.go +++ b/mockadmin/auditing_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/aws_clusters_dns_api.go b/mockadmin/aws_clusters_dns_api.go index 0cca188a2..6f8f303a1 100644 --- a/mockadmin/aws_clusters_dns_api.go +++ b/mockadmin/aws_clusters_dns_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/cloud_backups_api.go b/mockadmin/cloud_backups_api.go index e7776dcf5..f8c04461d 100644 --- a/mockadmin/cloud_backups_api.go +++ b/mockadmin/cloud_backups_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/cloud_migration_service_api.go b/mockadmin/cloud_migration_service_api.go index b75410ebd..c67324cfd 100644 --- a/mockadmin/cloud_migration_service_api.go +++ b/mockadmin/cloud_migration_service_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/cloud_provider_access_api.go b/mockadmin/cloud_provider_access_api.go index 12b0ea736..5dcdb3d0e 100644 --- a/mockadmin/cloud_provider_access_api.go +++ b/mockadmin/cloud_provider_access_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/cluster_outage_simulation_api.go b/mockadmin/cluster_outage_simulation_api.go index 49f83f31f..964087740 100644 --- a/mockadmin/cluster_outage_simulation_api.go +++ b/mockadmin/cluster_outage_simulation_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/clusters_api.go b/mockadmin/clusters_api.go index 13e349073..81e472302 100644 --- a/mockadmin/clusters_api.go +++ b/mockadmin/clusters_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/collection_level_metrics_api.go b/mockadmin/collection_level_metrics_api.go index 79f28ab76..f4e5debc7 100644 --- a/mockadmin/collection_level_metrics_api.go +++ b/mockadmin/collection_level_metrics_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/custom_database_roles_api.go b/mockadmin/custom_database_roles_api.go index 88ed30d9b..ed0cb9dbb 100644 --- a/mockadmin/custom_database_roles_api.go +++ b/mockadmin/custom_database_roles_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/data_federation_api.go b/mockadmin/data_federation_api.go index 6ca0d2330..72a4da14f 100644 --- a/mockadmin/data_federation_api.go +++ b/mockadmin/data_federation_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/data_lake_pipelines_api.go b/mockadmin/data_lake_pipelines_api.go index 8b88525d0..f82e84c03 100644 --- a/mockadmin/data_lake_pipelines_api.go +++ b/mockadmin/data_lake_pipelines_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/database_users_api.go b/mockadmin/database_users_api.go index 1a396ddb7..ee2e2c8a4 100644 --- a/mockadmin/database_users_api.go +++ b/mockadmin/database_users_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/encryption_at_rest_using_customer_key_management_api.go b/mockadmin/encryption_at_rest_using_customer_key_management_api.go index 2f947ce5c..d380d4307 100644 --- a/mockadmin/encryption_at_rest_using_customer_key_management_api.go +++ b/mockadmin/encryption_at_rest_using_customer_key_management_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/events_api.go b/mockadmin/events_api.go index 593c0af26..f4a8dc183 100644 --- a/mockadmin/events_api.go +++ b/mockadmin/events_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/federated_authentication_api.go b/mockadmin/federated_authentication_api.go index 3108ef32c..85b2fb59c 100644 --- a/mockadmin/federated_authentication_api.go +++ b/mockadmin/federated_authentication_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/flex_clusters_api.go b/mockadmin/flex_clusters_api.go index f6b09a83d..32ffd0454 100644 --- a/mockadmin/flex_clusters_api.go +++ b/mockadmin/flex_clusters_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/flex_restore_jobs_api.go b/mockadmin/flex_restore_jobs_api.go index 3ca6d65fa..c643a3965 100644 --- a/mockadmin/flex_restore_jobs_api.go +++ b/mockadmin/flex_restore_jobs_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/flex_snapshots_api.go b/mockadmin/flex_snapshots_api.go index 83cea2a28..c8e9f18a9 100644 --- a/mockadmin/flex_snapshots_api.go +++ b/mockadmin/flex_snapshots_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/global_clusters_api.go b/mockadmin/global_clusters_api.go index 11b970175..3aad43d49 100644 --- a/mockadmin/global_clusters_api.go +++ b/mockadmin/global_clusters_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/invoices_api.go b/mockadmin/invoices_api.go index 171647a1c..5c1b3eb18 100644 --- a/mockadmin/invoices_api.go +++ b/mockadmin/invoices_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/ldap_configuration_api.go b/mockadmin/ldap_configuration_api.go index f70527a89..c3e6a5669 100644 --- a/mockadmin/ldap_configuration_api.go +++ b/mockadmin/ldap_configuration_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/legacy_backup_api.go b/mockadmin/legacy_backup_api.go index f156c661c..3e941d5cc 100644 --- a/mockadmin/legacy_backup_api.go +++ b/mockadmin/legacy_backup_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/maintenance_windows_api.go b/mockadmin/maintenance_windows_api.go index 25b9b736e..ec4bda7f9 100644 --- a/mockadmin/maintenance_windows_api.go +++ b/mockadmin/maintenance_windows_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/mongo_db_cloud_users_api.go b/mockadmin/mongo_db_cloud_users_api.go index 99fd124fd..164f91622 100644 --- a/mockadmin/mongo_db_cloud_users_api.go +++ b/mockadmin/mongo_db_cloud_users_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" @@ -25,76 +25,78 @@ func (_m *MongoDBCloudUsersApi) EXPECT() *MongoDBCloudUsersApi_Expecter { return &MongoDBCloudUsersApi_Expecter{mock: &_m.Mock} } -// CreateUser provides a mock function with given fields: ctx, cloudAppUser -func (_m *MongoDBCloudUsersApi) CreateUser(ctx context.Context, cloudAppUser *admin.CloudAppUser) admin.CreateUserApiRequest { - ret := _m.Called(ctx, cloudAppUser) +// AddOrganizationRole provides a mock function with given fields: ctx, orgId, userId, addOrRemoveOrgRole +func (_m *MongoDBCloudUsersApi) AddOrganizationRole(ctx context.Context, orgId string, userId string, addOrRemoveOrgRole *admin.AddOrRemoveOrgRole) admin.AddOrganizationRoleApiRequest { + ret := _m.Called(ctx, orgId, userId, addOrRemoveOrgRole) if len(ret) == 0 { - panic("no return value specified for CreateUser") + panic("no return value specified for AddOrganizationRole") } - var r0 admin.CreateUserApiRequest - if rf, ok := ret.Get(0).(func(context.Context, *admin.CloudAppUser) admin.CreateUserApiRequest); ok { - r0 = rf(ctx, cloudAppUser) + var r0 admin.AddOrganizationRoleApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.AddOrRemoveOrgRole) admin.AddOrganizationRoleApiRequest); ok { + r0 = rf(ctx, orgId, userId, addOrRemoveOrgRole) } else { - r0 = ret.Get(0).(admin.CreateUserApiRequest) + r0 = ret.Get(0).(admin.AddOrganizationRoleApiRequest) } return r0 } -// MongoDBCloudUsersApi_CreateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUser' -type MongoDBCloudUsersApi_CreateUser_Call struct { +// MongoDBCloudUsersApi_AddOrganizationRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddOrganizationRole' +type MongoDBCloudUsersApi_AddOrganizationRole_Call struct { *mock.Call } -// CreateUser is a helper method to define mock.On call +// AddOrganizationRole is a helper method to define mock.On call // - ctx context.Context -// - cloudAppUser *admin.CloudAppUser -func (_e *MongoDBCloudUsersApi_Expecter) CreateUser(ctx any, cloudAppUser any) *MongoDBCloudUsersApi_CreateUser_Call { - return &MongoDBCloudUsersApi_CreateUser_Call{Call: _e.mock.On("CreateUser", ctx, cloudAppUser)} +// - orgId string +// - userId string +// - addOrRemoveOrgRole *admin.AddOrRemoveOrgRole +func (_e *MongoDBCloudUsersApi_Expecter) AddOrganizationRole(ctx any, orgId any, userId any, addOrRemoveOrgRole any) *MongoDBCloudUsersApi_AddOrganizationRole_Call { + return &MongoDBCloudUsersApi_AddOrganizationRole_Call{Call: _e.mock.On("AddOrganizationRole", ctx, orgId, userId, addOrRemoveOrgRole)} } -func (_c *MongoDBCloudUsersApi_CreateUser_Call) Run(run func(ctx context.Context, cloudAppUser *admin.CloudAppUser)) *MongoDBCloudUsersApi_CreateUser_Call { +func (_c *MongoDBCloudUsersApi_AddOrganizationRole_Call) Run(run func(ctx context.Context, orgId string, userId string, addOrRemoveOrgRole *admin.AddOrRemoveOrgRole)) *MongoDBCloudUsersApi_AddOrganizationRole_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*admin.CloudAppUser)) + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.AddOrRemoveOrgRole)) }) return _c } -func (_c *MongoDBCloudUsersApi_CreateUser_Call) Return(_a0 admin.CreateUserApiRequest) *MongoDBCloudUsersApi_CreateUser_Call { +func (_c *MongoDBCloudUsersApi_AddOrganizationRole_Call) Return(_a0 admin.AddOrganizationRoleApiRequest) *MongoDBCloudUsersApi_AddOrganizationRole_Call { _c.Call.Return(_a0) return _c } -func (_c *MongoDBCloudUsersApi_CreateUser_Call) RunAndReturn(run func(context.Context, *admin.CloudAppUser) admin.CreateUserApiRequest) *MongoDBCloudUsersApi_CreateUser_Call { +func (_c *MongoDBCloudUsersApi_AddOrganizationRole_Call) RunAndReturn(run func(context.Context, string, string, *admin.AddOrRemoveOrgRole) admin.AddOrganizationRoleApiRequest) *MongoDBCloudUsersApi_AddOrganizationRole_Call { _c.Call.Return(run) return _c } -// CreateUserExecute provides a mock function with given fields: r -func (_m *MongoDBCloudUsersApi) CreateUserExecute(r admin.CreateUserApiRequest) (*admin.CloudAppUser, *http.Response, error) { +// AddOrganizationRoleExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) AddOrganizationRoleExecute(r admin.AddOrganizationRoleApiRequest) (*admin.OrgUserResponse, *http.Response, error) { ret := _m.Called(r) if len(ret) == 0 { - panic("no return value specified for CreateUserExecute") + panic("no return value specified for AddOrganizationRoleExecute") } - var r0 *admin.CloudAppUser + var r0 *admin.OrgUserResponse var r1 *http.Response var r2 error - if rf, ok := ret.Get(0).(func(admin.CreateUserApiRequest) (*admin.CloudAppUser, *http.Response, error)); ok { + if rf, ok := ret.Get(0).(func(admin.AddOrganizationRoleApiRequest) (*admin.OrgUserResponse, *http.Response, error)); ok { return rf(r) } - if rf, ok := ret.Get(0).(func(admin.CreateUserApiRequest) *admin.CloudAppUser); ok { + if rf, ok := ret.Get(0).(func(admin.AddOrganizationRoleApiRequest) *admin.OrgUserResponse); ok { r0 = rf(r) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*admin.CloudAppUser) + r0 = ret.Get(0).(*admin.OrgUserResponse) } } - if rf, ok := ret.Get(1).(func(admin.CreateUserApiRequest) *http.Response); ok { + if rf, ok := ret.Get(1).(func(admin.AddOrganizationRoleApiRequest) *http.Response); ok { r1 = rf(r) } else { if ret.Get(1) != nil { @@ -102,7 +104,7 @@ func (_m *MongoDBCloudUsersApi) CreateUserExecute(r admin.CreateUserApiRequest) } } - if rf, ok := ret.Get(2).(func(admin.CreateUserApiRequest) error); ok { + if rf, ok := ret.Get(2).(func(admin.AddOrganizationRoleApiRequest) error); ok { r2 = rf(r) } else { r2 = ret.Error(2) @@ -111,198 +113,316 @@ func (_m *MongoDBCloudUsersApi) CreateUserExecute(r admin.CreateUserApiRequest) return r0, r1, r2 } -// MongoDBCloudUsersApi_CreateUserExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUserExecute' -type MongoDBCloudUsersApi_CreateUserExecute_Call struct { +// MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddOrganizationRoleExecute' +type MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call struct { *mock.Call } -// CreateUserExecute is a helper method to define mock.On call -// - r admin.CreateUserApiRequest -func (_e *MongoDBCloudUsersApi_Expecter) CreateUserExecute(r any) *MongoDBCloudUsersApi_CreateUserExecute_Call { - return &MongoDBCloudUsersApi_CreateUserExecute_Call{Call: _e.mock.On("CreateUserExecute", r)} +// AddOrganizationRoleExecute is a helper method to define mock.On call +// - r admin.AddOrganizationRoleApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) AddOrganizationRoleExecute(r any) *MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call { + return &MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call{Call: _e.mock.On("AddOrganizationRoleExecute", r)} } -func (_c *MongoDBCloudUsersApi_CreateUserExecute_Call) Run(run func(r admin.CreateUserApiRequest)) *MongoDBCloudUsersApi_CreateUserExecute_Call { +func (_c *MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call) Run(run func(r admin.AddOrganizationRoleApiRequest)) *MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(admin.CreateUserApiRequest)) + run(args[0].(admin.AddOrganizationRoleApiRequest)) }) return _c } -func (_c *MongoDBCloudUsersApi_CreateUserExecute_Call) Return(_a0 *admin.CloudAppUser, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_CreateUserExecute_Call { +func (_c *MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call) Return(_a0 *admin.OrgUserResponse, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call { _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *MongoDBCloudUsersApi_CreateUserExecute_Call) RunAndReturn(run func(admin.CreateUserApiRequest) (*admin.CloudAppUser, *http.Response, error)) *MongoDBCloudUsersApi_CreateUserExecute_Call { +func (_c *MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call) RunAndReturn(run func(admin.AddOrganizationRoleApiRequest) (*admin.OrgUserResponse, *http.Response, error)) *MongoDBCloudUsersApi_AddOrganizationRoleExecute_Call { _c.Call.Return(run) return _c } -// CreateUserWithParams provides a mock function with given fields: ctx, args -func (_m *MongoDBCloudUsersApi) CreateUserWithParams(ctx context.Context, args *admin.CreateUserApiParams) admin.CreateUserApiRequest { +// AddOrganizationRoleWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) AddOrganizationRoleWithParams(ctx context.Context, args *admin.AddOrganizationRoleApiParams) admin.AddOrganizationRoleApiRequest { ret := _m.Called(ctx, args) if len(ret) == 0 { - panic("no return value specified for CreateUserWithParams") + panic("no return value specified for AddOrganizationRoleWithParams") } - var r0 admin.CreateUserApiRequest - if rf, ok := ret.Get(0).(func(context.Context, *admin.CreateUserApiParams) admin.CreateUserApiRequest); ok { + var r0 admin.AddOrganizationRoleApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.AddOrganizationRoleApiParams) admin.AddOrganizationRoleApiRequest); ok { r0 = rf(ctx, args) } else { - r0 = ret.Get(0).(admin.CreateUserApiRequest) + r0 = ret.Get(0).(admin.AddOrganizationRoleApiRequest) } return r0 } -// MongoDBCloudUsersApi_CreateUserWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUserWithParams' -type MongoDBCloudUsersApi_CreateUserWithParams_Call struct { +// MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddOrganizationRoleWithParams' +type MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call struct { *mock.Call } -// CreateUserWithParams is a helper method to define mock.On call +// AddOrganizationRoleWithParams is a helper method to define mock.On call // - ctx context.Context -// - args *admin.CreateUserApiParams -func (_e *MongoDBCloudUsersApi_Expecter) CreateUserWithParams(ctx any, args any) *MongoDBCloudUsersApi_CreateUserWithParams_Call { - return &MongoDBCloudUsersApi_CreateUserWithParams_Call{Call: _e.mock.On("CreateUserWithParams", ctx, args)} +// - args *admin.AddOrganizationRoleApiParams +func (_e *MongoDBCloudUsersApi_Expecter) AddOrganizationRoleWithParams(ctx any, args any) *MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call { + return &MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call{Call: _e.mock.On("AddOrganizationRoleWithParams", ctx, args)} } -func (_c *MongoDBCloudUsersApi_CreateUserWithParams_Call) Run(run func(ctx context.Context, args *admin.CreateUserApiParams)) *MongoDBCloudUsersApi_CreateUserWithParams_Call { +func (_c *MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call) Run(run func(ctx context.Context, args *admin.AddOrganizationRoleApiParams)) *MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*admin.CreateUserApiParams)) + run(args[0].(context.Context), args[1].(*admin.AddOrganizationRoleApiParams)) }) return _c } -func (_c *MongoDBCloudUsersApi_CreateUserWithParams_Call) Return(_a0 admin.CreateUserApiRequest) *MongoDBCloudUsersApi_CreateUserWithParams_Call { +func (_c *MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call) Return(_a0 admin.AddOrganizationRoleApiRequest) *MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call { _c.Call.Return(_a0) return _c } -func (_c *MongoDBCloudUsersApi_CreateUserWithParams_Call) RunAndReturn(run func(context.Context, *admin.CreateUserApiParams) admin.CreateUserApiRequest) *MongoDBCloudUsersApi_CreateUserWithParams_Call { +func (_c *MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call) RunAndReturn(run func(context.Context, *admin.AddOrganizationRoleApiParams) admin.AddOrganizationRoleApiRequest) *MongoDBCloudUsersApi_AddOrganizationRoleWithParams_Call { _c.Call.Return(run) return _c } -// GetUser provides a mock function with given fields: ctx, userId -func (_m *MongoDBCloudUsersApi) GetUser(ctx context.Context, userId string) admin.GetUserApiRequest { - ret := _m.Called(ctx, userId) +// AddProjectRole provides a mock function with given fields: ctx, groupId, userId, addOrRemoveGroupRole +func (_m *MongoDBCloudUsersApi) AddProjectRole(ctx context.Context, groupId string, userId string, addOrRemoveGroupRole *admin.AddOrRemoveGroupRole) admin.AddProjectRoleApiRequest { + ret := _m.Called(ctx, groupId, userId, addOrRemoveGroupRole) if len(ret) == 0 { - panic("no return value specified for GetUser") + panic("no return value specified for AddProjectRole") } - var r0 admin.GetUserApiRequest - if rf, ok := ret.Get(0).(func(context.Context, string) admin.GetUserApiRequest); ok { - r0 = rf(ctx, userId) + var r0 admin.AddProjectRoleApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.AddOrRemoveGroupRole) admin.AddProjectRoleApiRequest); ok { + r0 = rf(ctx, groupId, userId, addOrRemoveGroupRole) } else { - r0 = ret.Get(0).(admin.GetUserApiRequest) + r0 = ret.Get(0).(admin.AddProjectRoleApiRequest) } return r0 } -// MongoDBCloudUsersApi_GetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUser' -type MongoDBCloudUsersApi_GetUser_Call struct { +// MongoDBCloudUsersApi_AddProjectRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddProjectRole' +type MongoDBCloudUsersApi_AddProjectRole_Call struct { *mock.Call } -// GetUser is a helper method to define mock.On call +// AddProjectRole is a helper method to define mock.On call // - ctx context.Context +// - groupId string // - userId string -func (_e *MongoDBCloudUsersApi_Expecter) GetUser(ctx any, userId any) *MongoDBCloudUsersApi_GetUser_Call { - return &MongoDBCloudUsersApi_GetUser_Call{Call: _e.mock.On("GetUser", ctx, userId)} +// - addOrRemoveGroupRole *admin.AddOrRemoveGroupRole +func (_e *MongoDBCloudUsersApi_Expecter) AddProjectRole(ctx any, groupId any, userId any, addOrRemoveGroupRole any) *MongoDBCloudUsersApi_AddProjectRole_Call { + return &MongoDBCloudUsersApi_AddProjectRole_Call{Call: _e.mock.On("AddProjectRole", ctx, groupId, userId, addOrRemoveGroupRole)} } -func (_c *MongoDBCloudUsersApi_GetUser_Call) Run(run func(ctx context.Context, userId string)) *MongoDBCloudUsersApi_GetUser_Call { +func (_c *MongoDBCloudUsersApi_AddProjectRole_Call) Run(run func(ctx context.Context, groupId string, userId string, addOrRemoveGroupRole *admin.AddOrRemoveGroupRole)) *MongoDBCloudUsersApi_AddProjectRole_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.AddOrRemoveGroupRole)) }) return _c } -func (_c *MongoDBCloudUsersApi_GetUser_Call) Return(_a0 admin.GetUserApiRequest) *MongoDBCloudUsersApi_GetUser_Call { +func (_c *MongoDBCloudUsersApi_AddProjectRole_Call) Return(_a0 admin.AddProjectRoleApiRequest) *MongoDBCloudUsersApi_AddProjectRole_Call { _c.Call.Return(_a0) return _c } -func (_c *MongoDBCloudUsersApi_GetUser_Call) RunAndReturn(run func(context.Context, string) admin.GetUserApiRequest) *MongoDBCloudUsersApi_GetUser_Call { +func (_c *MongoDBCloudUsersApi_AddProjectRole_Call) RunAndReturn(run func(context.Context, string, string, *admin.AddOrRemoveGroupRole) admin.AddProjectRoleApiRequest) *MongoDBCloudUsersApi_AddProjectRole_Call { _c.Call.Return(run) return _c } -// GetUserByUsername provides a mock function with given fields: ctx, userName -func (_m *MongoDBCloudUsersApi) GetUserByUsername(ctx context.Context, userName string) admin.GetUserByUsernameApiRequest { - ret := _m.Called(ctx, userName) +// AddProjectRoleExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) AddProjectRoleExecute(r admin.AddProjectRoleApiRequest) (*admin.OrgUserResponse, *http.Response, error) { + ret := _m.Called(r) if len(ret) == 0 { - panic("no return value specified for GetUserByUsername") + panic("no return value specified for AddProjectRoleExecute") } - var r0 admin.GetUserByUsernameApiRequest - if rf, ok := ret.Get(0).(func(context.Context, string) admin.GetUserByUsernameApiRequest); ok { - r0 = rf(ctx, userName) + var r0 *admin.OrgUserResponse + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.AddProjectRoleApiRequest) (*admin.OrgUserResponse, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.AddProjectRoleApiRequest) *admin.OrgUserResponse); ok { + r0 = rf(r) } else { - r0 = ret.Get(0).(admin.GetUserByUsernameApiRequest) + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.OrgUserResponse) + } + } + + if rf, ok := ret.Get(1).(func(admin.AddProjectRoleApiRequest) *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.AddProjectRoleApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MongoDBCloudUsersApi_AddProjectRoleExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddProjectRoleExecute' +type MongoDBCloudUsersApi_AddProjectRoleExecute_Call struct { + *mock.Call +} + +// AddProjectRoleExecute is a helper method to define mock.On call +// - r admin.AddProjectRoleApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) AddProjectRoleExecute(r any) *MongoDBCloudUsersApi_AddProjectRoleExecute_Call { + return &MongoDBCloudUsersApi_AddProjectRoleExecute_Call{Call: _e.mock.On("AddProjectRoleExecute", r)} +} + +func (_c *MongoDBCloudUsersApi_AddProjectRoleExecute_Call) Run(run func(r admin.AddProjectRoleApiRequest)) *MongoDBCloudUsersApi_AddProjectRoleExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.AddProjectRoleApiRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_AddProjectRoleExecute_Call) Return(_a0 *admin.OrgUserResponse, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_AddProjectRoleExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *MongoDBCloudUsersApi_AddProjectRoleExecute_Call) RunAndReturn(run func(admin.AddProjectRoleApiRequest) (*admin.OrgUserResponse, *http.Response, error)) *MongoDBCloudUsersApi_AddProjectRoleExecute_Call { + _c.Call.Return(run) + return _c +} + +// AddProjectRoleWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) AddProjectRoleWithParams(ctx context.Context, args *admin.AddProjectRoleApiParams) admin.AddProjectRoleApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for AddProjectRoleWithParams") + } + + var r0 admin.AddProjectRoleApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.AddProjectRoleApiParams) admin.AddProjectRoleApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.AddProjectRoleApiRequest) } return r0 } -// MongoDBCloudUsersApi_GetUserByUsername_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByUsername' -type MongoDBCloudUsersApi_GetUserByUsername_Call struct { +// MongoDBCloudUsersApi_AddProjectRoleWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddProjectRoleWithParams' +type MongoDBCloudUsersApi_AddProjectRoleWithParams_Call struct { *mock.Call } -// GetUserByUsername is a helper method to define mock.On call +// AddProjectRoleWithParams is a helper method to define mock.On call // - ctx context.Context -// - userName string -func (_e *MongoDBCloudUsersApi_Expecter) GetUserByUsername(ctx any, userName any) *MongoDBCloudUsersApi_GetUserByUsername_Call { - return &MongoDBCloudUsersApi_GetUserByUsername_Call{Call: _e.mock.On("GetUserByUsername", ctx, userName)} +// - args *admin.AddProjectRoleApiParams +func (_e *MongoDBCloudUsersApi_Expecter) AddProjectRoleWithParams(ctx any, args any) *MongoDBCloudUsersApi_AddProjectRoleWithParams_Call { + return &MongoDBCloudUsersApi_AddProjectRoleWithParams_Call{Call: _e.mock.On("AddProjectRoleWithParams", ctx, args)} } -func (_c *MongoDBCloudUsersApi_GetUserByUsername_Call) Run(run func(ctx context.Context, userName string)) *MongoDBCloudUsersApi_GetUserByUsername_Call { +func (_c *MongoDBCloudUsersApi_AddProjectRoleWithParams_Call) Run(run func(ctx context.Context, args *admin.AddProjectRoleApiParams)) *MongoDBCloudUsersApi_AddProjectRoleWithParams_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) + run(args[0].(context.Context), args[1].(*admin.AddProjectRoleApiParams)) }) return _c } -func (_c *MongoDBCloudUsersApi_GetUserByUsername_Call) Return(_a0 admin.GetUserByUsernameApiRequest) *MongoDBCloudUsersApi_GetUserByUsername_Call { +func (_c *MongoDBCloudUsersApi_AddProjectRoleWithParams_Call) Return(_a0 admin.AddProjectRoleApiRequest) *MongoDBCloudUsersApi_AddProjectRoleWithParams_Call { _c.Call.Return(_a0) return _c } -func (_c *MongoDBCloudUsersApi_GetUserByUsername_Call) RunAndReturn(run func(context.Context, string) admin.GetUserByUsernameApiRequest) *MongoDBCloudUsersApi_GetUserByUsername_Call { +func (_c *MongoDBCloudUsersApi_AddProjectRoleWithParams_Call) RunAndReturn(run func(context.Context, *admin.AddProjectRoleApiParams) admin.AddProjectRoleApiRequest) *MongoDBCloudUsersApi_AddProjectRoleWithParams_Call { _c.Call.Return(run) return _c } -// GetUserByUsernameExecute provides a mock function with given fields: r -func (_m *MongoDBCloudUsersApi) GetUserByUsernameExecute(r admin.GetUserByUsernameApiRequest) (*admin.CloudAppUser, *http.Response, error) { +// AddUserToTeam provides a mock function with given fields: ctx, orgId, teamId, addOrRemoveUserFromTeam +func (_m *MongoDBCloudUsersApi) AddUserToTeam(ctx context.Context, orgId string, teamId string, addOrRemoveUserFromTeam *admin.AddOrRemoveUserFromTeam) admin.AddUserToTeamApiRequest { + ret := _m.Called(ctx, orgId, teamId, addOrRemoveUserFromTeam) + + if len(ret) == 0 { + panic("no return value specified for AddUserToTeam") + } + + var r0 admin.AddUserToTeamApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.AddOrRemoveUserFromTeam) admin.AddUserToTeamApiRequest); ok { + r0 = rf(ctx, orgId, teamId, addOrRemoveUserFromTeam) + } else { + r0 = ret.Get(0).(admin.AddUserToTeamApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_AddUserToTeam_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUserToTeam' +type MongoDBCloudUsersApi_AddUserToTeam_Call struct { + *mock.Call +} + +// AddUserToTeam is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - teamId string +// - addOrRemoveUserFromTeam *admin.AddOrRemoveUserFromTeam +func (_e *MongoDBCloudUsersApi_Expecter) AddUserToTeam(ctx any, orgId any, teamId any, addOrRemoveUserFromTeam any) *MongoDBCloudUsersApi_AddUserToTeam_Call { + return &MongoDBCloudUsersApi_AddUserToTeam_Call{Call: _e.mock.On("AddUserToTeam", ctx, orgId, teamId, addOrRemoveUserFromTeam)} +} + +func (_c *MongoDBCloudUsersApi_AddUserToTeam_Call) Run(run func(ctx context.Context, orgId string, teamId string, addOrRemoveUserFromTeam *admin.AddOrRemoveUserFromTeam)) *MongoDBCloudUsersApi_AddUserToTeam_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.AddOrRemoveUserFromTeam)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_AddUserToTeam_Call) Return(_a0 admin.AddUserToTeamApiRequest) *MongoDBCloudUsersApi_AddUserToTeam_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_AddUserToTeam_Call) RunAndReturn(run func(context.Context, string, string, *admin.AddOrRemoveUserFromTeam) admin.AddUserToTeamApiRequest) *MongoDBCloudUsersApi_AddUserToTeam_Call { + _c.Call.Return(run) + return _c +} + +// AddUserToTeamExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) AddUserToTeamExecute(r admin.AddUserToTeamApiRequest) (*admin.OrgUserResponse, *http.Response, error) { ret := _m.Called(r) if len(ret) == 0 { - panic("no return value specified for GetUserByUsernameExecute") + panic("no return value specified for AddUserToTeamExecute") } - var r0 *admin.CloudAppUser + var r0 *admin.OrgUserResponse var r1 *http.Response var r2 error - if rf, ok := ret.Get(0).(func(admin.GetUserByUsernameApiRequest) (*admin.CloudAppUser, *http.Response, error)); ok { + if rf, ok := ret.Get(0).(func(admin.AddUserToTeamApiRequest) (*admin.OrgUserResponse, *http.Response, error)); ok { return rf(r) } - if rf, ok := ret.Get(0).(func(admin.GetUserByUsernameApiRequest) *admin.CloudAppUser); ok { + if rf, ok := ret.Get(0).(func(admin.AddUserToTeamApiRequest) *admin.OrgUserResponse); ok { r0 = rf(r) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*admin.CloudAppUser) + r0 = ret.Get(0).(*admin.OrgUserResponse) } } - if rf, ok := ret.Get(1).(func(admin.GetUserByUsernameApiRequest) *http.Response); ok { + if rf, ok := ret.Get(1).(func(admin.AddUserToTeamApiRequest) *http.Response); ok { r1 = rf(r) } else { if ret.Get(1) != nil { @@ -310,7 +430,7 @@ func (_m *MongoDBCloudUsersApi) GetUserByUsernameExecute(r admin.GetUserByUserna } } - if rf, ok := ret.Get(2).(func(admin.GetUserByUsernameApiRequest) error); ok { + if rf, ok := ret.Get(2).(func(admin.AddUserToTeamApiRequest) error); ok { r2 = rf(r) } else { r2 = ret.Error(2) @@ -319,104 +439,152 @@ func (_m *MongoDBCloudUsersApi) GetUserByUsernameExecute(r admin.GetUserByUserna return r0, r1, r2 } -// MongoDBCloudUsersApi_GetUserByUsernameExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByUsernameExecute' -type MongoDBCloudUsersApi_GetUserByUsernameExecute_Call struct { +// MongoDBCloudUsersApi_AddUserToTeamExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUserToTeamExecute' +type MongoDBCloudUsersApi_AddUserToTeamExecute_Call struct { *mock.Call } -// GetUserByUsernameExecute is a helper method to define mock.On call -// - r admin.GetUserByUsernameApiRequest -func (_e *MongoDBCloudUsersApi_Expecter) GetUserByUsernameExecute(r any) *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call { - return &MongoDBCloudUsersApi_GetUserByUsernameExecute_Call{Call: _e.mock.On("GetUserByUsernameExecute", r)} +// AddUserToTeamExecute is a helper method to define mock.On call +// - r admin.AddUserToTeamApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) AddUserToTeamExecute(r any) *MongoDBCloudUsersApi_AddUserToTeamExecute_Call { + return &MongoDBCloudUsersApi_AddUserToTeamExecute_Call{Call: _e.mock.On("AddUserToTeamExecute", r)} } -func (_c *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call) Run(run func(r admin.GetUserByUsernameApiRequest)) *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call { +func (_c *MongoDBCloudUsersApi_AddUserToTeamExecute_Call) Run(run func(r admin.AddUserToTeamApiRequest)) *MongoDBCloudUsersApi_AddUserToTeamExecute_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(admin.GetUserByUsernameApiRequest)) + run(args[0].(admin.AddUserToTeamApiRequest)) }) return _c } -func (_c *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call) Return(_a0 *admin.CloudAppUser, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call { +func (_c *MongoDBCloudUsersApi_AddUserToTeamExecute_Call) Return(_a0 *admin.OrgUserResponse, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_AddUserToTeamExecute_Call { _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call) RunAndReturn(run func(admin.GetUserByUsernameApiRequest) (*admin.CloudAppUser, *http.Response, error)) *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call { +func (_c *MongoDBCloudUsersApi_AddUserToTeamExecute_Call) RunAndReturn(run func(admin.AddUserToTeamApiRequest) (*admin.OrgUserResponse, *http.Response, error)) *MongoDBCloudUsersApi_AddUserToTeamExecute_Call { _c.Call.Return(run) return _c } -// GetUserByUsernameWithParams provides a mock function with given fields: ctx, args -func (_m *MongoDBCloudUsersApi) GetUserByUsernameWithParams(ctx context.Context, args *admin.GetUserByUsernameApiParams) admin.GetUserByUsernameApiRequest { +// AddUserToTeamWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) AddUserToTeamWithParams(ctx context.Context, args *admin.AddUserToTeamApiParams) admin.AddUserToTeamApiRequest { ret := _m.Called(ctx, args) if len(ret) == 0 { - panic("no return value specified for GetUserByUsernameWithParams") + panic("no return value specified for AddUserToTeamWithParams") } - var r0 admin.GetUserByUsernameApiRequest - if rf, ok := ret.Get(0).(func(context.Context, *admin.GetUserByUsernameApiParams) admin.GetUserByUsernameApiRequest); ok { + var r0 admin.AddUserToTeamApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.AddUserToTeamApiParams) admin.AddUserToTeamApiRequest); ok { r0 = rf(ctx, args) } else { - r0 = ret.Get(0).(admin.GetUserByUsernameApiRequest) + r0 = ret.Get(0).(admin.AddUserToTeamApiRequest) } return r0 } -// MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByUsernameWithParams' -type MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call struct { +// MongoDBCloudUsersApi_AddUserToTeamWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUserToTeamWithParams' +type MongoDBCloudUsersApi_AddUserToTeamWithParams_Call struct { *mock.Call } -// GetUserByUsernameWithParams is a helper method to define mock.On call +// AddUserToTeamWithParams is a helper method to define mock.On call // - ctx context.Context -// - args *admin.GetUserByUsernameApiParams -func (_e *MongoDBCloudUsersApi_Expecter) GetUserByUsernameWithParams(ctx any, args any) *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call { - return &MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call{Call: _e.mock.On("GetUserByUsernameWithParams", ctx, args)} +// - args *admin.AddUserToTeamApiParams +func (_e *MongoDBCloudUsersApi_Expecter) AddUserToTeamWithParams(ctx any, args any) *MongoDBCloudUsersApi_AddUserToTeamWithParams_Call { + return &MongoDBCloudUsersApi_AddUserToTeamWithParams_Call{Call: _e.mock.On("AddUserToTeamWithParams", ctx, args)} } -func (_c *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call) Run(run func(ctx context.Context, args *admin.GetUserByUsernameApiParams)) *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call { +func (_c *MongoDBCloudUsersApi_AddUserToTeamWithParams_Call) Run(run func(ctx context.Context, args *admin.AddUserToTeamApiParams)) *MongoDBCloudUsersApi_AddUserToTeamWithParams_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*admin.GetUserByUsernameApiParams)) + run(args[0].(context.Context), args[1].(*admin.AddUserToTeamApiParams)) }) return _c } -func (_c *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call) Return(_a0 admin.GetUserByUsernameApiRequest) *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call { +func (_c *MongoDBCloudUsersApi_AddUserToTeamWithParams_Call) Return(_a0 admin.AddUserToTeamApiRequest) *MongoDBCloudUsersApi_AddUserToTeamWithParams_Call { _c.Call.Return(_a0) return _c } -func (_c *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call) RunAndReturn(run func(context.Context, *admin.GetUserByUsernameApiParams) admin.GetUserByUsernameApiRequest) *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call { +func (_c *MongoDBCloudUsersApi_AddUserToTeamWithParams_Call) RunAndReturn(run func(context.Context, *admin.AddUserToTeamApiParams) admin.AddUserToTeamApiRequest) *MongoDBCloudUsersApi_AddUserToTeamWithParams_Call { _c.Call.Return(run) return _c } -// GetUserExecute provides a mock function with given fields: r -func (_m *MongoDBCloudUsersApi) GetUserExecute(r admin.GetUserApiRequest) (*admin.CloudAppUser, *http.Response, error) { +// CreateOrganizationUser provides a mock function with given fields: ctx, orgId, orgUserRequest +func (_m *MongoDBCloudUsersApi) CreateOrganizationUser(ctx context.Context, orgId string, orgUserRequest *admin.OrgUserRequest) admin.CreateOrganizationUserApiRequest { + ret := _m.Called(ctx, orgId, orgUserRequest) + + if len(ret) == 0 { + panic("no return value specified for CreateOrganizationUser") + } + + var r0 admin.CreateOrganizationUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, *admin.OrgUserRequest) admin.CreateOrganizationUserApiRequest); ok { + r0 = rf(ctx, orgId, orgUserRequest) + } else { + r0 = ret.Get(0).(admin.CreateOrganizationUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_CreateOrganizationUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrganizationUser' +type MongoDBCloudUsersApi_CreateOrganizationUser_Call struct { + *mock.Call +} + +// CreateOrganizationUser is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - orgUserRequest *admin.OrgUserRequest +func (_e *MongoDBCloudUsersApi_Expecter) CreateOrganizationUser(ctx any, orgId any, orgUserRequest any) *MongoDBCloudUsersApi_CreateOrganizationUser_Call { + return &MongoDBCloudUsersApi_CreateOrganizationUser_Call{Call: _e.mock.On("CreateOrganizationUser", ctx, orgId, orgUserRequest)} +} + +func (_c *MongoDBCloudUsersApi_CreateOrganizationUser_Call) Run(run func(ctx context.Context, orgId string, orgUserRequest *admin.OrgUserRequest)) *MongoDBCloudUsersApi_CreateOrganizationUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*admin.OrgUserRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateOrganizationUser_Call) Return(_a0 admin.CreateOrganizationUserApiRequest) *MongoDBCloudUsersApi_CreateOrganizationUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateOrganizationUser_Call) RunAndReturn(run func(context.Context, string, *admin.OrgUserRequest) admin.CreateOrganizationUserApiRequest) *MongoDBCloudUsersApi_CreateOrganizationUser_Call { + _c.Call.Return(run) + return _c +} + +// CreateOrganizationUserExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) CreateOrganizationUserExecute(r admin.CreateOrganizationUserApiRequest) (*admin.OrgUserResponse, *http.Response, error) { ret := _m.Called(r) if len(ret) == 0 { - panic("no return value specified for GetUserExecute") + panic("no return value specified for CreateOrganizationUserExecute") } - var r0 *admin.CloudAppUser + var r0 *admin.OrgUserResponse var r1 *http.Response var r2 error - if rf, ok := ret.Get(0).(func(admin.GetUserApiRequest) (*admin.CloudAppUser, *http.Response, error)); ok { + if rf, ok := ret.Get(0).(func(admin.CreateOrganizationUserApiRequest) (*admin.OrgUserResponse, *http.Response, error)); ok { return rf(r) } - if rf, ok := ret.Get(0).(func(admin.GetUserApiRequest) *admin.CloudAppUser); ok { + if rf, ok := ret.Get(0).(func(admin.CreateOrganizationUserApiRequest) *admin.OrgUserResponse); ok { r0 = rf(r) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*admin.CloudAppUser) + r0 = ret.Get(0).(*admin.OrgUserResponse) } } - if rf, ok := ret.Get(1).(func(admin.GetUserApiRequest) *http.Response); ok { + if rf, ok := ret.Get(1).(func(admin.CreateOrganizationUserApiRequest) *http.Response); ok { r1 = rf(r) } else { if ret.Get(1) != nil { @@ -424,7 +592,7 @@ func (_m *MongoDBCloudUsersApi) GetUserExecute(r admin.GetUserApiRequest) (*admi } } - if rf, ok := ret.Get(2).(func(admin.GetUserApiRequest) error); ok { + if rf, ok := ret.Get(2).(func(admin.CreateOrganizationUserApiRequest) error); ok { r2 = rf(r) } else { r2 = ret.Error(2) @@ -433,44 +601,851 @@ func (_m *MongoDBCloudUsersApi) GetUserExecute(r admin.GetUserApiRequest) (*admi return r0, r1, r2 } -// MongoDBCloudUsersApi_GetUserExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserExecute' -type MongoDBCloudUsersApi_GetUserExecute_Call struct { +// MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrganizationUserExecute' +type MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call struct { *mock.Call } -// GetUserExecute is a helper method to define mock.On call -// - r admin.GetUserApiRequest -func (_e *MongoDBCloudUsersApi_Expecter) GetUserExecute(r any) *MongoDBCloudUsersApi_GetUserExecute_Call { - return &MongoDBCloudUsersApi_GetUserExecute_Call{Call: _e.mock.On("GetUserExecute", r)} +// CreateOrganizationUserExecute is a helper method to define mock.On call +// - r admin.CreateOrganizationUserApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) CreateOrganizationUserExecute(r any) *MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call { + return &MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call{Call: _e.mock.On("CreateOrganizationUserExecute", r)} } -func (_c *MongoDBCloudUsersApi_GetUserExecute_Call) Run(run func(r admin.GetUserApiRequest)) *MongoDBCloudUsersApi_GetUserExecute_Call { +func (_c *MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call) Run(run func(r admin.CreateOrganizationUserApiRequest)) *MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(admin.GetUserApiRequest)) + run(args[0].(admin.CreateOrganizationUserApiRequest)) }) return _c } -func (_c *MongoDBCloudUsersApi_GetUserExecute_Call) Return(_a0 *admin.CloudAppUser, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_GetUserExecute_Call { +func (_c *MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call) Return(_a0 *admin.OrgUserResponse, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call { _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *MongoDBCloudUsersApi_GetUserExecute_Call) RunAndReturn(run func(admin.GetUserApiRequest) (*admin.CloudAppUser, *http.Response, error)) *MongoDBCloudUsersApi_GetUserExecute_Call { +func (_c *MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call) RunAndReturn(run func(admin.CreateOrganizationUserApiRequest) (*admin.OrgUserResponse, *http.Response, error)) *MongoDBCloudUsersApi_CreateOrganizationUserExecute_Call { _c.Call.Return(run) return _c } -// GetUserWithParams provides a mock function with given fields: ctx, args -func (_m *MongoDBCloudUsersApi) GetUserWithParams(ctx context.Context, args *admin.GetUserApiParams) admin.GetUserApiRequest { +// CreateOrganizationUserWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) CreateOrganizationUserWithParams(ctx context.Context, args *admin.CreateOrganizationUserApiParams) admin.CreateOrganizationUserApiRequest { ret := _m.Called(ctx, args) if len(ret) == 0 { - panic("no return value specified for GetUserWithParams") + panic("no return value specified for CreateOrganizationUserWithParams") } - var r0 admin.GetUserApiRequest - if rf, ok := ret.Get(0).(func(context.Context, *admin.GetUserApiParams) admin.GetUserApiRequest); ok { + var r0 admin.CreateOrganizationUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.CreateOrganizationUserApiParams) admin.CreateOrganizationUserApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.CreateOrganizationUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrganizationUserWithParams' +type MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call struct { + *mock.Call +} + +// CreateOrganizationUserWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.CreateOrganizationUserApiParams +func (_e *MongoDBCloudUsersApi_Expecter) CreateOrganizationUserWithParams(ctx any, args any) *MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call { + return &MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call{Call: _e.mock.On("CreateOrganizationUserWithParams", ctx, args)} +} + +func (_c *MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call) Run(run func(ctx context.Context, args *admin.CreateOrganizationUserApiParams)) *MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.CreateOrganizationUserApiParams)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call) Return(_a0 admin.CreateOrganizationUserApiRequest) *MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call) RunAndReturn(run func(context.Context, *admin.CreateOrganizationUserApiParams) admin.CreateOrganizationUserApiRequest) *MongoDBCloudUsersApi_CreateOrganizationUserWithParams_Call { + _c.Call.Return(run) + return _c +} + +// CreateUser provides a mock function with given fields: ctx, cloudAppUser +func (_m *MongoDBCloudUsersApi) CreateUser(ctx context.Context, cloudAppUser *admin.CloudAppUser) admin.CreateUserApiRequest { + ret := _m.Called(ctx, cloudAppUser) + + if len(ret) == 0 { + panic("no return value specified for CreateUser") + } + + var r0 admin.CreateUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.CloudAppUser) admin.CreateUserApiRequest); ok { + r0 = rf(ctx, cloudAppUser) + } else { + r0 = ret.Get(0).(admin.CreateUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_CreateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUser' +type MongoDBCloudUsersApi_CreateUser_Call struct { + *mock.Call +} + +// CreateUser is a helper method to define mock.On call +// - ctx context.Context +// - cloudAppUser *admin.CloudAppUser +func (_e *MongoDBCloudUsersApi_Expecter) CreateUser(ctx any, cloudAppUser any) *MongoDBCloudUsersApi_CreateUser_Call { + return &MongoDBCloudUsersApi_CreateUser_Call{Call: _e.mock.On("CreateUser", ctx, cloudAppUser)} +} + +func (_c *MongoDBCloudUsersApi_CreateUser_Call) Run(run func(ctx context.Context, cloudAppUser *admin.CloudAppUser)) *MongoDBCloudUsersApi_CreateUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.CloudAppUser)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateUser_Call) Return(_a0 admin.CreateUserApiRequest) *MongoDBCloudUsersApi_CreateUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateUser_Call) RunAndReturn(run func(context.Context, *admin.CloudAppUser) admin.CreateUserApiRequest) *MongoDBCloudUsersApi_CreateUser_Call { + _c.Call.Return(run) + return _c +} + +// CreateUserExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) CreateUserExecute(r admin.CreateUserApiRequest) (*admin.CloudAppUser, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for CreateUserExecute") + } + + var r0 *admin.CloudAppUser + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.CreateUserApiRequest) (*admin.CloudAppUser, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.CreateUserApiRequest) *admin.CloudAppUser); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.CloudAppUser) + } + } + + if rf, ok := ret.Get(1).(func(admin.CreateUserApiRequest) *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.CreateUserApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MongoDBCloudUsersApi_CreateUserExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUserExecute' +type MongoDBCloudUsersApi_CreateUserExecute_Call struct { + *mock.Call +} + +// CreateUserExecute is a helper method to define mock.On call +// - r admin.CreateUserApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) CreateUserExecute(r any) *MongoDBCloudUsersApi_CreateUserExecute_Call { + return &MongoDBCloudUsersApi_CreateUserExecute_Call{Call: _e.mock.On("CreateUserExecute", r)} +} + +func (_c *MongoDBCloudUsersApi_CreateUserExecute_Call) Run(run func(r admin.CreateUserApiRequest)) *MongoDBCloudUsersApi_CreateUserExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.CreateUserApiRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateUserExecute_Call) Return(_a0 *admin.CloudAppUser, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_CreateUserExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateUserExecute_Call) RunAndReturn(run func(admin.CreateUserApiRequest) (*admin.CloudAppUser, *http.Response, error)) *MongoDBCloudUsersApi_CreateUserExecute_Call { + _c.Call.Return(run) + return _c +} + +// CreateUserWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) CreateUserWithParams(ctx context.Context, args *admin.CreateUserApiParams) admin.CreateUserApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for CreateUserWithParams") + } + + var r0 admin.CreateUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.CreateUserApiParams) admin.CreateUserApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.CreateUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_CreateUserWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUserWithParams' +type MongoDBCloudUsersApi_CreateUserWithParams_Call struct { + *mock.Call +} + +// CreateUserWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.CreateUserApiParams +func (_e *MongoDBCloudUsersApi_Expecter) CreateUserWithParams(ctx any, args any) *MongoDBCloudUsersApi_CreateUserWithParams_Call { + return &MongoDBCloudUsersApi_CreateUserWithParams_Call{Call: _e.mock.On("CreateUserWithParams", ctx, args)} +} + +func (_c *MongoDBCloudUsersApi_CreateUserWithParams_Call) Run(run func(ctx context.Context, args *admin.CreateUserApiParams)) *MongoDBCloudUsersApi_CreateUserWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.CreateUserApiParams)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateUserWithParams_Call) Return(_a0 admin.CreateUserApiRequest) *MongoDBCloudUsersApi_CreateUserWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_CreateUserWithParams_Call) RunAndReturn(run func(context.Context, *admin.CreateUserApiParams) admin.CreateUserApiRequest) *MongoDBCloudUsersApi_CreateUserWithParams_Call { + _c.Call.Return(run) + return _c +} + +// GetOrganizationUser provides a mock function with given fields: ctx, orgId, userId +func (_m *MongoDBCloudUsersApi) GetOrganizationUser(ctx context.Context, orgId string, userId string) admin.GetOrganizationUserApiRequest { + ret := _m.Called(ctx, orgId, userId) + + if len(ret) == 0 { + panic("no return value specified for GetOrganizationUser") + } + + var r0 admin.GetOrganizationUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.GetOrganizationUserApiRequest); ok { + r0 = rf(ctx, orgId, userId) + } else { + r0 = ret.Get(0).(admin.GetOrganizationUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_GetOrganizationUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrganizationUser' +type MongoDBCloudUsersApi_GetOrganizationUser_Call struct { + *mock.Call +} + +// GetOrganizationUser is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - userId string +func (_e *MongoDBCloudUsersApi_Expecter) GetOrganizationUser(ctx any, orgId any, userId any) *MongoDBCloudUsersApi_GetOrganizationUser_Call { + return &MongoDBCloudUsersApi_GetOrganizationUser_Call{Call: _e.mock.On("GetOrganizationUser", ctx, orgId, userId)} +} + +func (_c *MongoDBCloudUsersApi_GetOrganizationUser_Call) Run(run func(ctx context.Context, orgId string, userId string)) *MongoDBCloudUsersApi_GetOrganizationUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetOrganizationUser_Call) Return(_a0 admin.GetOrganizationUserApiRequest) *MongoDBCloudUsersApi_GetOrganizationUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetOrganizationUser_Call) RunAndReturn(run func(context.Context, string, string) admin.GetOrganizationUserApiRequest) *MongoDBCloudUsersApi_GetOrganizationUser_Call { + _c.Call.Return(run) + return _c +} + +// GetOrganizationUserExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) GetOrganizationUserExecute(r admin.GetOrganizationUserApiRequest) (*admin.OrgUserResponse, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for GetOrganizationUserExecute") + } + + var r0 *admin.OrgUserResponse + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.GetOrganizationUserApiRequest) (*admin.OrgUserResponse, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.GetOrganizationUserApiRequest) *admin.OrgUserResponse); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.OrgUserResponse) + } + } + + if rf, ok := ret.Get(1).(func(admin.GetOrganizationUserApiRequest) *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.GetOrganizationUserApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MongoDBCloudUsersApi_GetOrganizationUserExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrganizationUserExecute' +type MongoDBCloudUsersApi_GetOrganizationUserExecute_Call struct { + *mock.Call +} + +// GetOrganizationUserExecute is a helper method to define mock.On call +// - r admin.GetOrganizationUserApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) GetOrganizationUserExecute(r any) *MongoDBCloudUsersApi_GetOrganizationUserExecute_Call { + return &MongoDBCloudUsersApi_GetOrganizationUserExecute_Call{Call: _e.mock.On("GetOrganizationUserExecute", r)} +} + +func (_c *MongoDBCloudUsersApi_GetOrganizationUserExecute_Call) Run(run func(r admin.GetOrganizationUserApiRequest)) *MongoDBCloudUsersApi_GetOrganizationUserExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.GetOrganizationUserApiRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetOrganizationUserExecute_Call) Return(_a0 *admin.OrgUserResponse, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_GetOrganizationUserExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetOrganizationUserExecute_Call) RunAndReturn(run func(admin.GetOrganizationUserApiRequest) (*admin.OrgUserResponse, *http.Response, error)) *MongoDBCloudUsersApi_GetOrganizationUserExecute_Call { + _c.Call.Return(run) + return _c +} + +// GetOrganizationUserWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) GetOrganizationUserWithParams(ctx context.Context, args *admin.GetOrganizationUserApiParams) admin.GetOrganizationUserApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for GetOrganizationUserWithParams") + } + + var r0 admin.GetOrganizationUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.GetOrganizationUserApiParams) admin.GetOrganizationUserApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.GetOrganizationUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrganizationUserWithParams' +type MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call struct { + *mock.Call +} + +// GetOrganizationUserWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.GetOrganizationUserApiParams +func (_e *MongoDBCloudUsersApi_Expecter) GetOrganizationUserWithParams(ctx any, args any) *MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call { + return &MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call{Call: _e.mock.On("GetOrganizationUserWithParams", ctx, args)} +} + +func (_c *MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call) Run(run func(ctx context.Context, args *admin.GetOrganizationUserApiParams)) *MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.GetOrganizationUserApiParams)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call) Return(_a0 admin.GetOrganizationUserApiRequest) *MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call) RunAndReturn(run func(context.Context, *admin.GetOrganizationUserApiParams) admin.GetOrganizationUserApiRequest) *MongoDBCloudUsersApi_GetOrganizationUserWithParams_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectUser provides a mock function with given fields: ctx, groupId, userId +func (_m *MongoDBCloudUsersApi) GetProjectUser(ctx context.Context, groupId string, userId string) admin.GetProjectUserApiRequest { + ret := _m.Called(ctx, groupId, userId) + + if len(ret) == 0 { + panic("no return value specified for GetProjectUser") + } + + var r0 admin.GetProjectUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.GetProjectUserApiRequest); ok { + r0 = rf(ctx, groupId, userId) + } else { + r0 = ret.Get(0).(admin.GetProjectUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_GetProjectUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectUser' +type MongoDBCloudUsersApi_GetProjectUser_Call struct { + *mock.Call +} + +// GetProjectUser is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - userId string +func (_e *MongoDBCloudUsersApi_Expecter) GetProjectUser(ctx any, groupId any, userId any) *MongoDBCloudUsersApi_GetProjectUser_Call { + return &MongoDBCloudUsersApi_GetProjectUser_Call{Call: _e.mock.On("GetProjectUser", ctx, groupId, userId)} +} + +func (_c *MongoDBCloudUsersApi_GetProjectUser_Call) Run(run func(ctx context.Context, groupId string, userId string)) *MongoDBCloudUsersApi_GetProjectUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetProjectUser_Call) Return(_a0 admin.GetProjectUserApiRequest) *MongoDBCloudUsersApi_GetProjectUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetProjectUser_Call) RunAndReturn(run func(context.Context, string, string) admin.GetProjectUserApiRequest) *MongoDBCloudUsersApi_GetProjectUser_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectUserExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) GetProjectUserExecute(r admin.GetProjectUserApiRequest) (*admin.GroupUserResponse, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for GetProjectUserExecute") + } + + var r0 *admin.GroupUserResponse + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.GetProjectUserApiRequest) (*admin.GroupUserResponse, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.GetProjectUserApiRequest) *admin.GroupUserResponse); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.GroupUserResponse) + } + } + + if rf, ok := ret.Get(1).(func(admin.GetProjectUserApiRequest) *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.GetProjectUserApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MongoDBCloudUsersApi_GetProjectUserExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectUserExecute' +type MongoDBCloudUsersApi_GetProjectUserExecute_Call struct { + *mock.Call +} + +// GetProjectUserExecute is a helper method to define mock.On call +// - r admin.GetProjectUserApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) GetProjectUserExecute(r any) *MongoDBCloudUsersApi_GetProjectUserExecute_Call { + return &MongoDBCloudUsersApi_GetProjectUserExecute_Call{Call: _e.mock.On("GetProjectUserExecute", r)} +} + +func (_c *MongoDBCloudUsersApi_GetProjectUserExecute_Call) Run(run func(r admin.GetProjectUserApiRequest)) *MongoDBCloudUsersApi_GetProjectUserExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.GetProjectUserApiRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetProjectUserExecute_Call) Return(_a0 *admin.GroupUserResponse, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_GetProjectUserExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetProjectUserExecute_Call) RunAndReturn(run func(admin.GetProjectUserApiRequest) (*admin.GroupUserResponse, *http.Response, error)) *MongoDBCloudUsersApi_GetProjectUserExecute_Call { + _c.Call.Return(run) + return _c +} + +// GetProjectUserWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) GetProjectUserWithParams(ctx context.Context, args *admin.GetProjectUserApiParams) admin.GetProjectUserApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for GetProjectUserWithParams") + } + + var r0 admin.GetProjectUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.GetProjectUserApiParams) admin.GetProjectUserApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.GetProjectUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_GetProjectUserWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProjectUserWithParams' +type MongoDBCloudUsersApi_GetProjectUserWithParams_Call struct { + *mock.Call +} + +// GetProjectUserWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.GetProjectUserApiParams +func (_e *MongoDBCloudUsersApi_Expecter) GetProjectUserWithParams(ctx any, args any) *MongoDBCloudUsersApi_GetProjectUserWithParams_Call { + return &MongoDBCloudUsersApi_GetProjectUserWithParams_Call{Call: _e.mock.On("GetProjectUserWithParams", ctx, args)} +} + +func (_c *MongoDBCloudUsersApi_GetProjectUserWithParams_Call) Run(run func(ctx context.Context, args *admin.GetProjectUserApiParams)) *MongoDBCloudUsersApi_GetProjectUserWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.GetProjectUserApiParams)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetProjectUserWithParams_Call) Return(_a0 admin.GetProjectUserApiRequest) *MongoDBCloudUsersApi_GetProjectUserWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetProjectUserWithParams_Call) RunAndReturn(run func(context.Context, *admin.GetProjectUserApiParams) admin.GetProjectUserApiRequest) *MongoDBCloudUsersApi_GetProjectUserWithParams_Call { + _c.Call.Return(run) + return _c +} + +// GetUser provides a mock function with given fields: ctx, userId +func (_m *MongoDBCloudUsersApi) GetUser(ctx context.Context, userId string) admin.GetUserApiRequest { + ret := _m.Called(ctx, userId) + + if len(ret) == 0 { + panic("no return value specified for GetUser") + } + + var r0 admin.GetUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string) admin.GetUserApiRequest); ok { + r0 = rf(ctx, userId) + } else { + r0 = ret.Get(0).(admin.GetUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_GetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUser' +type MongoDBCloudUsersApi_GetUser_Call struct { + *mock.Call +} + +// GetUser is a helper method to define mock.On call +// - ctx context.Context +// - userId string +func (_e *MongoDBCloudUsersApi_Expecter) GetUser(ctx any, userId any) *MongoDBCloudUsersApi_GetUser_Call { + return &MongoDBCloudUsersApi_GetUser_Call{Call: _e.mock.On("GetUser", ctx, userId)} +} + +func (_c *MongoDBCloudUsersApi_GetUser_Call) Run(run func(ctx context.Context, userId string)) *MongoDBCloudUsersApi_GetUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUser_Call) Return(_a0 admin.GetUserApiRequest) *MongoDBCloudUsersApi_GetUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUser_Call) RunAndReturn(run func(context.Context, string) admin.GetUserApiRequest) *MongoDBCloudUsersApi_GetUser_Call { + _c.Call.Return(run) + return _c +} + +// GetUserByUsername provides a mock function with given fields: ctx, userName +func (_m *MongoDBCloudUsersApi) GetUserByUsername(ctx context.Context, userName string) admin.GetUserByUsernameApiRequest { + ret := _m.Called(ctx, userName) + + if len(ret) == 0 { + panic("no return value specified for GetUserByUsername") + } + + var r0 admin.GetUserByUsernameApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string) admin.GetUserByUsernameApiRequest); ok { + r0 = rf(ctx, userName) + } else { + r0 = ret.Get(0).(admin.GetUserByUsernameApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_GetUserByUsername_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByUsername' +type MongoDBCloudUsersApi_GetUserByUsername_Call struct { + *mock.Call +} + +// GetUserByUsername is a helper method to define mock.On call +// - ctx context.Context +// - userName string +func (_e *MongoDBCloudUsersApi_Expecter) GetUserByUsername(ctx any, userName any) *MongoDBCloudUsersApi_GetUserByUsername_Call { + return &MongoDBCloudUsersApi_GetUserByUsername_Call{Call: _e.mock.On("GetUserByUsername", ctx, userName)} +} + +func (_c *MongoDBCloudUsersApi_GetUserByUsername_Call) Run(run func(ctx context.Context, userName string)) *MongoDBCloudUsersApi_GetUserByUsername_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserByUsername_Call) Return(_a0 admin.GetUserByUsernameApiRequest) *MongoDBCloudUsersApi_GetUserByUsername_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserByUsername_Call) RunAndReturn(run func(context.Context, string) admin.GetUserByUsernameApiRequest) *MongoDBCloudUsersApi_GetUserByUsername_Call { + _c.Call.Return(run) + return _c +} + +// GetUserByUsernameExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) GetUserByUsernameExecute(r admin.GetUserByUsernameApiRequest) (*admin.CloudAppUser, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for GetUserByUsernameExecute") + } + + var r0 *admin.CloudAppUser + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.GetUserByUsernameApiRequest) (*admin.CloudAppUser, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.GetUserByUsernameApiRequest) *admin.CloudAppUser); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.CloudAppUser) + } + } + + if rf, ok := ret.Get(1).(func(admin.GetUserByUsernameApiRequest) *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.GetUserByUsernameApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MongoDBCloudUsersApi_GetUserByUsernameExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByUsernameExecute' +type MongoDBCloudUsersApi_GetUserByUsernameExecute_Call struct { + *mock.Call +} + +// GetUserByUsernameExecute is a helper method to define mock.On call +// - r admin.GetUserByUsernameApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) GetUserByUsernameExecute(r any) *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call { + return &MongoDBCloudUsersApi_GetUserByUsernameExecute_Call{Call: _e.mock.On("GetUserByUsernameExecute", r)} +} + +func (_c *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call) Run(run func(r admin.GetUserByUsernameApiRequest)) *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.GetUserByUsernameApiRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call) Return(_a0 *admin.CloudAppUser, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call) RunAndReturn(run func(admin.GetUserByUsernameApiRequest) (*admin.CloudAppUser, *http.Response, error)) *MongoDBCloudUsersApi_GetUserByUsernameExecute_Call { + _c.Call.Return(run) + return _c +} + +// GetUserByUsernameWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) GetUserByUsernameWithParams(ctx context.Context, args *admin.GetUserByUsernameApiParams) admin.GetUserByUsernameApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for GetUserByUsernameWithParams") + } + + var r0 admin.GetUserByUsernameApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.GetUserByUsernameApiParams) admin.GetUserByUsernameApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.GetUserByUsernameApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByUsernameWithParams' +type MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call struct { + *mock.Call +} + +// GetUserByUsernameWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.GetUserByUsernameApiParams +func (_e *MongoDBCloudUsersApi_Expecter) GetUserByUsernameWithParams(ctx any, args any) *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call { + return &MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call{Call: _e.mock.On("GetUserByUsernameWithParams", ctx, args)} +} + +func (_c *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call) Run(run func(ctx context.Context, args *admin.GetUserByUsernameApiParams)) *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.GetUserByUsernameApiParams)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call) Return(_a0 admin.GetUserByUsernameApiRequest) *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call) RunAndReturn(run func(context.Context, *admin.GetUserByUsernameApiParams) admin.GetUserByUsernameApiRequest) *MongoDBCloudUsersApi_GetUserByUsernameWithParams_Call { + _c.Call.Return(run) + return _c +} + +// GetUserExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) GetUserExecute(r admin.GetUserApiRequest) (*admin.CloudAppUser, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for GetUserExecute") + } + + var r0 *admin.CloudAppUser + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.GetUserApiRequest) (*admin.CloudAppUser, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.GetUserApiRequest) *admin.CloudAppUser); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.CloudAppUser) + } + } + + if rf, ok := ret.Get(1).(func(admin.GetUserApiRequest) *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.GetUserApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MongoDBCloudUsersApi_GetUserExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserExecute' +type MongoDBCloudUsersApi_GetUserExecute_Call struct { + *mock.Call +} + +// GetUserExecute is a helper method to define mock.On call +// - r admin.GetUserApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) GetUserExecute(r any) *MongoDBCloudUsersApi_GetUserExecute_Call { + return &MongoDBCloudUsersApi_GetUserExecute_Call{Call: _e.mock.On("GetUserExecute", r)} +} + +func (_c *MongoDBCloudUsersApi_GetUserExecute_Call) Run(run func(r admin.GetUserApiRequest)) *MongoDBCloudUsersApi_GetUserExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.GetUserApiRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserExecute_Call) Return(_a0 *admin.CloudAppUser, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_GetUserExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserExecute_Call) RunAndReturn(run func(admin.GetUserApiRequest) (*admin.CloudAppUser, *http.Response, error)) *MongoDBCloudUsersApi_GetUserExecute_Call { + _c.Call.Return(run) + return _c +} + +// GetUserWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) GetUserWithParams(ctx context.Context, args *admin.GetUserApiParams) admin.GetUserApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for GetUserWithParams") + } + + var r0 admin.GetUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.GetUserApiParams) admin.GetUserApiRequest); ok { r0 = rf(ctx, args) } else { r0 = ret.Get(0).(admin.GetUserApiRequest) @@ -479,31 +1454,520 @@ func (_m *MongoDBCloudUsersApi) GetUserWithParams(ctx context.Context, args *adm return r0 } -// MongoDBCloudUsersApi_GetUserWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserWithParams' -type MongoDBCloudUsersApi_GetUserWithParams_Call struct { +// MongoDBCloudUsersApi_GetUserWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserWithParams' +type MongoDBCloudUsersApi_GetUserWithParams_Call struct { + *mock.Call +} + +// GetUserWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.GetUserApiParams +func (_e *MongoDBCloudUsersApi_Expecter) GetUserWithParams(ctx any, args any) *MongoDBCloudUsersApi_GetUserWithParams_Call { + return &MongoDBCloudUsersApi_GetUserWithParams_Call{Call: _e.mock.On("GetUserWithParams", ctx, args)} +} + +func (_c *MongoDBCloudUsersApi_GetUserWithParams_Call) Run(run func(ctx context.Context, args *admin.GetUserApiParams)) *MongoDBCloudUsersApi_GetUserWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.GetUserApiParams)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserWithParams_Call) Return(_a0 admin.GetUserApiRequest) *MongoDBCloudUsersApi_GetUserWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_GetUserWithParams_Call) RunAndReturn(run func(context.Context, *admin.GetUserApiParams) admin.GetUserApiRequest) *MongoDBCloudUsersApi_GetUserWithParams_Call { + _c.Call.Return(run) + return _c +} + +// RemoveOrganizationRole provides a mock function with given fields: ctx, orgId, userId, addOrRemoveOrgRole +func (_m *MongoDBCloudUsersApi) RemoveOrganizationRole(ctx context.Context, orgId string, userId string, addOrRemoveOrgRole *admin.AddOrRemoveOrgRole) admin.RemoveOrganizationRoleApiRequest { + ret := _m.Called(ctx, orgId, userId, addOrRemoveOrgRole) + + if len(ret) == 0 { + panic("no return value specified for RemoveOrganizationRole") + } + + var r0 admin.RemoveOrganizationRoleApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.AddOrRemoveOrgRole) admin.RemoveOrganizationRoleApiRequest); ok { + r0 = rf(ctx, orgId, userId, addOrRemoveOrgRole) + } else { + r0 = ret.Get(0).(admin.RemoveOrganizationRoleApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_RemoveOrganizationRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveOrganizationRole' +type MongoDBCloudUsersApi_RemoveOrganizationRole_Call struct { + *mock.Call +} + +// RemoveOrganizationRole is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - userId string +// - addOrRemoveOrgRole *admin.AddOrRemoveOrgRole +func (_e *MongoDBCloudUsersApi_Expecter) RemoveOrganizationRole(ctx any, orgId any, userId any, addOrRemoveOrgRole any) *MongoDBCloudUsersApi_RemoveOrganizationRole_Call { + return &MongoDBCloudUsersApi_RemoveOrganizationRole_Call{Call: _e.mock.On("RemoveOrganizationRole", ctx, orgId, userId, addOrRemoveOrgRole)} +} + +func (_c *MongoDBCloudUsersApi_RemoveOrganizationRole_Call) Run(run func(ctx context.Context, orgId string, userId string, addOrRemoveOrgRole *admin.AddOrRemoveOrgRole)) *MongoDBCloudUsersApi_RemoveOrganizationRole_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.AddOrRemoveOrgRole)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveOrganizationRole_Call) Return(_a0 admin.RemoveOrganizationRoleApiRequest) *MongoDBCloudUsersApi_RemoveOrganizationRole_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveOrganizationRole_Call) RunAndReturn(run func(context.Context, string, string, *admin.AddOrRemoveOrgRole) admin.RemoveOrganizationRoleApiRequest) *MongoDBCloudUsersApi_RemoveOrganizationRole_Call { + _c.Call.Return(run) + return _c +} + +// RemoveOrganizationRoleExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) RemoveOrganizationRoleExecute(r admin.RemoveOrganizationRoleApiRequest) (*admin.OrgUserResponse, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for RemoveOrganizationRoleExecute") + } + + var r0 *admin.OrgUserResponse + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.RemoveOrganizationRoleApiRequest) (*admin.OrgUserResponse, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.RemoveOrganizationRoleApiRequest) *admin.OrgUserResponse); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.OrgUserResponse) + } + } + + if rf, ok := ret.Get(1).(func(admin.RemoveOrganizationRoleApiRequest) *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.RemoveOrganizationRoleApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveOrganizationRoleExecute' +type MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call struct { + *mock.Call +} + +// RemoveOrganizationRoleExecute is a helper method to define mock.On call +// - r admin.RemoveOrganizationRoleApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) RemoveOrganizationRoleExecute(r any) *MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call { + return &MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call{Call: _e.mock.On("RemoveOrganizationRoleExecute", r)} +} + +func (_c *MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call) Run(run func(r admin.RemoveOrganizationRoleApiRequest)) *MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.RemoveOrganizationRoleApiRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call) Return(_a0 *admin.OrgUserResponse, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call) RunAndReturn(run func(admin.RemoveOrganizationRoleApiRequest) (*admin.OrgUserResponse, *http.Response, error)) *MongoDBCloudUsersApi_RemoveOrganizationRoleExecute_Call { + _c.Call.Return(run) + return _c +} + +// RemoveOrganizationRoleWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) RemoveOrganizationRoleWithParams(ctx context.Context, args *admin.RemoveOrganizationRoleApiParams) admin.RemoveOrganizationRoleApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for RemoveOrganizationRoleWithParams") + } + + var r0 admin.RemoveOrganizationRoleApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.RemoveOrganizationRoleApiParams) admin.RemoveOrganizationRoleApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.RemoveOrganizationRoleApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveOrganizationRoleWithParams' +type MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call struct { *mock.Call } -// GetUserWithParams is a helper method to define mock.On call +// RemoveOrganizationRoleWithParams is a helper method to define mock.On call // - ctx context.Context -// - args *admin.GetUserApiParams -func (_e *MongoDBCloudUsersApi_Expecter) GetUserWithParams(ctx any, args any) *MongoDBCloudUsersApi_GetUserWithParams_Call { - return &MongoDBCloudUsersApi_GetUserWithParams_Call{Call: _e.mock.On("GetUserWithParams", ctx, args)} +// - args *admin.RemoveOrganizationRoleApiParams +func (_e *MongoDBCloudUsersApi_Expecter) RemoveOrganizationRoleWithParams(ctx any, args any) *MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call { + return &MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call{Call: _e.mock.On("RemoveOrganizationRoleWithParams", ctx, args)} } -func (_c *MongoDBCloudUsersApi_GetUserWithParams_Call) Run(run func(ctx context.Context, args *admin.GetUserApiParams)) *MongoDBCloudUsersApi_GetUserWithParams_Call { +func (_c *MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call) Run(run func(ctx context.Context, args *admin.RemoveOrganizationRoleApiParams)) *MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*admin.GetUserApiParams)) + run(args[0].(context.Context), args[1].(*admin.RemoveOrganizationRoleApiParams)) }) return _c } -func (_c *MongoDBCloudUsersApi_GetUserWithParams_Call) Return(_a0 admin.GetUserApiRequest) *MongoDBCloudUsersApi_GetUserWithParams_Call { +func (_c *MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call) Return(_a0 admin.RemoveOrganizationRoleApiRequest) *MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call { _c.Call.Return(_a0) return _c } -func (_c *MongoDBCloudUsersApi_GetUserWithParams_Call) RunAndReturn(run func(context.Context, *admin.GetUserApiParams) admin.GetUserApiRequest) *MongoDBCloudUsersApi_GetUserWithParams_Call { +func (_c *MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call) RunAndReturn(run func(context.Context, *admin.RemoveOrganizationRoleApiParams) admin.RemoveOrganizationRoleApiRequest) *MongoDBCloudUsersApi_RemoveOrganizationRoleWithParams_Call { + _c.Call.Return(run) + return _c +} + +// RemoveUserFromTeam provides a mock function with given fields: ctx, orgId, teamId, addOrRemoveUserFromTeam +func (_m *MongoDBCloudUsersApi) RemoveUserFromTeam(ctx context.Context, orgId string, teamId string, addOrRemoveUserFromTeam *admin.AddOrRemoveUserFromTeam) admin.RemoveUserFromTeamApiRequest { + ret := _m.Called(ctx, orgId, teamId, addOrRemoveUserFromTeam) + + if len(ret) == 0 { + panic("no return value specified for RemoveUserFromTeam") + } + + var r0 admin.RemoveUserFromTeamApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.AddOrRemoveUserFromTeam) admin.RemoveUserFromTeamApiRequest); ok { + r0 = rf(ctx, orgId, teamId, addOrRemoveUserFromTeam) + } else { + r0 = ret.Get(0).(admin.RemoveUserFromTeamApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_RemoveUserFromTeam_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUserFromTeam' +type MongoDBCloudUsersApi_RemoveUserFromTeam_Call struct { + *mock.Call +} + +// RemoveUserFromTeam is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - teamId string +// - addOrRemoveUserFromTeam *admin.AddOrRemoveUserFromTeam +func (_e *MongoDBCloudUsersApi_Expecter) RemoveUserFromTeam(ctx any, orgId any, teamId any, addOrRemoveUserFromTeam any) *MongoDBCloudUsersApi_RemoveUserFromTeam_Call { + return &MongoDBCloudUsersApi_RemoveUserFromTeam_Call{Call: _e.mock.On("RemoveUserFromTeam", ctx, orgId, teamId, addOrRemoveUserFromTeam)} +} + +func (_c *MongoDBCloudUsersApi_RemoveUserFromTeam_Call) Run(run func(ctx context.Context, orgId string, teamId string, addOrRemoveUserFromTeam *admin.AddOrRemoveUserFromTeam)) *MongoDBCloudUsersApi_RemoveUserFromTeam_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.AddOrRemoveUserFromTeam)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveUserFromTeam_Call) Return(_a0 admin.RemoveUserFromTeamApiRequest) *MongoDBCloudUsersApi_RemoveUserFromTeam_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveUserFromTeam_Call) RunAndReturn(run func(context.Context, string, string, *admin.AddOrRemoveUserFromTeam) admin.RemoveUserFromTeamApiRequest) *MongoDBCloudUsersApi_RemoveUserFromTeam_Call { + _c.Call.Return(run) + return _c +} + +// RemoveUserFromTeamExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) RemoveUserFromTeamExecute(r admin.RemoveUserFromTeamApiRequest) (*admin.OrgUserResponse, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for RemoveUserFromTeamExecute") + } + + var r0 *admin.OrgUserResponse + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.RemoveUserFromTeamApiRequest) (*admin.OrgUserResponse, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.RemoveUserFromTeamApiRequest) *admin.OrgUserResponse); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.OrgUserResponse) + } + } + + if rf, ok := ret.Get(1).(func(admin.RemoveUserFromTeamApiRequest) *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.RemoveUserFromTeamApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUserFromTeamExecute' +type MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call struct { + *mock.Call +} + +// RemoveUserFromTeamExecute is a helper method to define mock.On call +// - r admin.RemoveUserFromTeamApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) RemoveUserFromTeamExecute(r any) *MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call { + return &MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call{Call: _e.mock.On("RemoveUserFromTeamExecute", r)} +} + +func (_c *MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call) Run(run func(r admin.RemoveUserFromTeamApiRequest)) *MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.RemoveUserFromTeamApiRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call) Return(_a0 *admin.OrgUserResponse, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call) RunAndReturn(run func(admin.RemoveUserFromTeamApiRequest) (*admin.OrgUserResponse, *http.Response, error)) *MongoDBCloudUsersApi_RemoveUserFromTeamExecute_Call { + _c.Call.Return(run) + return _c +} + +// RemoveUserFromTeamWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) RemoveUserFromTeamWithParams(ctx context.Context, args *admin.RemoveUserFromTeamApiParams) admin.RemoveUserFromTeamApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for RemoveUserFromTeamWithParams") + } + + var r0 admin.RemoveUserFromTeamApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.RemoveUserFromTeamApiParams) admin.RemoveUserFromTeamApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.RemoveUserFromTeamApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUserFromTeamWithParams' +type MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call struct { + *mock.Call +} + +// RemoveUserFromTeamWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.RemoveUserFromTeamApiParams +func (_e *MongoDBCloudUsersApi_Expecter) RemoveUserFromTeamWithParams(ctx any, args any) *MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call { + return &MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call{Call: _e.mock.On("RemoveUserFromTeamWithParams", ctx, args)} +} + +func (_c *MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call) Run(run func(ctx context.Context, args *admin.RemoveUserFromTeamApiParams)) *MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.RemoveUserFromTeamApiParams)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call) Return(_a0 admin.RemoveUserFromTeamApiRequest) *MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call) RunAndReturn(run func(context.Context, *admin.RemoveUserFromTeamApiParams) admin.RemoveUserFromTeamApiRequest) *MongoDBCloudUsersApi_RemoveUserFromTeamWithParams_Call { + _c.Call.Return(run) + return _c +} + +// UpdateOrganizationUser provides a mock function with given fields: ctx, orgId, userId, orgUserUpdateRequest +func (_m *MongoDBCloudUsersApi) UpdateOrganizationUser(ctx context.Context, orgId string, userId string, orgUserUpdateRequest *admin.OrgUserUpdateRequest) admin.UpdateOrganizationUserApiRequest { + ret := _m.Called(ctx, orgId, userId, orgUserUpdateRequest) + + if len(ret) == 0 { + panic("no return value specified for UpdateOrganizationUser") + } + + var r0 admin.UpdateOrganizationUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, *admin.OrgUserUpdateRequest) admin.UpdateOrganizationUserApiRequest); ok { + r0 = rf(ctx, orgId, userId, orgUserUpdateRequest) + } else { + r0 = ret.Get(0).(admin.UpdateOrganizationUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_UpdateOrganizationUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateOrganizationUser' +type MongoDBCloudUsersApi_UpdateOrganizationUser_Call struct { + *mock.Call +} + +// UpdateOrganizationUser is a helper method to define mock.On call +// - ctx context.Context +// - orgId string +// - userId string +// - orgUserUpdateRequest *admin.OrgUserUpdateRequest +func (_e *MongoDBCloudUsersApi_Expecter) UpdateOrganizationUser(ctx any, orgId any, userId any, orgUserUpdateRequest any) *MongoDBCloudUsersApi_UpdateOrganizationUser_Call { + return &MongoDBCloudUsersApi_UpdateOrganizationUser_Call{Call: _e.mock.On("UpdateOrganizationUser", ctx, orgId, userId, orgUserUpdateRequest)} +} + +func (_c *MongoDBCloudUsersApi_UpdateOrganizationUser_Call) Run(run func(ctx context.Context, orgId string, userId string, orgUserUpdateRequest *admin.OrgUserUpdateRequest)) *MongoDBCloudUsersApi_UpdateOrganizationUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*admin.OrgUserUpdateRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_UpdateOrganizationUser_Call) Return(_a0 admin.UpdateOrganizationUserApiRequest) *MongoDBCloudUsersApi_UpdateOrganizationUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_UpdateOrganizationUser_Call) RunAndReturn(run func(context.Context, string, string, *admin.OrgUserUpdateRequest) admin.UpdateOrganizationUserApiRequest) *MongoDBCloudUsersApi_UpdateOrganizationUser_Call { + _c.Call.Return(run) + return _c +} + +// UpdateOrganizationUserExecute provides a mock function with given fields: r +func (_m *MongoDBCloudUsersApi) UpdateOrganizationUserExecute(r admin.UpdateOrganizationUserApiRequest) (*admin.OrgUserResponse, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for UpdateOrganizationUserExecute") + } + + var r0 *admin.OrgUserResponse + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.UpdateOrganizationUserApiRequest) (*admin.OrgUserResponse, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.UpdateOrganizationUserApiRequest) *admin.OrgUserResponse); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.OrgUserResponse) + } + } + + if rf, ok := ret.Get(1).(func(admin.UpdateOrganizationUserApiRequest) *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.UpdateOrganizationUserApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateOrganizationUserExecute' +type MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call struct { + *mock.Call +} + +// UpdateOrganizationUserExecute is a helper method to define mock.On call +// - r admin.UpdateOrganizationUserApiRequest +func (_e *MongoDBCloudUsersApi_Expecter) UpdateOrganizationUserExecute(r any) *MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call { + return &MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call{Call: _e.mock.On("UpdateOrganizationUserExecute", r)} +} + +func (_c *MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call) Run(run func(r admin.UpdateOrganizationUserApiRequest)) *MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.UpdateOrganizationUserApiRequest)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call) Return(_a0 *admin.OrgUserResponse, _a1 *http.Response, _a2 error) *MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call) RunAndReturn(run func(admin.UpdateOrganizationUserApiRequest) (*admin.OrgUserResponse, *http.Response, error)) *MongoDBCloudUsersApi_UpdateOrganizationUserExecute_Call { + _c.Call.Return(run) + return _c +} + +// UpdateOrganizationUserWithParams provides a mock function with given fields: ctx, args +func (_m *MongoDBCloudUsersApi) UpdateOrganizationUserWithParams(ctx context.Context, args *admin.UpdateOrganizationUserApiParams) admin.UpdateOrganizationUserApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for UpdateOrganizationUserWithParams") + } + + var r0 admin.UpdateOrganizationUserApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.UpdateOrganizationUserApiParams) admin.UpdateOrganizationUserApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.UpdateOrganizationUserApiRequest) + } + + return r0 +} + +// MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateOrganizationUserWithParams' +type MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call struct { + *mock.Call +} + +// UpdateOrganizationUserWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.UpdateOrganizationUserApiParams +func (_e *MongoDBCloudUsersApi_Expecter) UpdateOrganizationUserWithParams(ctx any, args any) *MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call { + return &MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call{Call: _e.mock.On("UpdateOrganizationUserWithParams", ctx, args)} +} + +func (_c *MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call) Run(run func(ctx context.Context, args *admin.UpdateOrganizationUserApiParams)) *MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.UpdateOrganizationUserApiParams)) + }) + return _c +} + +func (_c *MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call) Return(_a0 admin.UpdateOrganizationUserApiRequest) *MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call) RunAndReturn(run func(context.Context, *admin.UpdateOrganizationUserApiParams) admin.UpdateOrganizationUserApiRequest) *MongoDBCloudUsersApi_UpdateOrganizationUserWithParams_Call { _c.Call.Return(run) return _c } diff --git a/mockadmin/monitoring_and_logs_api.go b/mockadmin/monitoring_and_logs_api.go index b08682c99..537e8e117 100644 --- a/mockadmin/monitoring_and_logs_api.go +++ b/mockadmin/monitoring_and_logs_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/network_peering_api.go b/mockadmin/network_peering_api.go index 1e2cd12a4..d2b2c4835 100644 --- a/mockadmin/network_peering_api.go +++ b/mockadmin/network_peering_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/online_archive_api.go b/mockadmin/online_archive_api.go index f200697c1..7a3806042 100644 --- a/mockadmin/online_archive_api.go +++ b/mockadmin/online_archive_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/open_api_api.go b/mockadmin/open_api_api.go new file mode 100644 index 000000000..242eed4ed --- /dev/null +++ b/mockadmin/open_api_api.go @@ -0,0 +1,200 @@ +// Code generated by mockery. DO NOT EDIT. + +package mockadmin + +import ( + context "context" + + admin "github.com/mongodb/atlas-sdk-go/admin" + + http "net/http" + + mock "github.com/stretchr/testify/mock" +) + +// OpenAPIApi is an autogenerated mock type for the OpenAPIApi type +type OpenAPIApi struct { + mock.Mock +} + +type OpenAPIApi_Expecter struct { + mock *mock.Mock +} + +func (_m *OpenAPIApi) EXPECT() *OpenAPIApi_Expecter { + return &OpenAPIApi_Expecter{mock: &_m.Mock} +} + +// GetApiVersions provides a mock function with given fields: ctx +func (_m *OpenAPIApi) GetApiVersions(ctx context.Context) admin.GetApiVersionsApiRequest { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetApiVersions") + } + + var r0 admin.GetApiVersionsApiRequest + if rf, ok := ret.Get(0).(func(context.Context) admin.GetApiVersionsApiRequest); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(admin.GetApiVersionsApiRequest) + } + + return r0 +} + +// OpenAPIApi_GetApiVersions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApiVersions' +type OpenAPIApi_GetApiVersions_Call struct { + *mock.Call +} + +// GetApiVersions is a helper method to define mock.On call +// - ctx context.Context +func (_e *OpenAPIApi_Expecter) GetApiVersions(ctx any) *OpenAPIApi_GetApiVersions_Call { + return &OpenAPIApi_GetApiVersions_Call{Call: _e.mock.On("GetApiVersions", ctx)} +} + +func (_c *OpenAPIApi_GetApiVersions_Call) Run(run func(ctx context.Context)) *OpenAPIApi_GetApiVersions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *OpenAPIApi_GetApiVersions_Call) Return(_a0 admin.GetApiVersionsApiRequest) *OpenAPIApi_GetApiVersions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OpenAPIApi_GetApiVersions_Call) RunAndReturn(run func(context.Context) admin.GetApiVersionsApiRequest) *OpenAPIApi_GetApiVersions_Call { + _c.Call.Return(run) + return _c +} + +// GetApiVersionsExecute provides a mock function with given fields: r +func (_m *OpenAPIApi) GetApiVersionsExecute(r admin.GetApiVersionsApiRequest) (*admin.PaginatedApiVersions, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for GetApiVersionsExecute") + } + + var r0 *admin.PaginatedApiVersions + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.GetApiVersionsApiRequest) (*admin.PaginatedApiVersions, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.GetApiVersionsApiRequest) *admin.PaginatedApiVersions); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PaginatedApiVersions) + } + } + + if rf, ok := ret.Get(1).(func(admin.GetApiVersionsApiRequest) *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.GetApiVersionsApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// OpenAPIApi_GetApiVersionsExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApiVersionsExecute' +type OpenAPIApi_GetApiVersionsExecute_Call struct { + *mock.Call +} + +// GetApiVersionsExecute is a helper method to define mock.On call +// - r admin.GetApiVersionsApiRequest +func (_e *OpenAPIApi_Expecter) GetApiVersionsExecute(r any) *OpenAPIApi_GetApiVersionsExecute_Call { + return &OpenAPIApi_GetApiVersionsExecute_Call{Call: _e.mock.On("GetApiVersionsExecute", r)} +} + +func (_c *OpenAPIApi_GetApiVersionsExecute_Call) Run(run func(r admin.GetApiVersionsApiRequest)) *OpenAPIApi_GetApiVersionsExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.GetApiVersionsApiRequest)) + }) + return _c +} + +func (_c *OpenAPIApi_GetApiVersionsExecute_Call) Return(_a0 *admin.PaginatedApiVersions, _a1 *http.Response, _a2 error) *OpenAPIApi_GetApiVersionsExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *OpenAPIApi_GetApiVersionsExecute_Call) RunAndReturn(run func(admin.GetApiVersionsApiRequest) (*admin.PaginatedApiVersions, *http.Response, error)) *OpenAPIApi_GetApiVersionsExecute_Call { + _c.Call.Return(run) + return _c +} + +// GetApiVersionsWithParams provides a mock function with given fields: ctx, args +func (_m *OpenAPIApi) GetApiVersionsWithParams(ctx context.Context, args *admin.GetApiVersionsApiParams) admin.GetApiVersionsApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for GetApiVersionsWithParams") + } + + var r0 admin.GetApiVersionsApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.GetApiVersionsApiParams) admin.GetApiVersionsApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.GetApiVersionsApiRequest) + } + + return r0 +} + +// OpenAPIApi_GetApiVersionsWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApiVersionsWithParams' +type OpenAPIApi_GetApiVersionsWithParams_Call struct { + *mock.Call +} + +// GetApiVersionsWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.GetApiVersionsApiParams +func (_e *OpenAPIApi_Expecter) GetApiVersionsWithParams(ctx any, args any) *OpenAPIApi_GetApiVersionsWithParams_Call { + return &OpenAPIApi_GetApiVersionsWithParams_Call{Call: _e.mock.On("GetApiVersionsWithParams", ctx, args)} +} + +func (_c *OpenAPIApi_GetApiVersionsWithParams_Call) Run(run func(ctx context.Context, args *admin.GetApiVersionsApiParams)) *OpenAPIApi_GetApiVersionsWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.GetApiVersionsApiParams)) + }) + return _c +} + +func (_c *OpenAPIApi_GetApiVersionsWithParams_Call) Return(_a0 admin.GetApiVersionsApiRequest) *OpenAPIApi_GetApiVersionsWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OpenAPIApi_GetApiVersionsWithParams_Call) RunAndReturn(run func(context.Context, *admin.GetApiVersionsApiParams) admin.GetApiVersionsApiRequest) *OpenAPIApi_GetApiVersionsWithParams_Call { + _c.Call.Return(run) + return _c +} + +// NewOpenAPIApi creates a new instance of OpenAPIApi. 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 NewOpenAPIApi(t interface { + mock.TestingT + Cleanup(func()) +}) *OpenAPIApi { + mock := &OpenAPIApi{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mockadmin/organizations_api.go b/mockadmin/organizations_api.go index eaa1f6af3..7f1e62f22 100644 --- a/mockadmin/organizations_api.go +++ b/mockadmin/organizations_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" @@ -1525,24 +1525,24 @@ func (_c *OrganizationsApi_ListOrganizationUsers_Call) RunAndReturn(run func(con } // ListOrganizationUsersExecute provides a mock function with given fields: r -func (_m *OrganizationsApi) ListOrganizationUsersExecute(r admin.ListOrganizationUsersApiRequest) (*admin.PaginatedAppUser, *http.Response, error) { +func (_m *OrganizationsApi) ListOrganizationUsersExecute(r admin.ListOrganizationUsersApiRequest) (*admin.PaginatedOrgUser, *http.Response, error) { ret := _m.Called(r) if len(ret) == 0 { panic("no return value specified for ListOrganizationUsersExecute") } - var r0 *admin.PaginatedAppUser + var r0 *admin.PaginatedOrgUser var r1 *http.Response var r2 error - if rf, ok := ret.Get(0).(func(admin.ListOrganizationUsersApiRequest) (*admin.PaginatedAppUser, *http.Response, error)); ok { + if rf, ok := ret.Get(0).(func(admin.ListOrganizationUsersApiRequest) (*admin.PaginatedOrgUser, *http.Response, error)); ok { return rf(r) } - if rf, ok := ret.Get(0).(func(admin.ListOrganizationUsersApiRequest) *admin.PaginatedAppUser); ok { + if rf, ok := ret.Get(0).(func(admin.ListOrganizationUsersApiRequest) *admin.PaginatedOrgUser); ok { r0 = rf(r) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*admin.PaginatedAppUser) + r0 = ret.Get(0).(*admin.PaginatedOrgUser) } } @@ -1581,12 +1581,12 @@ func (_c *OrganizationsApi_ListOrganizationUsersExecute_Call) Run(run func(r adm return _c } -func (_c *OrganizationsApi_ListOrganizationUsersExecute_Call) Return(_a0 *admin.PaginatedAppUser, _a1 *http.Response, _a2 error) *OrganizationsApi_ListOrganizationUsersExecute_Call { +func (_c *OrganizationsApi_ListOrganizationUsersExecute_Call) Return(_a0 *admin.PaginatedOrgUser, _a1 *http.Response, _a2 error) *OrganizationsApi_ListOrganizationUsersExecute_Call { _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *OrganizationsApi_ListOrganizationUsersExecute_Call) RunAndReturn(run func(admin.ListOrganizationUsersApiRequest) (*admin.PaginatedAppUser, *http.Response, error)) *OrganizationsApi_ListOrganizationUsersExecute_Call { +func (_c *OrganizationsApi_ListOrganizationUsersExecute_Call) RunAndReturn(run func(admin.ListOrganizationUsersApiRequest) (*admin.PaginatedOrgUser, *http.Response, error)) *OrganizationsApi_ListOrganizationUsersExecute_Call { _c.Call.Return(run) return _c } diff --git a/mockadmin/performance_advisor_api.go b/mockadmin/performance_advisor_api.go index 7e1516732..f0f7f8653 100644 --- a/mockadmin/performance_advisor_api.go +++ b/mockadmin/performance_advisor_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" @@ -641,6 +641,492 @@ func (_c *PerformanceAdvisorApi_GetServerlessAutoIndexingWithParams_Call) RunAnd return _c } +// ListClusterSuggestedIndexes provides a mock function with given fields: ctx, groupId, clusterName +func (_m *PerformanceAdvisorApi) ListClusterSuggestedIndexes(ctx context.Context, groupId string, clusterName string) admin.ListClusterSuggestedIndexesApiRequest { + ret := _m.Called(ctx, groupId, clusterName) + + if len(ret) == 0 { + panic("no return value specified for ListClusterSuggestedIndexes") + } + + var r0 admin.ListClusterSuggestedIndexesApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.ListClusterSuggestedIndexesApiRequest); ok { + r0 = rf(ctx, groupId, clusterName) + } else { + r0 = ret.Get(0).(admin.ListClusterSuggestedIndexesApiRequest) + } + + return r0 +} + +// PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListClusterSuggestedIndexes' +type PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call struct { + *mock.Call +} + +// ListClusterSuggestedIndexes is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - clusterName string +func (_e *PerformanceAdvisorApi_Expecter) ListClusterSuggestedIndexes(ctx any, groupId any, clusterName any) *PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call { + return &PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call{Call: _e.mock.On("ListClusterSuggestedIndexes", ctx, groupId, clusterName)} +} + +func (_c *PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call) Run(run func(ctx context.Context, groupId string, clusterName string)) *PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call) Return(_a0 admin.ListClusterSuggestedIndexesApiRequest) *PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call) RunAndReturn(run func(context.Context, string, string) admin.ListClusterSuggestedIndexesApiRequest) *PerformanceAdvisorApi_ListClusterSuggestedIndexes_Call { + _c.Call.Return(run) + return _c +} + +// ListClusterSuggestedIndexesExecute provides a mock function with given fields: r +func (_m *PerformanceAdvisorApi) ListClusterSuggestedIndexesExecute(r admin.ListClusterSuggestedIndexesApiRequest) (*admin.PerformanceAdvisorResponse, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for ListClusterSuggestedIndexesExecute") + } + + var r0 *admin.PerformanceAdvisorResponse + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.ListClusterSuggestedIndexesApiRequest) (*admin.PerformanceAdvisorResponse, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.ListClusterSuggestedIndexesApiRequest) *admin.PerformanceAdvisorResponse); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PerformanceAdvisorResponse) + } + } + + if rf, ok := ret.Get(1).(func(admin.ListClusterSuggestedIndexesApiRequest) *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.ListClusterSuggestedIndexesApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListClusterSuggestedIndexesExecute' +type PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call struct { + *mock.Call +} + +// ListClusterSuggestedIndexesExecute is a helper method to define mock.On call +// - r admin.ListClusterSuggestedIndexesApiRequest +func (_e *PerformanceAdvisorApi_Expecter) ListClusterSuggestedIndexesExecute(r any) *PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call { + return &PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call{Call: _e.mock.On("ListClusterSuggestedIndexesExecute", r)} +} + +func (_c *PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call) Run(run func(r admin.ListClusterSuggestedIndexesApiRequest)) *PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.ListClusterSuggestedIndexesApiRequest)) + }) + return _c +} + +func (_c *PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call) Return(_a0 *admin.PerformanceAdvisorResponse, _a1 *http.Response, _a2 error) *PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call) RunAndReturn(run func(admin.ListClusterSuggestedIndexesApiRequest) (*admin.PerformanceAdvisorResponse, *http.Response, error)) *PerformanceAdvisorApi_ListClusterSuggestedIndexesExecute_Call { + _c.Call.Return(run) + return _c +} + +// ListClusterSuggestedIndexesWithParams provides a mock function with given fields: ctx, args +func (_m *PerformanceAdvisorApi) ListClusterSuggestedIndexesWithParams(ctx context.Context, args *admin.ListClusterSuggestedIndexesApiParams) admin.ListClusterSuggestedIndexesApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for ListClusterSuggestedIndexesWithParams") + } + + var r0 admin.ListClusterSuggestedIndexesApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.ListClusterSuggestedIndexesApiParams) admin.ListClusterSuggestedIndexesApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.ListClusterSuggestedIndexesApiRequest) + } + + return r0 +} + +// PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListClusterSuggestedIndexesWithParams' +type PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call struct { + *mock.Call +} + +// ListClusterSuggestedIndexesWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.ListClusterSuggestedIndexesApiParams +func (_e *PerformanceAdvisorApi_Expecter) ListClusterSuggestedIndexesWithParams(ctx any, args any) *PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call { + return &PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call{Call: _e.mock.On("ListClusterSuggestedIndexesWithParams", ctx, args)} +} + +func (_c *PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call) Run(run func(ctx context.Context, args *admin.ListClusterSuggestedIndexesApiParams)) *PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.ListClusterSuggestedIndexesApiParams)) + }) + return _c +} + +func (_c *PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call) Return(_a0 admin.ListClusterSuggestedIndexesApiRequest) *PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call) RunAndReturn(run func(context.Context, *admin.ListClusterSuggestedIndexesApiParams) admin.ListClusterSuggestedIndexesApiRequest) *PerformanceAdvisorApi_ListClusterSuggestedIndexesWithParams_Call { + _c.Call.Return(run) + return _c +} + +// ListDropIndexes provides a mock function with given fields: ctx, groupId, clusterName +func (_m *PerformanceAdvisorApi) ListDropIndexes(ctx context.Context, groupId string, clusterName string) admin.ListDropIndexesApiRequest { + ret := _m.Called(ctx, groupId, clusterName) + + if len(ret) == 0 { + panic("no return value specified for ListDropIndexes") + } + + var r0 admin.ListDropIndexesApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.ListDropIndexesApiRequest); ok { + r0 = rf(ctx, groupId, clusterName) + } else { + r0 = ret.Get(0).(admin.ListDropIndexesApiRequest) + } + + return r0 +} + +// PerformanceAdvisorApi_ListDropIndexes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDropIndexes' +type PerformanceAdvisorApi_ListDropIndexes_Call struct { + *mock.Call +} + +// ListDropIndexes is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - clusterName string +func (_e *PerformanceAdvisorApi_Expecter) ListDropIndexes(ctx any, groupId any, clusterName any) *PerformanceAdvisorApi_ListDropIndexes_Call { + return &PerformanceAdvisorApi_ListDropIndexes_Call{Call: _e.mock.On("ListDropIndexes", ctx, groupId, clusterName)} +} + +func (_c *PerformanceAdvisorApi_ListDropIndexes_Call) Run(run func(ctx context.Context, groupId string, clusterName string)) *PerformanceAdvisorApi_ListDropIndexes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *PerformanceAdvisorApi_ListDropIndexes_Call) Return(_a0 admin.ListDropIndexesApiRequest) *PerformanceAdvisorApi_ListDropIndexes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PerformanceAdvisorApi_ListDropIndexes_Call) RunAndReturn(run func(context.Context, string, string) admin.ListDropIndexesApiRequest) *PerformanceAdvisorApi_ListDropIndexes_Call { + _c.Call.Return(run) + return _c +} + +// ListDropIndexesExecute provides a mock function with given fields: r +func (_m *PerformanceAdvisorApi) ListDropIndexesExecute(r admin.ListDropIndexesApiRequest) (*admin.PerformanceAdvisorResponse, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for ListDropIndexesExecute") + } + + var r0 *admin.PerformanceAdvisorResponse + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.ListDropIndexesApiRequest) (*admin.PerformanceAdvisorResponse, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.ListDropIndexesApiRequest) *admin.PerformanceAdvisorResponse); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PerformanceAdvisorResponse) + } + } + + if rf, ok := ret.Get(1).(func(admin.ListDropIndexesApiRequest) *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.ListDropIndexesApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// PerformanceAdvisorApi_ListDropIndexesExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDropIndexesExecute' +type PerformanceAdvisorApi_ListDropIndexesExecute_Call struct { + *mock.Call +} + +// ListDropIndexesExecute is a helper method to define mock.On call +// - r admin.ListDropIndexesApiRequest +func (_e *PerformanceAdvisorApi_Expecter) ListDropIndexesExecute(r any) *PerformanceAdvisorApi_ListDropIndexesExecute_Call { + return &PerformanceAdvisorApi_ListDropIndexesExecute_Call{Call: _e.mock.On("ListDropIndexesExecute", r)} +} + +func (_c *PerformanceAdvisorApi_ListDropIndexesExecute_Call) Run(run func(r admin.ListDropIndexesApiRequest)) *PerformanceAdvisorApi_ListDropIndexesExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.ListDropIndexesApiRequest)) + }) + return _c +} + +func (_c *PerformanceAdvisorApi_ListDropIndexesExecute_Call) Return(_a0 *admin.PerformanceAdvisorResponse, _a1 *http.Response, _a2 error) *PerformanceAdvisorApi_ListDropIndexesExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *PerformanceAdvisorApi_ListDropIndexesExecute_Call) RunAndReturn(run func(admin.ListDropIndexesApiRequest) (*admin.PerformanceAdvisorResponse, *http.Response, error)) *PerformanceAdvisorApi_ListDropIndexesExecute_Call { + _c.Call.Return(run) + return _c +} + +// ListDropIndexesWithParams provides a mock function with given fields: ctx, args +func (_m *PerformanceAdvisorApi) ListDropIndexesWithParams(ctx context.Context, args *admin.ListDropIndexesApiParams) admin.ListDropIndexesApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for ListDropIndexesWithParams") + } + + var r0 admin.ListDropIndexesApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.ListDropIndexesApiParams) admin.ListDropIndexesApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.ListDropIndexesApiRequest) + } + + return r0 +} + +// PerformanceAdvisorApi_ListDropIndexesWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDropIndexesWithParams' +type PerformanceAdvisorApi_ListDropIndexesWithParams_Call struct { + *mock.Call +} + +// ListDropIndexesWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.ListDropIndexesApiParams +func (_e *PerformanceAdvisorApi_Expecter) ListDropIndexesWithParams(ctx any, args any) *PerformanceAdvisorApi_ListDropIndexesWithParams_Call { + return &PerformanceAdvisorApi_ListDropIndexesWithParams_Call{Call: _e.mock.On("ListDropIndexesWithParams", ctx, args)} +} + +func (_c *PerformanceAdvisorApi_ListDropIndexesWithParams_Call) Run(run func(ctx context.Context, args *admin.ListDropIndexesApiParams)) *PerformanceAdvisorApi_ListDropIndexesWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.ListDropIndexesApiParams)) + }) + return _c +} + +func (_c *PerformanceAdvisorApi_ListDropIndexesWithParams_Call) Return(_a0 admin.ListDropIndexesApiRequest) *PerformanceAdvisorApi_ListDropIndexesWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PerformanceAdvisorApi_ListDropIndexesWithParams_Call) RunAndReturn(run func(context.Context, *admin.ListDropIndexesApiParams) admin.ListDropIndexesApiRequest) *PerformanceAdvisorApi_ListDropIndexesWithParams_Call { + _c.Call.Return(run) + return _c +} + +// ListSchemaAdvice provides a mock function with given fields: ctx, groupId, clusterName +func (_m *PerformanceAdvisorApi) ListSchemaAdvice(ctx context.Context, groupId string, clusterName string) admin.ListSchemaAdviceApiRequest { + ret := _m.Called(ctx, groupId, clusterName) + + if len(ret) == 0 { + panic("no return value specified for ListSchemaAdvice") + } + + var r0 admin.ListSchemaAdviceApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string) admin.ListSchemaAdviceApiRequest); ok { + r0 = rf(ctx, groupId, clusterName) + } else { + r0 = ret.Get(0).(admin.ListSchemaAdviceApiRequest) + } + + return r0 +} + +// PerformanceAdvisorApi_ListSchemaAdvice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSchemaAdvice' +type PerformanceAdvisorApi_ListSchemaAdvice_Call struct { + *mock.Call +} + +// ListSchemaAdvice is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - clusterName string +func (_e *PerformanceAdvisorApi_Expecter) ListSchemaAdvice(ctx any, groupId any, clusterName any) *PerformanceAdvisorApi_ListSchemaAdvice_Call { + return &PerformanceAdvisorApi_ListSchemaAdvice_Call{Call: _e.mock.On("ListSchemaAdvice", ctx, groupId, clusterName)} +} + +func (_c *PerformanceAdvisorApi_ListSchemaAdvice_Call) Run(run func(ctx context.Context, groupId string, clusterName string)) *PerformanceAdvisorApi_ListSchemaAdvice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *PerformanceAdvisorApi_ListSchemaAdvice_Call) Return(_a0 admin.ListSchemaAdviceApiRequest) *PerformanceAdvisorApi_ListSchemaAdvice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PerformanceAdvisorApi_ListSchemaAdvice_Call) RunAndReturn(run func(context.Context, string, string) admin.ListSchemaAdviceApiRequest) *PerformanceAdvisorApi_ListSchemaAdvice_Call { + _c.Call.Return(run) + return _c +} + +// ListSchemaAdviceExecute provides a mock function with given fields: r +func (_m *PerformanceAdvisorApi) ListSchemaAdviceExecute(r admin.ListSchemaAdviceApiRequest) (*admin.PerformanceAdvisorResponse, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for ListSchemaAdviceExecute") + } + + var r0 *admin.PerformanceAdvisorResponse + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.ListSchemaAdviceApiRequest) (*admin.PerformanceAdvisorResponse, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.ListSchemaAdviceApiRequest) *admin.PerformanceAdvisorResponse); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.PerformanceAdvisorResponse) + } + } + + if rf, ok := ret.Get(1).(func(admin.ListSchemaAdviceApiRequest) *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.ListSchemaAdviceApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// PerformanceAdvisorApi_ListSchemaAdviceExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSchemaAdviceExecute' +type PerformanceAdvisorApi_ListSchemaAdviceExecute_Call struct { + *mock.Call +} + +// ListSchemaAdviceExecute is a helper method to define mock.On call +// - r admin.ListSchemaAdviceApiRequest +func (_e *PerformanceAdvisorApi_Expecter) ListSchemaAdviceExecute(r any) *PerformanceAdvisorApi_ListSchemaAdviceExecute_Call { + return &PerformanceAdvisorApi_ListSchemaAdviceExecute_Call{Call: _e.mock.On("ListSchemaAdviceExecute", r)} +} + +func (_c *PerformanceAdvisorApi_ListSchemaAdviceExecute_Call) Run(run func(r admin.ListSchemaAdviceApiRequest)) *PerformanceAdvisorApi_ListSchemaAdviceExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.ListSchemaAdviceApiRequest)) + }) + return _c +} + +func (_c *PerformanceAdvisorApi_ListSchemaAdviceExecute_Call) Return(_a0 *admin.PerformanceAdvisorResponse, _a1 *http.Response, _a2 error) *PerformanceAdvisorApi_ListSchemaAdviceExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *PerformanceAdvisorApi_ListSchemaAdviceExecute_Call) RunAndReturn(run func(admin.ListSchemaAdviceApiRequest) (*admin.PerformanceAdvisorResponse, *http.Response, error)) *PerformanceAdvisorApi_ListSchemaAdviceExecute_Call { + _c.Call.Return(run) + return _c +} + +// ListSchemaAdviceWithParams provides a mock function with given fields: ctx, args +func (_m *PerformanceAdvisorApi) ListSchemaAdviceWithParams(ctx context.Context, args *admin.ListSchemaAdviceApiParams) admin.ListSchemaAdviceApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for ListSchemaAdviceWithParams") + } + + var r0 admin.ListSchemaAdviceApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.ListSchemaAdviceApiParams) admin.ListSchemaAdviceApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.ListSchemaAdviceApiRequest) + } + + return r0 +} + +// PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSchemaAdviceWithParams' +type PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call struct { + *mock.Call +} + +// ListSchemaAdviceWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.ListSchemaAdviceApiParams +func (_e *PerformanceAdvisorApi_Expecter) ListSchemaAdviceWithParams(ctx any, args any) *PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call { + return &PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call{Call: _e.mock.On("ListSchemaAdviceWithParams", ctx, args)} +} + +func (_c *PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call) Run(run func(ctx context.Context, args *admin.ListSchemaAdviceApiParams)) *PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.ListSchemaAdviceApiParams)) + }) + return _c +} + +func (_c *PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call) Return(_a0 admin.ListSchemaAdviceApiRequest) *PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call) RunAndReturn(run func(context.Context, *admin.ListSchemaAdviceApiParams) admin.ListSchemaAdviceApiRequest) *PerformanceAdvisorApi_ListSchemaAdviceWithParams_Call { + _c.Call.Return(run) + return _c +} + // ListSlowQueries provides a mock function with given fields: ctx, groupId, processId func (_m *PerformanceAdvisorApi) ListSlowQueries(ctx context.Context, groupId string, processId string) admin.ListSlowQueriesApiRequest { ret := _m.Called(ctx, groupId, processId) diff --git a/mockadmin/private_endpoint_services_api.go b/mockadmin/private_endpoint_services_api.go index 2974cb9a3..99c1be4a9 100644 --- a/mockadmin/private_endpoint_services_api.go +++ b/mockadmin/private_endpoint_services_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/programmatic_api_keys_api.go b/mockadmin/programmatic_api_keys_api.go index e74b98ce9..e12a3e6ac 100644 --- a/mockadmin/programmatic_api_keys_api.go +++ b/mockadmin/programmatic_api_keys_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/project_ip_access_list_api.go b/mockadmin/project_ip_access_list_api.go index 14fd26839..dcb9ffc1b 100644 --- a/mockadmin/project_ip_access_list_api.go +++ b/mockadmin/project_ip_access_list_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/projects_api.go b/mockadmin/projects_api.go index b7b231ae6..df7504929 100644 --- a/mockadmin/projects_api.go +++ b/mockadmin/projects_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" @@ -2817,33 +2817,42 @@ func (_c *ProjectsApi_RemoveProjectUser_Call) RunAndReturn(run func(context.Cont } // RemoveProjectUserExecute provides a mock function with given fields: r -func (_m *ProjectsApi) RemoveProjectUserExecute(r admin.RemoveProjectUserApiRequest) (*http.Response, error) { +func (_m *ProjectsApi) RemoveProjectUserExecute(r admin.RemoveProjectUserApiRequest) (any, *http.Response, error) { ret := _m.Called(r) if len(ret) == 0 { panic("no return value specified for RemoveProjectUserExecute") } - var r0 *http.Response - var r1 error - if rf, ok := ret.Get(0).(func(admin.RemoveProjectUserApiRequest) (*http.Response, error)); ok { + var r0 any + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.RemoveProjectUserApiRequest) (any, *http.Response, error)); ok { return rf(r) } - if rf, ok := ret.Get(0).(func(admin.RemoveProjectUserApiRequest) *http.Response); ok { + if rf, ok := ret.Get(0).(func(admin.RemoveProjectUserApiRequest) any); ok { r0 = rf(r) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*http.Response) + r0 = ret.Get(0).(any) } } - if rf, ok := ret.Get(1).(func(admin.RemoveProjectUserApiRequest) error); ok { + if rf, ok := ret.Get(1).(func(admin.RemoveProjectUserApiRequest) *http.Response); ok { r1 = rf(r) } else { - r1 = ret.Error(1) + if ret.Get(1) != nil { + r1 = ret.Get(1).(*http.Response) + } + } + + if rf, ok := ret.Get(2).(func(admin.RemoveProjectUserApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) } - return r0, r1 + return r0, r1, r2 } // ProjectsApi_RemoveProjectUserExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveProjectUserExecute' @@ -2864,12 +2873,12 @@ func (_c *ProjectsApi_RemoveProjectUserExecute_Call) Run(run func(r admin.Remove return _c } -func (_c *ProjectsApi_RemoveProjectUserExecute_Call) Return(_a0 *http.Response, _a1 error) *ProjectsApi_RemoveProjectUserExecute_Call { - _c.Call.Return(_a0, _a1) +func (_c *ProjectsApi_RemoveProjectUserExecute_Call) Return(_a0 any, _a1 *http.Response, _a2 error) *ProjectsApi_RemoveProjectUserExecute_Call { + _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *ProjectsApi_RemoveProjectUserExecute_Call) RunAndReturn(run func(admin.RemoveProjectUserApiRequest) (*http.Response, error)) *ProjectsApi_RemoveProjectUserExecute_Call { +func (_c *ProjectsApi_RemoveProjectUserExecute_Call) RunAndReturn(run func(admin.RemoveProjectUserApiRequest) (any, *http.Response, error)) *ProjectsApi_RemoveProjectUserExecute_Call { _c.Call.Return(run) return _c } diff --git a/mockadmin/push_based_log_export_api.go b/mockadmin/push_based_log_export_api.go index 4982da9a6..d752b72a4 100644 --- a/mockadmin/push_based_log_export_api.go +++ b/mockadmin/push_based_log_export_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/resource_policies_api.go b/mockadmin/resource_policies_api.go index 1e3028d35..c0f01c298 100644 --- a/mockadmin/resource_policies_api.go +++ b/mockadmin/resource_policies_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/rolling_index_api.go b/mockadmin/rolling_index_api.go index 14255ac13..5076d6676 100644 --- a/mockadmin/rolling_index_api.go +++ b/mockadmin/rolling_index_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/root_api.go b/mockadmin/root_api.go index e09cdd0f7..9428ed577 100644 --- a/mockadmin/root_api.go +++ b/mockadmin/root_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/serverless_instances_api.go b/mockadmin/serverless_instances_api.go index 73735923b..73358896b 100644 --- a/mockadmin/serverless_instances_api.go +++ b/mockadmin/serverless_instances_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/serverless_private_endpoints_api.go b/mockadmin/serverless_private_endpoints_api.go index b0f963cd7..f96c0b0ef 100644 --- a/mockadmin/serverless_private_endpoints_api.go +++ b/mockadmin/serverless_private_endpoints_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/service_accounts_api.go b/mockadmin/service_accounts_api.go index d913e6ce8..da5ed6ba8 100644 --- a/mockadmin/service_accounts_api.go +++ b/mockadmin/service_accounts_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/shared_tier_restore_jobs_api.go b/mockadmin/shared_tier_restore_jobs_api.go index 5670ed04b..f461bff4f 100644 --- a/mockadmin/shared_tier_restore_jobs_api.go +++ b/mockadmin/shared_tier_restore_jobs_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/shared_tier_snapshots_api.go b/mockadmin/shared_tier_snapshots_api.go index c8d6a0388..5575cd234 100644 --- a/mockadmin/shared_tier_snapshots_api.go +++ b/mockadmin/shared_tier_snapshots_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/streams_api.go b/mockadmin/streams_api.go index fdf7f5162..c21f59599 100644 --- a/mockadmin/streams_api.go +++ b/mockadmin/streams_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" @@ -3576,6 +3576,170 @@ func (_c *StreamsApi_ListStreamProcessorsWithParams_Call) RunAndReturn(run func( return _c } +// ModifyStreamProcessor provides a mock function with given fields: ctx, groupId, tenantName, processorName, streamsModifyStreamProcessor +func (_m *StreamsApi) ModifyStreamProcessor(ctx context.Context, groupId string, tenantName string, processorName string, streamsModifyStreamProcessor *admin.StreamsModifyStreamProcessor) admin.ModifyStreamProcessorApiRequest { + ret := _m.Called(ctx, groupId, tenantName, processorName, streamsModifyStreamProcessor) + + if len(ret) == 0 { + panic("no return value specified for ModifyStreamProcessor") + } + + var r0 admin.ModifyStreamProcessorApiRequest + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *admin.StreamsModifyStreamProcessor) admin.ModifyStreamProcessorApiRequest); ok { + r0 = rf(ctx, groupId, tenantName, processorName, streamsModifyStreamProcessor) + } else { + r0 = ret.Get(0).(admin.ModifyStreamProcessorApiRequest) + } + + return r0 +} + +// StreamsApi_ModifyStreamProcessor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyStreamProcessor' +type StreamsApi_ModifyStreamProcessor_Call struct { + *mock.Call +} + +// ModifyStreamProcessor is a helper method to define mock.On call +// - ctx context.Context +// - groupId string +// - tenantName string +// - processorName string +// - streamsModifyStreamProcessor *admin.StreamsModifyStreamProcessor +func (_e *StreamsApi_Expecter) ModifyStreamProcessor(ctx any, groupId any, tenantName any, processorName any, streamsModifyStreamProcessor any) *StreamsApi_ModifyStreamProcessor_Call { + return &StreamsApi_ModifyStreamProcessor_Call{Call: _e.mock.On("ModifyStreamProcessor", ctx, groupId, tenantName, processorName, streamsModifyStreamProcessor)} +} + +func (_c *StreamsApi_ModifyStreamProcessor_Call) Run(run func(ctx context.Context, groupId string, tenantName string, processorName string, streamsModifyStreamProcessor *admin.StreamsModifyStreamProcessor)) *StreamsApi_ModifyStreamProcessor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(*admin.StreamsModifyStreamProcessor)) + }) + return _c +} + +func (_c *StreamsApi_ModifyStreamProcessor_Call) Return(_a0 admin.ModifyStreamProcessorApiRequest) *StreamsApi_ModifyStreamProcessor_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *StreamsApi_ModifyStreamProcessor_Call) RunAndReturn(run func(context.Context, string, string, string, *admin.StreamsModifyStreamProcessor) admin.ModifyStreamProcessorApiRequest) *StreamsApi_ModifyStreamProcessor_Call { + _c.Call.Return(run) + return _c +} + +// ModifyStreamProcessorExecute provides a mock function with given fields: r +func (_m *StreamsApi) ModifyStreamProcessorExecute(r admin.ModifyStreamProcessorApiRequest) (*admin.StreamsProcessorWithStats, *http.Response, error) { + ret := _m.Called(r) + + if len(ret) == 0 { + panic("no return value specified for ModifyStreamProcessorExecute") + } + + var r0 *admin.StreamsProcessorWithStats + var r1 *http.Response + var r2 error + if rf, ok := ret.Get(0).(func(admin.ModifyStreamProcessorApiRequest) (*admin.StreamsProcessorWithStats, *http.Response, error)); ok { + return rf(r) + } + if rf, ok := ret.Get(0).(func(admin.ModifyStreamProcessorApiRequest) *admin.StreamsProcessorWithStats); ok { + r0 = rf(r) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*admin.StreamsProcessorWithStats) + } + } + + if rf, ok := ret.Get(1).(func(admin.ModifyStreamProcessorApiRequest) *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.ModifyStreamProcessorApiRequest) error); ok { + r2 = rf(r) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// StreamsApi_ModifyStreamProcessorExecute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyStreamProcessorExecute' +type StreamsApi_ModifyStreamProcessorExecute_Call struct { + *mock.Call +} + +// ModifyStreamProcessorExecute is a helper method to define mock.On call +// - r admin.ModifyStreamProcessorApiRequest +func (_e *StreamsApi_Expecter) ModifyStreamProcessorExecute(r any) *StreamsApi_ModifyStreamProcessorExecute_Call { + return &StreamsApi_ModifyStreamProcessorExecute_Call{Call: _e.mock.On("ModifyStreamProcessorExecute", r)} +} + +func (_c *StreamsApi_ModifyStreamProcessorExecute_Call) Run(run func(r admin.ModifyStreamProcessorApiRequest)) *StreamsApi_ModifyStreamProcessorExecute_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(admin.ModifyStreamProcessorApiRequest)) + }) + return _c +} + +func (_c *StreamsApi_ModifyStreamProcessorExecute_Call) Return(_a0 *admin.StreamsProcessorWithStats, _a1 *http.Response, _a2 error) *StreamsApi_ModifyStreamProcessorExecute_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *StreamsApi_ModifyStreamProcessorExecute_Call) RunAndReturn(run func(admin.ModifyStreamProcessorApiRequest) (*admin.StreamsProcessorWithStats, *http.Response, error)) *StreamsApi_ModifyStreamProcessorExecute_Call { + _c.Call.Return(run) + return _c +} + +// ModifyStreamProcessorWithParams provides a mock function with given fields: ctx, args +func (_m *StreamsApi) ModifyStreamProcessorWithParams(ctx context.Context, args *admin.ModifyStreamProcessorApiParams) admin.ModifyStreamProcessorApiRequest { + ret := _m.Called(ctx, args) + + if len(ret) == 0 { + panic("no return value specified for ModifyStreamProcessorWithParams") + } + + var r0 admin.ModifyStreamProcessorApiRequest + if rf, ok := ret.Get(0).(func(context.Context, *admin.ModifyStreamProcessorApiParams) admin.ModifyStreamProcessorApiRequest); ok { + r0 = rf(ctx, args) + } else { + r0 = ret.Get(0).(admin.ModifyStreamProcessorApiRequest) + } + + return r0 +} + +// StreamsApi_ModifyStreamProcessorWithParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyStreamProcessorWithParams' +type StreamsApi_ModifyStreamProcessorWithParams_Call struct { + *mock.Call +} + +// ModifyStreamProcessorWithParams is a helper method to define mock.On call +// - ctx context.Context +// - args *admin.ModifyStreamProcessorApiParams +func (_e *StreamsApi_Expecter) ModifyStreamProcessorWithParams(ctx any, args any) *StreamsApi_ModifyStreamProcessorWithParams_Call { + return &StreamsApi_ModifyStreamProcessorWithParams_Call{Call: _e.mock.On("ModifyStreamProcessorWithParams", ctx, args)} +} + +func (_c *StreamsApi_ModifyStreamProcessorWithParams_Call) Run(run func(ctx context.Context, args *admin.ModifyStreamProcessorApiParams)) *StreamsApi_ModifyStreamProcessorWithParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*admin.ModifyStreamProcessorApiParams)) + }) + return _c +} + +func (_c *StreamsApi_ModifyStreamProcessorWithParams_Call) Return(_a0 admin.ModifyStreamProcessorApiRequest) *StreamsApi_ModifyStreamProcessorWithParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *StreamsApi_ModifyStreamProcessorWithParams_Call) RunAndReturn(run func(context.Context, *admin.ModifyStreamProcessorApiParams) admin.ModifyStreamProcessorApiRequest) *StreamsApi_ModifyStreamProcessorWithParams_Call { + _c.Call.Return(run) + return _c +} + // RejectVpcPeeringConnection provides a mock function with given fields: ctx, groupId, id func (_m *StreamsApi) RejectVpcPeeringConnection(ctx context.Context, groupId string, id string) admin.RejectVpcPeeringConnectionApiRequest { ret := _m.Called(ctx, groupId, id) diff --git a/mockadmin/teams_api.go b/mockadmin/teams_api.go index 688d984af..bb1052652 100644 --- a/mockadmin/teams_api.go +++ b/mockadmin/teams_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" @@ -1369,24 +1369,24 @@ func (_c *TeamsApi_ListTeamUsers_Call) RunAndReturn(run func(context.Context, st } // ListTeamUsersExecute provides a mock function with given fields: r -func (_m *TeamsApi) ListTeamUsersExecute(r admin.ListTeamUsersApiRequest) (*admin.PaginatedAppUser, *http.Response, error) { +func (_m *TeamsApi) ListTeamUsersExecute(r admin.ListTeamUsersApiRequest) (*admin.PaginatedOrgUser, *http.Response, error) { ret := _m.Called(r) if len(ret) == 0 { panic("no return value specified for ListTeamUsersExecute") } - var r0 *admin.PaginatedAppUser + var r0 *admin.PaginatedOrgUser var r1 *http.Response var r2 error - if rf, ok := ret.Get(0).(func(admin.ListTeamUsersApiRequest) (*admin.PaginatedAppUser, *http.Response, error)); ok { + if rf, ok := ret.Get(0).(func(admin.ListTeamUsersApiRequest) (*admin.PaginatedOrgUser, *http.Response, error)); ok { return rf(r) } - if rf, ok := ret.Get(0).(func(admin.ListTeamUsersApiRequest) *admin.PaginatedAppUser); ok { + if rf, ok := ret.Get(0).(func(admin.ListTeamUsersApiRequest) *admin.PaginatedOrgUser); ok { r0 = rf(r) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*admin.PaginatedAppUser) + r0 = ret.Get(0).(*admin.PaginatedOrgUser) } } @@ -1425,12 +1425,12 @@ func (_c *TeamsApi_ListTeamUsersExecute_Call) Run(run func(r admin.ListTeamUsers return _c } -func (_c *TeamsApi_ListTeamUsersExecute_Call) Return(_a0 *admin.PaginatedAppUser, _a1 *http.Response, _a2 error) *TeamsApi_ListTeamUsersExecute_Call { +func (_c *TeamsApi_ListTeamUsersExecute_Call) Return(_a0 *admin.PaginatedOrgUser, _a1 *http.Response, _a2 error) *TeamsApi_ListTeamUsersExecute_Call { _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *TeamsApi_ListTeamUsersExecute_Call) RunAndReturn(run func(admin.ListTeamUsersApiRequest) (*admin.PaginatedAppUser, *http.Response, error)) *TeamsApi_ListTeamUsersExecute_Call { +func (_c *TeamsApi_ListTeamUsersExecute_Call) RunAndReturn(run func(admin.ListTeamUsersApiRequest) (*admin.PaginatedOrgUser, *http.Response, error)) *TeamsApi_ListTeamUsersExecute_Call { _c.Call.Return(run) return _c } diff --git a/mockadmin/third_party_integrations_api.go b/mockadmin/third_party_integrations_api.go index 6d4bd6673..3ee1dfa76 100644 --- a/mockadmin/third_party_integrations_api.go +++ b/mockadmin/third_party_integrations_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/mockadmin/x509_authentication_api.go b/mockadmin/x509_authentication_api.go index 31b58bab7..ed79d3147 100644 --- a/mockadmin/x509_authentication_api.go +++ b/mockadmin/x509_authentication_api.go @@ -5,7 +5,7 @@ package mockadmin import ( context "context" - admin "go.mongodb.org/atlas-sdk/v20241113001/admin" + admin "github.com/mongodb/atlas-sdk-go/admin" http "net/http" diff --git a/openapi/atlas-api-transformed.yaml b/openapi/atlas-api-transformed.yaml index 38fb08fd9..513889e85 100644 --- a/openapi/atlas-api-transformed.yaml +++ b/openapi/atlas-api-transformed.yaml @@ -12,7 +12,7 @@ info: curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" \ --digest \ - --header "Accept: application/vnd.atlas.2024-11-13+json" \ + --header "Accept: application/vnd.atlas.2025-01-01+json" \ -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dbAccessHistory/clusters/{clusterName}?pretty=true" ``` @@ -27,7 +27,7 @@ info: termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions title: MongoDB Atlas Administration API version: "2.0" - x-xgen-sha: b4af03887e4a47b0e7a2b40cb24ecb8a926f9512 + x-xgen-sha: 578f6ecdecd6c37af4c1b2c2084d83f79b4435d6 servers: - url: https://cloud.mongodb.com security: @@ -5426,6 +5426,175 @@ paths: summary: Start an Outage Simulation tags: - Cluster Outage Simulation + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/dropIndexSuggestions": + get: + description: Returns the indexes that the Performance Advisor suggests to drop. + The Performance Advisor suggests dropping unused, redundant, and hidden + indexes to improve write performance and increase storage space. To use + this resource, the requesting API Key must have the Project Read Only + role. + operationId: listDropIndexes + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: ^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$ + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PerformanceAdvisorResponse" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Returns Suggested Indexes to Drop + tags: + - Performance Advisor + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice": + get: + description: Returns the schema suggestions that the Performance Advisor + detects. The Performance Advisor provides holistic schema + recommendations for your cluster by sampling documents in your most + active collections and collections with slow-running queries. To use + this resource, the requesting API Key must have the Project Read Only + role. + operationId: listSchemaAdvice + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: ^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$ + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PerformanceAdvisorResponse" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Schema Advice + tags: + - Performance Advisor + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/suggestedIndexes": + get: + description: Returns the indexes that the Performance Advisor suggests. The + Performance Advisor monitors queries that MongoDB considers slow and + suggests new indexes to improve query performance. To use this resource, + the requesting API Key must have the Project Read Only role. + operationId: listClusterSuggestedIndexes + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: ^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$ + - description: ProcessIds from which to retrieve suggested indexes. A processId is + a combination of host and port that serves the MongoDB process. The + host must be the hostname, FQDN, IPv4 address, or IPv6 address of + the host that runs the MongoDB process (`mongod` or `mongos`). The + port must be the IANA port on which the MongoDB process listens for + requests. To include multiple processIds, pass the parameter + multiple times delimited with an ampersand (`&`) between each + processId. + in: query + name: processIds + schema: + type: array + items: + type: string + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + style: form + - description: "Namespaces from which to retrieve suggested indexes. A namespace + consists of one database and one collection resource written as `.`: + `.`. To include multiple namespaces, pass the + parameter multiple times delimited with an ampersand (`&`) between + each namespace. Omit this parameter to return results for all + namespaces." + in: query + name: namespaces + schema: + type: array + items: + type: string + style: form + - description: >- + Date and time from which the query retrieves the suggested indexes. + This parameter expresses its value in the number of milliseconds + that have elapsed since the [UNIX + epoch](https://en.wikipedia.org/wiki/Unix_time). + + + - If you don't specify the **until** parameter, the endpoint returns data covering from the **since** value and the current time. + + - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: since + schema: + type: integer + format: int64 + minimum: 1199145600000 + - description: >- + Date and time up until which the query retrieves the suggested + indexes. This parameter expresses its value in the number of + milliseconds that have elapsed since the [UNIX + epoch](https://en.wikipedia.org/wiki/Unix_time). + + + - If you specify the **until** parameter, you must specify the **since** parameter. + + - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: until + schema: + type: integer + format: int64 + minimum: 1199145600000 + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PerformanceAdvisorResponse" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Suggested Indexes + tags: + - Performance Advisor "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs": get: description: "Returns the advanced configuration details for one cluster in the @@ -8788,9 +8957,10 @@ paths: "/api/atlas/v2/groups/{groupId}/events": get: description: >- - Returns one event for the specified project. Events identify significant - database, billing, or security activities or status changes. To use this - resource, the requesting API Key must have the Project Read Only role. + Returns all events for the specified project. Events identify + significant database, billing, or security activities or status changes. + To use this resource, the requesting API Key must have the Project Read + Only role. This resource remains under revision and may change. @@ -14974,6 +15144,53 @@ paths: summary: Get One Stream Processor tags: - Streams + patch: + description: Modify one existing Stream Processor within the specified stream + instance. To use this resource, the requesting API Key must have the + Project Owner role or Project Stream Processing Owner role. + operationId: modifyStreamProcessor + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream processor. + in: path + name: processorName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsModifyStreamProcessor" + description: Modifications to apply to the stream processor. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsProcessorWithStats" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Modify One Stream Processor + tags: + - Streams "/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:start": post: description: Start a Stream Processor within the specified stream instance. To @@ -15512,8 +15729,9 @@ paths: - Projects "/api/atlas/v2/groups/{groupId}/users/{userId}": delete: - description: Removes the specified user from the specified project. To use this + description: "Removes the specified user from the specified project. To use this resource, the requesting API Key must have the Project Owner role. + Deprecated versions: v2-{2023-01-01}" operationId: removeProjectUser parameters: - $ref: "#/components/parameters/groupId" @@ -15532,8 +15750,10 @@ paths: responses: "204": content: - application/vnd.atlas.2023-01-01+json: - x-xgen-version: 2023-01-01 + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/NoBody" + x-xgen-version: 2025-01-01 description: This endpoint does not return a response body. "400": $ref: "#/components/responses/badRequest" @@ -15546,6 +15766,53 @@ paths: summary: Remove One User from One Project tags: - Projects + get: + description: >- + Returns information about the specified MongoDB Cloud user within the + context of the specified project. To use this resource, the requesting + API Key must have the Group Read Only role. + + + **Note**: You can only use this resource to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + + + **Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: getProjectUser + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the pending or + active user in the project. If you need to lookup a user's userId or + verify a user's status in the organization, use the Return All + MongoDB Cloud Users in One Project resource and filter by username. + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/GroupUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One MongoDB Cloud User in One Project + tags: + - MongoDB Cloud Users "/api/atlas/v2/groups/{groupId}/users/{userId}/roles": put: description: Updates the roles of the specified user in the specified project. @@ -15591,6 +15858,61 @@ paths: summary: Update Project Roles for One MongoDB Cloud User tags: - Projects + "/api/atlas/v2/groups/{groupId}/users/{userId}:addRole": + post: + description: >- + Adds one project-level role to the MongoDB Cloud user. You can add a + role to an active user or a user that has been invited to join the + project. To use this resource, the requesting API Key must have the + Project Owner role. + + + **Note**: This resource cannot be used to add a role to users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: addProjectRole + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the pending or + active user in the project. If you need to lookup a user's userId or + verify a user's status in the organization, use the Return All + MongoDB Cloud Users in One Project resource and filter by username. + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveGroupRole" + description: Project-level role to assign to the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One Project Role to One MongoDB Cloud User + tags: + - MongoDB Cloud Users "/api/atlas/v2/groups/{groupId}:migrate": post: description: Migrates a project from its current organization to another @@ -17987,11 +18309,11 @@ paths: - Teams "/api/atlas/v2/orgs/{orgId}/teams/{teamId}/users": get: - description: Returns all MongoDB Cloud users assigned to the team specified + description: "Returns all MongoDB Cloud users assigned to the team specified using its unique 24-hexadecimal digit identifier. This team belongs to one organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting API Key must - have the Organization Member role. + have the Organization Member role. Deprecated versions: v2-{2023-01-01}" externalDocs: description: Manage Organization Teams url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams @@ -18013,10 +18335,10 @@ paths: responses: "200": content: - application/vnd.atlas.2023-01-01+json: + application/vnd.atlas.2025-01-01+json: schema: - $ref: "#/components/schemas/PaginatedAppUser" - x-xgen-version: 2023-01-01 + $ref: "#/components/schemas/PaginatedOrgUser" + x-xgen-version: 2025-01-01 description: OK "400": $ref: "#/components/responses/badRequest" @@ -18133,13 +18455,117 @@ paths: summary: Remove One MongoDB Cloud User from One Team tags: - Teams + "/api/atlas/v2/orgs/{orgId}/teams/{teamId}:addUser": + post: + description: >- + Adds one MongoDB Cloud user to one team. You can add an active user or a + user that has not yet accepted the invitation to join the organization. + To use this resource, the requesting API Key must have the Organization + Owner role. + + + **Note**: This resource cannot be used to add a user invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: addUserToTeam + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the team to add + the MongoDB Cloud user to. + in: path + name: teamId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveUserFromTeam" + description: The active or pending MongoDB Cloud user that you want to add to + the specified team. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One MongoDB Cloud User to One Team + tags: + - MongoDB Cloud Users + "/api/atlas/v2/orgs/{orgId}/teams/{teamId}:removeUser": + post: + description: >- + Removes one MongoDB Cloud user from one team. You can remove an active + user or a user that has not yet accepted the invitation to join the + organization. To use this resource, the requesting API Key must have the + Organization Owner role. + + + **Note**: This resource cannot be used to remove a user invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: removeUserFromTeam + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the team to + remove the MongoDB user from. + in: path + name: teamId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveUserFromTeam" + description: The id of the active or pending MongoDB Cloud user that you want to + remove from the specified team. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One MongoDB Cloud User from One Team + tags: + - MongoDB Cloud Users "/api/atlas/v2/orgs/{orgId}/users": get: - description: Returns details about the MongoDB Cloud users associated with the + description: "Returns details about the MongoDB Cloud users associated with the specified organization. Each MongoDB Cloud user returned must belong to the specified organization or to a project within the specified organization. To use this resource, the requesting API Key must have the - Organization Member role. + Organization Member role. Deprecated versions: v2-{2023-01-01}" operationId: listOrganizationUsers parameters: - $ref: "#/components/parameters/orgId" @@ -18149,10 +18575,10 @@ paths: responses: "200": content: - application/vnd.atlas.2023-01-01+json: + application/vnd.atlas.2025-01-01+json: schema: - $ref: "#/components/schemas/PaginatedAppUser" - x-xgen-version: 2023-01-01 + $ref: "#/components/schemas/PaginatedOrgUser" + x-xgen-version: 2025-01-01 description: OK "400": $ref: "#/components/responses/badRequest" @@ -18165,11 +18591,54 @@ paths: summary: Return All MongoDB Cloud Users in One Organization tags: - Organizations + post: + description: >- + Invites one new or existing MongoDB Cloud user to join the organization. + The invitation to join the organization will be sent to the username + provided and must be accepted within 30 days. To use this resource, the + requesting API Key must have the Organization Owner role. + + + **Note**: If the user does not have an existing MongoDB Cloud account, they will be prompted to finish setting up an account upon accepting the invitation. If the user already has an account, they will still receive an invitation to access the organization. + operationId: createOrganizationUser + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserRequest" + description: Represents the MongoDB Cloud user to be created within the + organization. + required: true + responses: + "201": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One MongoDB Cloud User in One Organization + tags: + - MongoDB Cloud Users "/api/atlas/v2/orgs/{orgId}/users/{userId}": delete: - description: Removes one MongoDB Cloud user from the specified organization. To + description: "Removes one MongoDB Cloud user from the specified organization. To use this resource, the requesting API Key must have the Organization - User Admin role. + User Admin role. Deprecated versions: v2-{2023-01-01}" operationId: removeOrganizationUser parameters: - $ref: "#/components/parameters/orgId" @@ -18186,10 +18655,10 @@ paths: responses: "204": content: - application/vnd.atlas.2023-01-01+json: + application/vnd.atlas.2025-01-01+json: schema: $ref: "#/components/schemas/NoBody" - x-xgen-version: 2023-01-01 + x-xgen-version: 2025-01-01 description: This endpoint does not return a response body. "400": $ref: "#/components/responses/badRequest" @@ -18204,6 +18673,110 @@ paths: summary: Remove One MongoDB Cloud User From One Organization tags: - Organizations + get: + description: >- + Returns information about the specified MongoDB Cloud user within the + context of the specified organization. To use this resource, the + requesting API Key must have the Organization Read Only role. + + + **Note**: This resource can only be used to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + + + **Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: getOrganizationUser + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the pending or + active user in the organization. If you need to lookup a user's + userId or verify a user's status in the organization, use the Return + All MongoDB Cloud Users in One Organization resource and filter by + username. + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One MongoDB Cloud User in One Organization + tags: + - MongoDB Cloud Users + patch: + description: >- + Updates one MongoDB Cloud user in the specified organization. You can + update an active user or a user that has not yet accepted the invitation + to join the organization. To use this resource, the requesting API Key + must have the Organization Owner role. + + + **Note**: Only include the fields you wish to update in the request body. Supplying a field with an empty value will reset that field on the user. + + + **Note**: This resource cannot be used to update pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: updateOrganizationUser + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the pending or + active user in the organization. If you need to lookup a user's + userId or verify a user's status in the organization, use the Return + All MongoDB Cloud Users in One Organization resource and filter by + username. + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserUpdateRequest" + description: Represents the roles and teams to assign the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One MongoDB Cloud User in One Organization + tags: + - MongoDB Cloud Users "/api/atlas/v2/orgs/{orgId}/users/{userId}/roles": put: description: Updates the roles of the specified user in the specified @@ -18250,6 +18823,124 @@ paths: summary: Update Organization Roles for One MongoDB Cloud User tags: - Organizations + "/api/atlas/v2/orgs/{orgId}/users/{userId}:addRole": + post: + description: >- + Adds one organization-level role to the MongoDB Cloud user. You can add + a role to an active user or a user that has not yet accepted the + invitation to join the organization. To use this resource, the + requesting API Key must have the Organization Owner role. + + + **Note**: This operation is atomic. + + + **Note**: This resource cannot be used to add a role to users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: addOrganizationRole + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the pending or + active user in the organization. If you need to lookup a user's + userId or verify a user's status in the organization, use the Return + All MongoDB Cloud Users in One Organization resource and filter by + username. + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveOrgRole" + description: Organization-level role to assign to the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One Organization Role to One MongoDB Cloud User + tags: + - MongoDB Cloud Users + "/api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole": + post: + description: >- + Removes one organization-level role from the MongoDB Cloud user. You can + remove a role from an active user or a user that has not yet accepted + the invitation to join the organization. To replace a user's only role, + add the new role before removing the old role. A user must have at least + one role at all times. To use this resource, the requesting API Key must + have the Organization Owner role. + + + **Note**: This operation is atomic. + + + **Note**: This resource cannot be used to remove a role from users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: removeOrganizationRole + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the pending or + active user in the organization. If you need to lookup a user's + userId or verify a user's status in the organization, use the Return + All MongoDB Cloud Users in One Organization resource and filter by + username. + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveOrgRole" + description: Organization-level role to remove from the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Organization Role from One MongoDB Cloud User + tags: + - MongoDB Cloud Users /api/atlas/v2/unauth/controlPlaneIPAddresses: get: description: Returns all control plane IP addresses. @@ -18269,6 +18960,38 @@ paths: summary: Return All Control Plane IP Addresses tags: - Root + /api/atlas/v2/unauth/openapi/versions: + get: + description: API that provides a list of available versionsfor a given environment. + operationId: getApiVersions + parameters: + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: The environment to get the versions from. If not provided, it + returnsthe versions for the given MongoDB URL. (E.g. prod for + cloud.mongodb.com) + in: query + name: env + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedApiVersions" + x-xgen-version: 2024-08-05 + application/vnd.atlas.2024-08-05+yaml: + schema: + $ref: "#/components/schemas/PaginatedApiVersions" + x-xgen-version: 2024-08-05 + description: OK + "500": + $ref: "#/components/responses/internalServerError" + security: [] + summary: Provides a list of versions for a given environment. + tags: + - OpenAPI /api/atlas/v2/users: post: description: >- @@ -18822,6 +19545,36 @@ components: alert. By default this value is set to false. If set to true, it will override the acknowledgedUntil parameter. title: Acknowledge Alert + AddOrRemoveGroupRole: + type: object + properties: + groupRole: + type: string + description: Project-level role. + required: + - groupRole + AddOrRemoveOrgRole: + type: object + properties: + orgRole: + type: string + description: Organization-level role. + required: + - orgRole + AddOrRemoveUserFromTeam: + type: object + properties: + id: + type: string + description: Unique 24-hexadecimal digit string that identifies the MongoDB + Cloud user. + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + writeOnly: true + required: + - id AddUserToTeam: type: object properties: @@ -19756,6 +20509,12 @@ components: type: string description: Specify the sort order (ascending / descending) used to specify how to sort query results. Defaults to descending. + ApiVersion: + type: object + properties: + version: + type: string + description: Object representing a version of the Atlas Admin API. AtlasClusterOutageSimulationOutageFilter: type: object properties: @@ -20982,10 +21741,7 @@ components: description: Name of the region to which the data lake routes client connections. BaseCloudProviderInstanceSize: type: string - description: 'Minimum instance size to which your cluster can automatically - scale. MongoDB Cloud requires this parameter if - `"replicationSpecs[n].regionConfigs[m].autoScaling.compute.scaleDownEnabled" - : true`.' + description: Instance size boundary to which your cluster can automatically scale. BaseNetworkPeeringConnectionSettings: type: object properties: @@ -23011,12 +23767,14 @@ components: url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ featureCompatibilityVersion: type: string - description: Feature compatibility version of the cluster. + description: Feature compatibility version of the cluster. This will always + appear regardless of whether FCV is pinned. readOnly: true featureCompatibilityVersionExpirationDate: type: string format: date-time - description: Feature compatibility version expiration date. + description: Feature compatibility version expiration date. Will only appear if + FCV is pinned. readOnly: true globalClusterSelfManagedSharding: type: boolean @@ -23079,10 +23837,11 @@ components: mongoDBMajorVersion: type: string description: >- - MongoDB major version of the cluster. + MongoDB major version of the cluster. Set to the binary major + version. - On creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLTSVersions). + On creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLtsVersions). On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version. externalDocs: @@ -24136,6 +24895,11 @@ components: maxLength: 24 minLength: 24 pattern: ^([a-f0-9]{24})$ + skipDefaultAlertsSettings: + type: boolean + default: false + description: Disables automatic alert creation. When set to true, no + organization level alerts will be created automatically. required: - name CreateOrganizationResponse: @@ -25409,6 +26173,8 @@ components: type: string description: State of the Export Job. readOnly: true + stateReason: + $ref: "#/components/schemas/StateReason" required: - exportBucketId DiskBackupExportJobRequest: @@ -26303,10 +27069,6 @@ components: oplog size can limit storage auto-scaling. Document: type: object - description: The stats associated with the stream processor. - externalDocs: - url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/manage-stream-processor/#view-statistics-of-a-stream-processor - readOnly: true EARPrivateEndpoint: type: object description: Encryption At Rest Private Endpoint. @@ -26644,6 +27406,14 @@ components: : "DATA_EXPLORER"`.' example: insertDocument readOnly: true + deskLocation: + type: string + description: Desk location of MongoDB employee associated with the event. + readOnly: true + employeeIdentifier: + type: string + description: Identifier of MongoDB employee associated with the event. + readOnly: true port: type: integer format: int32 @@ -28405,6 +29175,8 @@ components: description: Number of times the current maintenance event for this project has been deferred. readOnly: true + protectedHours: + $ref: "#/components/schemas/ProtectedHours" startASAP: type: boolean description: Flag that indicates whether MongoDB Cloud starts the maintenance @@ -28413,6 +29185,11 @@ components: have maintenance scheduled and you must set a maintenance window. This flag resets to `false` after MongoDB Cloud completes maintenance. + timeZoneId: + type: string + description: Identifier for the current time zone of the maintenance window. + This can only be updated via the Project Settings UI. + readOnly: true required: - dayOfWeek GroupMigrationRequest: @@ -28484,6 +29261,24 @@ components: * GROUP_STREAM_PROCESSING_OWNER + GroupRoleAssignment: + type: object + properties: + groupId: + type: string + description: Unique 24-hexadecimal digit string that identifies the project to + which these roles belong. + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + groupRoles: + type: array + description: One or more project-level roles assigned to the MongoDB Cloud user. + items: + type: string + description: Project-level role. + uniqueItems: true GroupService: type: object description: List of IP addresses in a project categorized by services. @@ -28638,6 +29433,96 @@ components: url: https://www.mongodb.com/docs/atlas/tags items: $ref: "#/components/schemas/ResourceTag" + GroupUserResponse: + type: object + properties: + id: + type: string + description: Unique 24-hexadecimal digit string that identifies the MongoDB + Cloud user. + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + readOnly: true + orgMembershipStatus: + type: string + description: String enum that indicates whether the MongoDB Cloud user has a + pending invitation to join the organization or they are already + active in the organization. + readOnly: true + roles: + type: array + description: One or more project-level roles assigned to the MongoDB Cloud user. + items: + type: string + description: Project-level role. + readOnly: true + uniqueItems: true + username: + type: string + format: email + description: Email address that represents the username of the MongoDB Cloud user. + readOnly: true + invitationCreatedAt: + type: string + format: date-time + description: Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud + represents this timestamp in ISO 8601 format in UTC. + readOnly: true + invitationExpiresAt: + type: string + format: date-time + description: Date and time when the invitation from MongoDB Cloud expires. + MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + readOnly: true + inviterUsername: + type: string + format: email + description: Username of the MongoDB Cloud user who sent the invitation to join + the organization. + readOnly: true + country: + type: string + description: Two-character alphabetical string that identifies the MongoDB Cloud + user's geographic location. This parameter uses the ISO 3166-1a2 + code format. + example: US + pattern: ^([A-Z]{2})$ + readOnly: true + createdAt: + type: string + format: date-time + description: Date and time when MongoDB Cloud created the current account. This + value is in the ISO 8601 timestamp format in UTC. + readOnly: true + firstName: + type: string + description: First or given name that belongs to the MongoDB Cloud user. + example: John + readOnly: true + lastAuth: + type: string + format: date-time + description: Date and time when the current account last authenticated. This + value is in the ISO 8601 timestamp format in UTC. + readOnly: true + lastName: + type: string + description: Last name, family name, or surname that belongs to the MongoDB + Cloud user. + example: Doe + readOnly: true + mobileNumber: + type: string + description: Mobile phone number that belongs to the MongoDB Cloud user. + pattern: (?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})$ + readOnly: true + required: + - id + - orgMembershipStatus + - roles + - username HardwareSpec20240805: type: object description: Hardware specifications for all electable nodes deployed in the @@ -31225,38 +32110,219 @@ components: 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. + 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. + OrgUserRequest: + type: object + properties: + roles: + $ref: "#/components/schemas/OrgUserRolesRequest" + teamIds: + type: array + description: List of unique 24-hexadecimal digit strings that identifies the + teams to which this MongoDB Cloud user belongs. + items: + type: string + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + uniqueItems: true + writeOnly: true + username: + type: string + format: email + description: Email address that represents the username of the MongoDB Cloud user. + writeOnly: true required: - - description - - name - roles - - secretExpiresAfterHours - OrgServiceAccountUpdateRequest: + - username + OrgUserResponse: type: object properties: - description: + id: type: string - description: Human readable description for the Service Account. - maxLength: 250 - minLength: 1 - pattern: ^[\p{L}\p{N}\-_.,' ]*$ - name: + description: Unique 24-hexadecimal digit string that identifies the MongoDB + Cloud user. + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + readOnly: true + orgMembershipStatus: 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}\-_.,' ]*$ + description: String enum that indicates whether the MongoDB Cloud user has a + pending invitation to join the organization or they are already + active in the organization. + readOnly: true roles: + $ref: "#/components/schemas/OrgUserRolesResponse" + teamIds: type: array - description: A list of organization-level roles for the Service Account. + description: List of unique 24-hexadecimal digit strings that identifies the + teams to which this MongoDB Cloud user belongs. items: type: string - description: Organization roles available for Service Accounts. + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + readOnly: true + uniqueItems: true + username: + type: string + format: email + description: Email address that represents the username of the MongoDB Cloud user. + readOnly: true + invitationCreatedAt: + type: string + format: date-time + description: Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud + represents this timestamp in ISO 8601 format in UTC. + readOnly: true + invitationExpiresAt: + type: string + format: date-time + description: Date and time when the invitation from MongoDB Cloud expires. + MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + readOnly: true + inviterUsername: + type: string + format: email + description: Username of the MongoDB Cloud user who sent the invitation to join + the organization. + readOnly: true + country: + type: string + description: Two-character alphabetical string that identifies the MongoDB Cloud + user's geographic location. This parameter uses the ISO 3166-1a2 + code format. + example: US + pattern: ^([A-Z]{2})$ + readOnly: true + createdAt: + type: string + format: date-time + description: Date and time when MongoDB Cloud created the current account. This + value is in the ISO 8601 timestamp format in UTC. + readOnly: true + firstName: + type: string + description: First or given name that belongs to the MongoDB Cloud user. + example: John + readOnly: true + lastAuth: + type: string + format: date-time + description: Date and time when the current account last authenticated. This + value is in the ISO 8601 timestamp format in UTC. + readOnly: true + lastName: + type: string + description: Last name, family name, or surname that belongs to the MongoDB + Cloud user. + example: Doe + readOnly: true + mobileNumber: + type: string + description: Mobile phone number that belongs to the MongoDB Cloud user. + pattern: (?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})$ + readOnly: true + required: + - id + - orgMembershipStatus + - roles + - username + OrgUserRolesRequest: + type: object + description: Organization and project level roles to assign the MongoDB Cloud + user within one organization. + properties: + groupRoleAssignments: + type: array + description: List of project level role assignments to assign the MongoDB Cloud + user. + items: + $ref: "#/components/schemas/GroupRoleAssignment" + orgRoles: + type: array + description: One or more organization level roles to assign the MongoDB Cloud + user. + items: + type: string + description: Organization-level role. + minItems: 1 + uniqueItems: true + required: + - orgRoles + writeOnly: true + OrgUserRolesResponse: + type: object + description: Organization- and project-level roles assigned to one MongoDB Cloud + user within one organization. + properties: + groupRoleAssignments: + type: array + description: List of project-level role assignments assigned to the MongoDB + Cloud user. + items: + $ref: "#/components/schemas/GroupRoleAssignment" + orgRoles: + type: array + description: One or more organization-level roles assigned to the MongoDB Cloud + user. + items: + type: string + description: Organization-level role. + uniqueItems: true + readOnly: true + OrgUserUpdateRequest: + type: object + properties: + roles: + $ref: "#/components/schemas/OrgUserRolesRequest" + teamIds: + type: array + description: List of unique 24-hexadecimal digit strings that identifies the + teams to assign the MongoDB Cloud user. + items: + type: string + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + uniqueItems: true + writeOnly: true OrganizationInvitation: type: object properties: @@ -31534,6 +32600,34 @@ components: readOnly: true readOnly: true title: Outbound Control Plane IP Addresses By Cloud Provider + PaginatedApiVersions: + 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/ApiVersion" + 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 PaginatedClusterDescription20240805: type: object properties: @@ -32143,6 +33237,24 @@ components: with this private endpoint. required: - endpointId + ProtectedHours: + type: object + description: Defines the a window where maintenance will not begin within. + properties: + endHourOfDay: + type: integer + format: int32 + description: Zero-based integer that represents the end hour of the of the day + that the maintenance will not begin in. + maximum: 23 + minimum: 0 + startHourOfDay: + type: integer + format: int32 + description: Zero-based integer that represents the beginning hour of the of the + day that the maintenance will not begin in. + maximum: 23 + minimum: 0 PushBasedLogExportProject: type: object properties: @@ -33421,6 +34533,17 @@ components: - groupId - managedAuthentication - ssl + StateReason: + type: object + description: State reason of the Job. This is set when the job state is "Failed". + properties: + errorCode: + type: string + description: Error code relating to state. + message: + type: string + description: Message describing error or state. + readOnly: true StreamConfig: type: object description: Configuration options for an Atlas Stream Processing Instance. @@ -33499,10 +34622,6 @@ components: $ref: "#/components/schemas/StreamsKafkaNetworking" security: $ref: "#/components/schemas/StreamsKafkaSecurity" - connectionTimeoutSec: - type: integer - format: int32 - description: The amount of seconds to wait before timing out a connection. headers: type: object additionalProperties: @@ -33511,10 +34630,6 @@ components: request. description: A map of key-value pairs that will be passed as headers for the request. - requestTimeoutSec: - type: integer - format: int32 - description: The amount of seconds to wait before timing out a request. url: type: string description: The url to be used for the request. @@ -33702,6 +34817,55 @@ components: for alert configurations. example: INSTANCE_NAME title: Streams Matcher Fields + StreamsModifyStreamProcessor: + type: object + description: A request to modify an existing stream processor + 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 + name: + type: string + description: New name for the stream processor. + options: + $ref: "#/components/schemas/StreamsModifyStreamProcessorOptions" + pipeline: + type: array + description: New pipeline for the stream processor. + externalDocs: + description: Supported Aggregation Pipeline Stages + url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/stream-aggregation/#std-label-stream-aggregation + items: + $ref: "#/components/schemas/Document" + StreamsModifyStreamProcessorOptions: + type: object + description: Additional options for modifying a stream processor. + properties: + dlq: + $ref: "#/components/schemas/StreamsDLQ" + 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 + resumeFromCheckpoint: + type: boolean + description: When true, the modified stream processor resumes from its last + checkpoint. StreamsOptions: type: object description: Optional configuration for the stream processor. @@ -34041,11 +35205,10 @@ components: items: type: string format: email - description: List that contains email addresses that identify MongoDB Cloud - users to in this team. uniqueItems: true required: - name + - usernames TeamResponse: type: object properties: @@ -36973,6 +38136,34 @@ components: if `includeCount` is set to `false`. minimum: 0 readOnly: true + PaginatedOrgUser: + 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/OrgUserResponse" + 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 PaginatedOrganization: type: object properties: diff --git a/openapi/atlas-api.yaml b/openapi/atlas-api.yaml index dd156c791..4a1c91d98 100644 --- a/openapi/atlas-api.yaml +++ b/openapi/atlas-api.yaml @@ -8,7 +8,7 @@ info: ``` curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" \ --digest \ - --header "Accept: application/vnd.atlas.2024-11-13+json" \ + --header "Accept: application/vnd.atlas.2025-01-01+json" \ -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dbAccessHistory/clusters/{clusterName}?pretty=true" ``` @@ -21,7 +21,7 @@ info: termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions title: MongoDB Atlas Administration API version: "2.0" - x-xgen-sha: b4af03887e4a47b0e7a2b40cb24ecb8a926f9512 + x-xgen-sha: 578f6ecdecd6c37af4c1b2c2084d83f79b4435d6 servers: - url: https://cloud.mongodb.com security: @@ -5516,6 +5516,162 @@ paths: summary: Start an Outage Simulation tags: - Cluster Outage Simulation + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/dropIndexSuggestions: + get: + description: "Returns the indexes that the Performance Advisor suggests to drop.\ + \ The Performance Advisor suggests dropping unused, redundant, and hidden\ + \ indexes to improve write performance and increase storage space. To use\ + \ this resource, the requesting API Key must have the Project Read Only role." + operationId: listDropIndexes + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: "^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PerformanceAdvisorResponse" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Returns Suggested Indexes to Drop + tags: + - Performance Advisor + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice: + get: + description: "Returns the schema suggestions that the Performance Advisor detects.\ + \ The Performance Advisor provides holistic schema recommendations for your\ + \ cluster by sampling documents in your most active collections and collections\ + \ with slow-running queries. To use this resource, the requesting API Key\ + \ must have the Project Read Only role." + operationId: listSchemaAdvice + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: "^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PerformanceAdvisorResponse" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Schema Advice + tags: + - Performance Advisor + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/suggestedIndexes: + get: + description: "Returns the indexes that the Performance Advisor suggests. The\ + \ Performance Advisor monitors queries that MongoDB considers slow and suggests\ + \ new indexes to improve query performance. To use this resource, the requesting\ + \ API Key must have the Project Read Only role." + operationId: listClusterSuggestedIndexes + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: "^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$" + - description: "ProcessIds from which to retrieve suggested indexes. A processId\ + \ is a combination of host and port that serves the MongoDB process. The\ + \ host must be the hostname, FQDN, IPv4 address, or IPv6 address of the\ + \ host that runs the MongoDB process (`mongod` or `mongos`). The port must\ + \ be the IANA port on which the MongoDB process listens for requests. To\ + \ include multiple processIds, pass the parameter multiple times delimited\ + \ with an ampersand (`&`) between each processId." + in: query + name: processIds + schema: + type: array + items: + type: string + pattern: "^([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\\\ + .){1,10}[a-z]+)?(\\:[0-9]{4,5})$" + style: form + - description: "Namespaces from which to retrieve suggested indexes. A namespace\ + \ consists of one database and one collection resource written as `.`: `.`.\ + \ To include multiple namespaces, pass the parameter multiple times delimited\ + \ with an ampersand (`&`) between each namespace. Omit this parameter to\ + \ return results for all namespaces." + in: query + name: namespaces + schema: + type: array + items: + type: string + style: form + - description: |- + Date and time from which the query retrieves the suggested indexes. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). + + - If you don't specify the **until** parameter, the endpoint returns data covering from the **since** value and the current time. + - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: since + schema: + type: integer + format: int64 + minimum: 1199145600000 + - description: |- + Date and time up until which the query retrieves the suggested indexes. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). + + - If you specify the **until** parameter, you must specify the **since** parameter. + - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: until + schema: + type: integer + format: int64 + minimum: 1199145600000 + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PerformanceAdvisorResponse" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Suggested Indexes + tags: + - Performance Advisor /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs: get: description: "Returns the advanced configuration details for one cluster in\ @@ -8966,7 +9122,7 @@ paths: /api/atlas/v2/groups/{groupId}/events: get: description: |- - Returns one event for the specified project. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting API Key must have the Project Read Only role. + Returns all events for the specified project. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting API Key must have the Project Read Only role. This resource remains under revision and may change. operationId: listProjectEvents @@ -15668,6 +15824,55 @@ paths: summary: Get One Stream Processor tags: - Streams + patch: + description: "Modify one existing Stream Processor within the specified stream\ + \ instance. To use this resource, the requesting API Key must have the Project\ + \ Owner role or Project Stream Processing Owner role." + operationId: modifyStreamProcessor + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/pretty" + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream processor. + in: path + name: processorName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsModifyStreamProcessor" + description: Modifications to apply to the stream processor. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsProcessorWithStats" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Modify One Stream Processor + tags: + - Streams /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:start: post: description: "Start a Stream Processor within the specified stream instance.\ @@ -16229,7 +16434,8 @@ paths: /api/atlas/v2/groups/{groupId}/users/{userId}: delete: description: "Removes the specified user from the specified project. To use\ - \ this resource, the requesting API Key must have the Project Owner role." + \ this resource, the requesting API Key must have the Project Owner role.\ + \ Deprecated versions: v2-{2023-01-01}" operationId: removeProjectUser parameters: - $ref: "#/components/parameters/envelope" @@ -16250,8 +16456,10 @@ paths: responses: "204": content: - application/vnd.atlas.2023-01-01+json: - x-xgen-version: 2023-01-01 + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/NoBody" + x-xgen-version: 2025-01-01 description: This endpoint does not return a response body. "400": $ref: "#/components/responses/badRequest" @@ -16264,6 +16472,51 @@ paths: summary: Remove One User from One Project tags: - Projects + get: + description: |- + Returns information about the specified MongoDB Cloud user within the context of the specified project. To use this resource, the requesting API Key must have the Group Read Only role. + + **Note**: You can only use this resource to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + + **Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: getProjectUser + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pretty" + - description: "Unique 24-hexadecimal digit string that identifies the pending\ + \ or active user in the project. If you need to lookup a user's userId or\ + \ verify a user's status in the organization, use the Return All MongoDB\ + \ Cloud Users in One Project resource and filter by username." + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: "^([a-f0-9]{24})$" + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/GroupUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One MongoDB Cloud User in One Project + tags: + - MongoDB Cloud Users /api/atlas/v2/groups/{groupId}/users/{userId}/roles: put: description: "Updates the roles of the specified user in the specified project.\ @@ -16311,6 +16564,59 @@ paths: summary: Update Project Roles for One MongoDB Cloud User tags: - Projects + /api/atlas/v2/groups/{groupId}/users/{userId}:addRole: + post: + description: |- + Adds one project-level role to the MongoDB Cloud user. You can add a role to an active user or a user that has been invited to join the project. To use this resource, the requesting API Key must have the Project Owner role. + + **Note**: This resource cannot be used to add a role to users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: addProjectRole + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pretty" + - description: "Unique 24-hexadecimal digit string that identifies the pending\ + \ or active user in the project. If you need to lookup a user's userId or\ + \ verify a user's status in the organization, use the Return All MongoDB\ + \ Cloud Users in One Project resource and filter by username." + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: "^([a-f0-9]{24})$" + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveGroupRole" + description: Project-level role to assign to the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One Project Role to One MongoDB Cloud User + tags: + - MongoDB Cloud Users /api/atlas/v2/groups/{groupId}:migrate: post: description: "Migrates a project from its current organization to another organization.\ @@ -18790,7 +19096,7 @@ paths: \ using its unique 24-hexadecimal digit identifier. This team belongs to one\ \ organization. Teams enable you to grant project access roles to MongoDB\ \ Cloud users. To use this resource, the requesting API Key must have the\ - \ Organization Member role." + \ Organization Member role. Deprecated versions: v2-{2023-01-01}" externalDocs: description: Manage Organization Teams url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams @@ -18814,10 +19120,10 @@ paths: responses: "200": content: - application/vnd.atlas.2023-01-01+json: + application/vnd.atlas.2025-01-01+json: schema: - $ref: "#/components/schemas/PaginatedAppUserView" - x-xgen-version: 2023-01-01 + $ref: "#/components/schemas/PaginatedOrgUserView" + x-xgen-version: 2025-01-01 description: OK "400": $ref: "#/components/responses/badRequest" @@ -18938,13 +19244,113 @@ paths: summary: Remove One MongoDB Cloud User from One Team tags: - Teams + /api/atlas/v2/orgs/{orgId}/teams/{teamId}:addUser: + post: + description: |- + Adds one MongoDB Cloud user to one team. You can add an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: This resource cannot be used to add a user invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: addUserToTeam + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pretty" + - description: Unique 24-hexadecimal digit string that identifies the team to + add the MongoDB Cloud user to. + in: path + name: teamId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: "^([a-f0-9]{24})$" + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveUserFromTeam" + description: The active or pending MongoDB Cloud user that you want to add + to the specified team. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One MongoDB Cloud User to One Team + tags: + - MongoDB Cloud Users + /api/atlas/v2/orgs/{orgId}/teams/{teamId}:removeUser: + post: + description: |- + Removes one MongoDB Cloud user from one team. You can remove an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: This resource cannot be used to remove a user invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: removeUserFromTeam + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pretty" + - description: Unique 24-hexadecimal digit string that identifies the team to + remove the MongoDB user from. + in: path + name: teamId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: "^([a-f0-9]{24})$" + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveUserFromTeam" + description: The id of the active or pending MongoDB Cloud user that you want + to remove from the specified team. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One MongoDB Cloud User from One Team + tags: + - MongoDB Cloud Users /api/atlas/v2/orgs/{orgId}/users: get: description: "Returns details about the MongoDB Cloud users associated with\ \ the specified organization. Each MongoDB Cloud user returned must belong\ \ to the specified organization or to a project within the specified organization.\ \ To use this resource, the requesting API Key must have the Organization\ - \ Member role." + \ Member role. Deprecated versions: v2-{2023-01-01}" operationId: listOrganizationUsers parameters: - $ref: "#/components/parameters/envelope" @@ -18956,10 +19362,10 @@ paths: responses: "200": content: - application/vnd.atlas.2023-01-01+json: + application/vnd.atlas.2025-01-01+json: schema: - $ref: "#/components/schemas/PaginatedAppUserView" - x-xgen-version: 2023-01-01 + $ref: "#/components/schemas/PaginatedOrgUserView" + x-xgen-version: 2025-01-01 description: OK "400": $ref: "#/components/responses/badRequest" @@ -18972,11 +19378,51 @@ paths: summary: Return All MongoDB Cloud Users in One Organization tags: - Organizations + post: + description: |- + Invites one new or existing MongoDB Cloud user to join the organization. The invitation to join the organization will be sent to the username provided and must be accepted within 30 days. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: If the user does not have an existing MongoDB Cloud account, they will be prompted to finish setting up an account upon accepting the invitation. If the user already has an account, they will still receive an invitation to access the organization. + operationId: createOrganizationUser + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pretty" + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserRequest" + description: Represents the MongoDB Cloud user to be created within the organization. + required: true + responses: + "201": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One MongoDB Cloud User in One Organization + tags: + - MongoDB Cloud Users /api/atlas/v2/orgs/{orgId}/users/{userId}: delete: description: "Removes one MongoDB Cloud user from the specified organization.\ \ To use this resource, the requesting API Key must have the Organization\ - \ User Admin role." + \ User Admin role. Deprecated versions: v2-{2023-01-01}" operationId: removeOrganizationUser parameters: - $ref: "#/components/parameters/envelope" @@ -18995,10 +19441,10 @@ paths: responses: "204": content: - application/vnd.atlas.2023-01-01+json: + application/vnd.atlas.2025-01-01+json: schema: $ref: "#/components/schemas/NoBody" - x-xgen-version: 2023-01-01 + x-xgen-version: 2025-01-01 description: This endpoint does not return a response body. "400": $ref: "#/components/responses/badRequest" @@ -19013,6 +19459,103 @@ paths: summary: Remove One MongoDB Cloud User From One Organization tags: - Organizations + get: + description: |- + Returns information about the specified MongoDB Cloud user within the context of the specified organization. To use this resource, the requesting API Key must have the Organization Read Only role. + + **Note**: This resource can only be used to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + + **Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: getOrganizationUser + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pretty" + - description: "Unique 24-hexadecimal digit string that identifies the pending\ + \ or active user in the organization. If you need to lookup a user's userId\ + \ or verify a user's status in the organization, use the Return All MongoDB\ + \ Cloud Users in One Organization resource and filter by username." + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: "^([a-f0-9]{24})$" + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One MongoDB Cloud User in One Organization + tags: + - MongoDB Cloud Users + patch: + description: |- + Updates one MongoDB Cloud user in the specified organization. You can update an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: Only include the fields you wish to update in the request body. Supplying a field with an empty value will reset that field on the user. + + **Note**: This resource cannot be used to update pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: updateOrganizationUser + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pretty" + - description: "Unique 24-hexadecimal digit string that identifies the pending\ + \ or active user in the organization. If you need to lookup a user's userId\ + \ or verify a user's status in the organization, use the Return All MongoDB\ + \ Cloud Users in One Organization resource and filter by username." + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: "^([a-f0-9]{24})$" + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserUpdateRequest" + description: Represents the roles and teams to assign the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One MongoDB Cloud User in One Organization + tags: + - MongoDB Cloud Users /api/atlas/v2/orgs/{orgId}/users/{userId}/roles: put: description: "Updates the roles of the specified user in the specified organization.\ @@ -19060,6 +19603,114 @@ paths: summary: Update Organization Roles for One MongoDB Cloud User tags: - Organizations + /api/atlas/v2/orgs/{orgId}/users/{userId}:addRole: + post: + description: |- + Adds one organization-level role to the MongoDB Cloud user. You can add a role to an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: This operation is atomic. + + **Note**: This resource cannot be used to add a role to users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: addOrganizationRole + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pretty" + - description: "Unique 24-hexadecimal digit string that identifies the pending\ + \ or active user in the organization. If you need to lookup a user's userId\ + \ or verify a user's status in the organization, use the Return All MongoDB\ + \ Cloud Users in One Organization resource and filter by username." + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: "^([a-f0-9]{24})$" + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveOrgRole" + description: Organization-level role to assign to the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One Organization Role to One MongoDB Cloud User + tags: + - MongoDB Cloud Users + /api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole: + post: + description: |- + Removes one organization-level role from the MongoDB Cloud user. You can remove a role from an active user or a user that has not yet accepted the invitation to join the organization. To replace a user's only role, add the new role before removing the old role. A user must have at least one role at all times. To use this resource, the requesting API Key must have the Organization Owner role. + + **Note**: This operation is atomic. + + **Note**: This resource cannot be used to remove a role from users invited using the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: removeOrganizationRole + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pretty" + - description: "Unique 24-hexadecimal digit string that identifies the pending\ + \ or active user in the organization. If you need to lookup a user's userId\ + \ or verify a user's status in the organization, use the Return All MongoDB\ + \ Cloud Users in One Organization resource and filter by username." + in: path + name: userId + required: true + schema: + type: string + maxLength: 24 + minLength: 24 + pattern: "^([a-f0-9]{24})$" + requestBody: + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/AddOrRemoveOrgRole" + description: Organization-level role to remove from the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-01-01+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Organization Role from One MongoDB Cloud User + tags: + - MongoDB Cloud Users /api/atlas/v2/unauth/controlPlaneIPAddresses: get: description: Returns all control plane IP addresses. @@ -19080,6 +19731,44 @@ paths: summary: Return All Control Plane IP Addresses tags: - Root + /api/atlas/v2/unauth/openapi/versions: + get: + description: API that provides a list of available versionsfor a given environment. + operationId: getApiVersions + parameters: + - $ref: "#/components/parameters/envelope" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/pretty" + - description: "The environment to get the versions from. If not provided, it\ + \ returnsthe versions for the given MongoDB URL. (E.g. prod for cloud.mongodb.com)" + in: query + name: env + schema: + type: string + enum: + - dev + - qa + - prod + - stage + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedApiVersions" + x-xgen-version: 2024-08-05 + application/vnd.atlas.2024-08-05+yaml: + schema: + $ref: "#/components/schemas/PaginatedApiVersions" + x-xgen-version: 2024-08-05 + description: OK + "500": + $ref: "#/components/responses/internalServerError" + security: [] + summary: Provides a list of versions for a given environment. + tags: + - OpenAPI /api/atlas/v2/users: post: description: |- @@ -20300,6 +20989,23 @@ components: \ alert. By default this value is set to false. If set to true, it will\ \ override the acknowledgedUntil parameter." title: Acknowledge Alert + AddOrRemoveGroupRole: + type: object + properties: + groupRole: + type: string + description: Project-level role. + enum: + - GROUP_OWNER + - GROUP_CLUSTER_MANAGER + - GROUP_STREAM_PROCESSING_OWNER + - GROUP_DATA_ACCESS_ADMIN + - GROUP_DATA_ACCESS_READ_WRITE + - GROUP_DATA_ACCESS_READ_ONLY + - GROUP_READ_ONLY + - GROUP_SEARCH_INDEX_EDITOR + required: + - groupRole AddOrRemoveOrgRole: type: object properties: @@ -25562,9 +26268,8 @@ components: - $ref: "#/components/schemas/AtlasDataFederationGCPRegion" BaseCloudProviderInstanceSize: type: object - description: "Minimum instance size to which your cluster can automatically\ - \ scale. MongoDB Cloud requires this parameter if `\"replicationSpecs[n].regionConfigs[m].autoScaling.compute.scaleDownEnabled\"\ - \ : true`." + description: Instance size boundary to which your cluster can automatically + scale. oneOf: - type: string enum: @@ -28724,12 +29429,14 @@ components: url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ featureCompatibilityVersion: type: string - description: Feature compatibility version of the cluster. + description: Feature compatibility version of the cluster. This will always + appear regardless of whether FCV is pinned. readOnly: true featureCompatibilityVersionExpirationDate: type: string format: date-time - description: Feature compatibility version expiration date. + description: Feature compatibility version expiration date. Will only appear + if FCV is pinned. readOnly: true globalClusterSelfManagedSharding: type: boolean @@ -28785,12 +29492,18 @@ components: $ref: "#/components/schemas/EmployeeAccessGrantView" mongoDBMajorVersion: type: string - description: |- - MongoDB major version of the cluster. - - On creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLTSVersions). - - On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version. + description: "MongoDB major version of the cluster. Set to the binary major\ + \ version. \n\nOn creation: Choose from the available versions of MongoDB,\ + \ or leave unspecified for the current recommended default in the MongoDB\ + \ Cloud platform. The recommended version is a recent Long Term Support\ + \ version. The default is not guaranteed to be the most recently released\ + \ version throughout the entire release cycle. For versions available\ + \ in a specific project, see the linked documentation or use the API endpoint\ + \ for [project LTS versions endpoint](#tag/Projects/operation/getProjectLtsVersions).\n\ + \n On update: Increase version only by 1 major version at a time. If the\ + \ cluster is pinned to a MongoDB feature compatibility version exactly\ + \ one major version below the current MongoDB version, the MongoDB version\ + \ can be downgraded to the previous major version." externalDocs: description: Available MongoDB Versions in Atlas url: https://www.mongodb.com/docs/atlas/reference/faq/database/#which-versions-of-mongodb-do-service-clusters-use- @@ -30424,6 +31137,11 @@ components: maxLength: 24 minLength: 24 pattern: "^([a-f0-9]{24})$" + skipDefaultAlertsSettings: + type: boolean + default: false + description: "Disables automatic alert creation. When set to true, no organization\ + \ level alerts will be created automatically." required: - name CreateOrganizationResponse: @@ -32072,6 +32790,14 @@ components: readOnly: true currentValue: $ref: "#/components/schemas/DataMetricValueView" + deskLocation: + type: string + description: Desk location of MongoDB employee associated with the event. + readOnly: true + employeeIdentifier: + type: string + description: Identifier of MongoDB employee associated with the event. + readOnly: true eventTypeName: $ref: "#/components/schemas/HostMetricEventTypeView" groupId: @@ -32805,6 +33531,7 @@ components: - EPOCH_SECONDS - EPOCH_MILLIS - EPOCH_NANOSECONDS + - OBJECT_ID expireAfterDays: type: integer format: int32 @@ -32904,6 +33631,15 @@ components: - CPS_SNAPSHOT_DOWNLOAD_REQUEST_FAILED - CPS_OPLOG_CAUGHT_UP title: Cps Backup Event Types + - type: string + enum: + - CPS_DATA_PROTECTION_ENABLE_REQUESTED + - CPS_DATA_PROTECTION_ENABLED + - CPS_DATA_PROTECTION_UPDATE_REQUESTED + - CPS_DATA_PROTECTION_UPDATED + - CPS_DATA_PROTECTION_DISABLE_REQUESTED + - CPS_DATA_PROTECTION_DISABLED + title: Data Protection Event Types - type: string enum: - FTS_INDEX_DELETION_FAILED @@ -33181,6 +33917,15 @@ components: - DISK_AUTO_SCALE_MAX_DISK_SIZE_FAIL - DISK_AUTO_SCALE_OPLOG_FAIL title: NDS Auto Scaling Audit Types + - type: string + enum: + - CPS_DATA_PROTECTION_ENABLE_REQUESTED + - CPS_DATA_PROTECTION_ENABLED + - CPS_DATA_PROTECTION_UPDATE_REQUESTED + - CPS_DATA_PROTECTION_UPDATED + - CPS_DATA_PROTECTION_DISABLE_REQUESTED + - CPS_DATA_PROTECTION_DISABLED + title: Data Protection Event Types readOnly: true groupId: type: string @@ -33322,6 +34067,7 @@ components: - CLUSTER_CONNECTION_AGGREGATE - CLUSTER_CONNECTION_CREATE_COLLECTION - CLUSTER_CONNECTION_SAMPLE_COLLECTION_FIELD_NAMES + - CLUSTER_CONNECTION_SAMPLE_COLLECTION_FIELD_NAMES_AND_TYPES title: Cluster Connection Audit Types - type: string enum: @@ -34235,6 +34981,8 @@ components: - Queued - Successful readOnly: true + stateReason: + $ref: "#/components/schemas/StateReason" required: - exportBucketId DiskBackupExportJobRequest: @@ -35345,14 +36093,6 @@ components: type: object additionalProperties: type: object - description: The stats associated with the stream processor. - externalDocs: - url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/manage-stream-processor/#view-statistics-of-a-stream-processor - readOnly: true - description: The stats associated with the stream processor. - externalDocs: - url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/manage-stream-processor/#view-statistics-of-a-stream-processor - readOnly: true EARPrivateEndpoint: type: object description: Encryption At Rest Private Endpoint. @@ -35788,6 +36528,7 @@ components: - CLUSTER_CONNECTION_AGGREGATE - CLUSTER_CONNECTION_CREATE_COLLECTION - CLUSTER_CONNECTION_SAMPLE_COLLECTION_FIELD_NAMES + - CLUSTER_CONNECTION_SAMPLE_COLLECTION_FIELD_NAMES_AND_TYPES title: Cluster Connection Audit Types - type: string enum: @@ -36041,6 +36782,7 @@ components: - OS_MAINTENANCE_REPLACEMENT - FREE_UPGRADE_STARTED - FLEX_UPGRADE_STARTED + - SERVERLESS_UPGRADE_STARTED - TEST_FAILOVER_REQUESTED - USER_SECURITY_SETTINGS_UPDATED - AUDIT_LOG_CONFIGURATION_UPDATED @@ -36155,6 +36897,7 @@ components: - CLUSTER_INSTANCE_DISABLED - CLUSTER_INSTANCE_ENABLED - KMIP_KEY_ROTATION_SCHEDULED + - SSL_CERTIFICATE_ISSUED title: NDS Audit Types - type: string enum: @@ -36592,6 +37335,9 @@ components: - ORG_SERVICE_ACCOUNT_SECRETS_NO_LONGER_EXPIRED - ORG_SERVICE_ACCOUNT_SECRETS_EXPIRING - ORG_SERVICE_ACCOUNT_SECRETS_NO_LONGER_EXPIRING + - ORG_MONGODB_VERSION_EOL_EXTENSION_ACCEPTED + - ORG_MONGODB_VERSION_EOL_EXTENSION_PENDING + - ORG_MONGODB_VERSION_EOL_EXTENSION_CANCELLED title: Org Event Types - type: string enum: @@ -39475,6 +40221,8 @@ components: description: Number of times the current maintenance event for this project has been deferred. readOnly: true + protectedHours: + $ref: "#/components/schemas/ProtectedHours" startASAP: type: boolean description: "Flag that indicates whether MongoDB Cloud starts the maintenance\ @@ -39482,6 +40230,11 @@ components: \ window immediately for your project, MongoDB Cloud must have maintenance\ \ scheduled and you must set a maintenance window. This flag resets to\ \ `false` after MongoDB Cloud completes maintenance." + timeZoneId: + type: string + description: Identifier for the current time zone of the maintenance window. + This can only be updated via the Project Settings UI. + readOnly: true required: - dayOfWeek GroupMigrationRequest: @@ -40327,6 +41080,14 @@ components: its value in the ISO 8601 timestamp format in UTC. readOnly: true + deskLocation: + type: string + description: Desk location of MongoDB employee associated with the event. + readOnly: true + employeeIdentifier: + type: string + description: Identifier of MongoDB employee associated with the event. + readOnly: true eventTypeName: $ref: "#/components/schemas/HostEventTypeViewForNdsGroup" groupId: @@ -41060,6 +41821,14 @@ components: readOnly: true currentValue: $ref: "#/components/schemas/HostMetricValue" + deskLocation: + type: string + description: Desk location of MongoDB employee associated with the event. + readOnly: true + employeeIdentifier: + type: string + description: Identifier of MongoDB employee associated with the event. + readOnly: true eventTypeName: $ref: "#/components/schemas/HostMetricEventTypeView" groupId: @@ -42148,6 +42917,7 @@ components: - ATLAS_ENTERPRISE_AUDITING - ATLAS_FREE_SUPPORT - ATLAS_SUPPORT + - ATLAS_NDS_BACKFILL_SUPPORT - STITCH_DATA_DOWNLOADED_FREE_TIER - STITCH_DATA_DOWNLOADED - STITCH_COMPUTE_FREE_TIER @@ -44530,6 +45300,7 @@ components: - OS_MAINTENANCE_REPLACEMENT - FREE_UPGRADE_STARTED - FLEX_UPGRADE_STARTED + - SERVERLESS_UPGRADE_STARTED - TEST_FAILOVER_REQUESTED - USER_SECURITY_SETTINGS_UPDATED - AUDIT_LOG_CONFIGURATION_UPDATED @@ -44644,6 +45415,7 @@ components: - CLUSTER_INSTANCE_DISABLED - CLUSTER_INSTANCE_ENABLED - KMIP_KEY_ROTATION_SCHEDULED + - SSL_CERTIFICATE_ISSUED example: CLUSTER_CREATED title: NDS Audit Types NDSAuditTypeViewForOrg: @@ -45760,6 +46532,14 @@ components: readOnly: true currentValue: $ref: "#/components/schemas/NumberMetricValueView" + deskLocation: + type: string + description: Desk location of MongoDB employee associated with the event. + readOnly: true + employeeIdentifier: + type: string + description: Identifier of MongoDB employee associated with the event. + readOnly: true eventTypeName: $ref: "#/components/schemas/HostMetricEventTypeView" groupId: @@ -46181,6 +46961,9 @@ components: - ORG_SERVICE_ACCOUNT_SECRETS_NO_LONGER_EXPIRED - ORG_SERVICE_ACCOUNT_SECRETS_EXPIRING - ORG_SERVICE_ACCOUNT_SECRETS_NO_LONGER_EXPIRING + - ORG_MONGODB_VERSION_EOL_EXTENSION_ACCEPTED + - ORG_MONGODB_VERSION_EOL_EXTENSION_PENDING + - ORG_MONGODB_VERSION_EOL_EXTENSION_CANCELLED example: ORG_CREATED title: Org Event Types OrgEventViewForOrg: @@ -49578,6 +50361,24 @@ components: - serviceDiscovery - username title: PROMETHEUS + ProtectedHours: + type: object + description: Defines the a window where maintenance will not begin within. + properties: + endHourOfDay: + type: integer + format: int32 + description: Zero-based integer that represents the end hour of the of the + day that the maintenance will not begin in. + maximum: 23 + minimum: 0 + startHourOfDay: + type: integer + format: int32 + description: Zero-based integer that represents the beginning hour of the + of the day that the maintenance will not begin in. + maximum: 23 + minimum: 0 PublicApiUsageDetailsLineItemView: type: object properties: @@ -49866,6 +50667,14 @@ components: readOnly: true currentValue: $ref: "#/components/schemas/RawMetricValueView" + deskLocation: + type: string + description: Desk location of MongoDB employee associated with the event. + readOnly: true + employeeIdentifier: + type: string + description: Identifier of MongoDB employee associated with the event. + readOnly: true eventTypeName: $ref: "#/components/schemas/HostMetricEventTypeView" groupId: @@ -53055,6 +53864,17 @@ components: - groupId - managedAuthentication - ssl + StateReason: + type: object + description: State reason of the Job. This is set when the job state is "Failed". + properties: + errorCode: + type: string + description: Error code relating to state. + message: + type: string + description: Message describing error or state. + readOnly: true StorageEngine: type: object additionalProperties: @@ -53440,15 +54260,15 @@ components: discriminator: mapping: Cluster: "#/components/schemas/StreamsClusterConnection" + Https: "#/components/schemas/StreamsHttpsConnection" Kafka: "#/components/schemas/StreamsKafkaConnection" Sample: "#/components/schemas/StreamsSampleConnection" - WebAPI: "#/components/schemas/StreamsWebAPIConnection" propertyName: type oneOf: - $ref: "#/components/schemas/StreamsSampleConnection" - $ref: "#/components/schemas/StreamsClusterConnection" - $ref: "#/components/schemas/StreamsKafkaConnection" - - $ref: "#/components/schemas/StreamsWebAPIConnection" + - $ref: "#/components/schemas/StreamsHttpsConnection" properties: links: type: array @@ -53472,7 +54292,7 @@ components: - Kafka - Cluster - Sample - - WebAPI + - Https readOnly: true StreamsDLQ: type: object @@ -53603,6 +54423,23 @@ components: - eventTypeName - id title: Streams Events + StreamsHttpsConnection: + type: object + allOf: + - $ref: "#/components/schemas/StreamsConnection" + - type: object + properties: + headers: + type: object + additionalProperties: + type: string + description: A map of key-value pairs that will be passed as headers + for the request. + description: A map of key-value pairs that will be passed as headers for + the request. + url: + type: string + description: The url to be used for the request. StreamsKafkaAuthentication: type: object description: "User credentials required to connect to a Kafka Cluster. Includes\ @@ -53776,6 +54613,55 @@ components: - PROCESSOR_NAME example: INSTANCE_NAME title: Streams Matcher Fields + StreamsModifyStreamProcessor: + type: object + description: A request to modify an existing stream processor + 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 + name: + type: string + description: New name for the stream processor. + options: + $ref: "#/components/schemas/StreamsModifyStreamProcessorOptions" + pipeline: + type: array + description: New pipeline for the stream processor. + externalDocs: + description: Supported Aggregation Pipeline Stages + url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/stream-aggregation/#std-label-stream-aggregation + items: + $ref: "#/components/schemas/Document" + StreamsModifyStreamProcessorOptions: + type: object + description: Additional options for modifying a stream processor. + properties: + dlq: + $ref: "#/components/schemas/StreamsDLQ" + 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 + resumeFromCheckpoint: + type: boolean + description: "When true, the modified stream processor resumes from its\ + \ last checkpoint." StreamsOptions: type: object description: Optional configuration for the stream processor. @@ -54015,31 +54901,6 @@ components: $ref: "#/components/schemas/StreamsSampleConnections" streamConfig: $ref: "#/components/schemas/StreamConfig" - StreamsWebAPIConnection: - type: object - allOf: - - $ref: "#/components/schemas/StreamsConnection" - - type: object - properties: - connectionTimeoutSec: - type: integer - format: int32 - description: The amount of seconds to wait before timing out a connection. - headers: - type: object - additionalProperties: - type: string - description: A map of key-value pairs that will be passed as headers - for the request. - description: A map of key-value pairs that will be passed as headers for - the request. - requestTimeoutSec: - type: integer - format: int32 - description: The amount of seconds to wait before timing out a request. - url: - type: string - description: The url to be used for the request. SummaryNotification: type: object description: Summary notification configuration for MongoDB Cloud to send information @@ -54210,11 +55071,10 @@ components: items: type: string format: email - description: List that contains email addresses that identify MongoDB - Cloud users to in this team. uniqueItems: true required: - name + - usernames TeamEvent: type: object description: Team event identifies different activities around organization @@ -55314,6 +56174,14 @@ components: readOnly: true currentValue: $ref: "#/components/schemas/TimeMetricValueView" + deskLocation: + type: string + description: Desk location of MongoDB employee associated with the event. + readOnly: true + employeeIdentifier: + type: string + description: Identifier of MongoDB employee associated with the event. + readOnly: true eventTypeName: $ref: "#/components/schemas/HostMetricEventTypeView" groupId: diff --git a/openapi/versions.json b/openapi/versions.json index 791fa200c..e8288ac46 100644 --- a/openapi/versions.json +++ b/openapi/versions.json @@ -1 +1 @@ -{"versions":{"2.0":["2023-01-01","2023-02-01","2023-10-01","2023-11-15","2024-05-30","2024-08-05","2024-10-23","2024-11-13"],"major":["1.0","2.0"]}} \ No newline at end of file +{"versions":{"2.0":["2023-01-01","2023-02-01","2023-10-01","2023-11-15","2024-05-30","2024-08-05","2024-10-23","2024-11-13","2025-01-01"],"major":["1.0","2.0"]}} \ No newline at end of file diff --git a/test/example_client_test.go b/test/example_client_test.go index 8449246f6..917271429 100644 --- a/test/example_client_test.go +++ b/test/example_client_test.go @@ -3,7 +3,7 @@ package test import ( "fmt" - "go.mongodb.org/atlas-sdk/v20241113001/admin" + "github.com/mongodb/atlas-sdk-go/admin" ) func ExampleNewClient() { diff --git a/test/utils_test.go b/test/utils_test.go index 33a40f63a..b82641136 100644 --- a/test/utils_test.go +++ b/test/utils_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "go.mongodb.org/atlas-sdk/v20241113001/admin" + "github.com/mongodb/atlas-sdk-go/admin" ) type testCase[T comparable] struct { diff --git a/tools/config/go-templates/api_doc.mustache b/tools/config/go-templates/api_doc.mustache index 2204aec56..320722f45 100644 --- a/tools/config/go-templates/api_doc.mustache +++ b/tools/config/go-templates/api_doc.mustache @@ -29,7 +29,7 @@ import ( "fmt" "os" - "go.mongodb.org/atlas-sdk/v20241113001/admin" + "github.com/mongodb/atlas-sdk-go/admin" ) func main() { diff --git a/tools/config/go-templates/atlas_client.mustache b/tools/config/go-templates/atlas_client.mustache index 7e44b7967..1c1b2af41 100644 --- a/tools/config/go-templates/atlas_client.mustache +++ b/tools/config/go-templates/atlas_client.mustache @@ -1,4 +1,4 @@ -{{! X-XGEN-CUSTOM }}package {{packageName}} // import "go.mongodb.org/atlas-sdk/v20241113001/admin" +{{! X-XGEN-CUSTOM }}package {{packageName}} // import "github.com/mongodb/atlas-sdk-go/admin" import ( "errors" @@ -6,9 +6,9 @@ import ( "strings" "github.com/mongodb-forks/digest" - "go.mongodb.org/atlas-sdk/v20241113001/auth" - "go.mongodb.org/atlas-sdk/v20241113001/auth/clientcredentials" - "go.mongodb.org/atlas-sdk/v20241113001/internal/core" + "github.com/mongodb/atlas-sdk-go/auth" + "github.com/mongodb/atlas-sdk-go/auth/clientcredentials" + "github.com/mongodb/atlas-sdk-go/internal/core" ) const (