diff --git a/mongodbatlas/alert_configurations.go b/mongodbatlas/alert_configurations.go index e94c96903..8447ef9d3 100644 --- a/mongodbatlas/alert_configurations.go +++ b/mongodbatlas/alert_configurations.go @@ -136,6 +136,7 @@ type CurrentValue struct { } // Create creates an alert configuration for the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-create-config/ func (s *AlertConfigurationsServiceOp) Create(ctx context.Context, groupID string, createReq *AlertConfiguration) (*AlertConfiguration, *Response, error) { if groupID == "" { @@ -162,6 +163,7 @@ func (s *AlertConfigurationsServiceOp) Create(ctx context.Context, groupID strin } // EnableAnAlertConfig Enables/disables the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-enable-disable-config/ func (s *AlertConfigurationsServiceOp) EnableAnAlertConfig(ctx context.Context, groupID, alertConfigID string, enabled *bool) (*AlertConfiguration, *Response, error) { if groupID == "" { @@ -189,6 +191,7 @@ func (s *AlertConfigurationsServiceOp) EnableAnAlertConfig(ctx context.Context, } // GetAnAlertConfig gets the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-get-config/ func (s *AlertConfigurationsServiceOp) GetAnAlertConfig(ctx context.Context, groupID, alertConfigID string) (*AlertConfiguration, *Response, error) { if groupID == "" { @@ -216,6 +219,7 @@ func (s *AlertConfigurationsServiceOp) GetAnAlertConfig(ctx context.Context, gro } // GetOpenAlertsConfig gets all open alerts for the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-get-open-alerts/ func (s *AlertConfigurationsServiceOp) GetOpenAlertsConfig(ctx context.Context, groupID, alertConfigID string) ([]AlertConfiguration, *Response, error) { if groupID == "" { @@ -246,6 +250,7 @@ func (s *AlertConfigurationsServiceOp) GetOpenAlertsConfig(ctx context.Context, } // List gets all alert configurations for the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-get-all-configs/ func (s *AlertConfigurationsServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) ([]AlertConfiguration, *Response, error) { if groupID == "" { @@ -279,6 +284,7 @@ func (s *AlertConfigurationsServiceOp) List(ctx context.Context, groupID string, } // Update the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-update-config/ func (s *AlertConfigurationsServiceOp) Update(ctx context.Context, groupID, alertConfigID string, updateReq *AlertConfiguration) (*AlertConfiguration, *Response, error) { if updateReq == nil { @@ -309,6 +315,7 @@ func (s *AlertConfigurationsServiceOp) Update(ctx context.Context, groupID, aler } // Delete the alert configuration specified to {ALERT-CONFIG-ID} for the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-delete-config/ func (s *AlertConfigurationsServiceOp) Delete(ctx context.Context, groupID, alertConfigID string) (*Response, error) { if groupID == "" { @@ -332,6 +339,7 @@ func (s *AlertConfigurationsServiceOp) Delete(ctx context.Context, groupID, aler } // ListMatcherFields gets all field names that the matchers.fieldName parameter accepts when you create or update an Alert Configuration. +// // See more: https://docs.atlas.mongodb.com/reference/api/alert-configurations-get-matchers-field-names/ func (s *AlertConfigurationsServiceOp) ListMatcherFields(ctx context.Context) ([]string, *Response, error) { path := "alertConfigs/matchers/fieldNames" diff --git a/mongodbatlas/api_keys.go b/mongodbatlas/api_keys.go index 85f8ed91d..ddf043ecf 100644 --- a/mongodbatlas/api_keys.go +++ b/mongodbatlas/api_keys.go @@ -25,6 +25,7 @@ const apiKeysPath = "orgs/%s/apiKeys" // APIKeysService is an interface for interfacing with the APIKeys // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/apiKeys/ type APIKeysService interface { List(context.Context, string, *ListOptions) ([]APIKey, *Response, error) @@ -70,6 +71,7 @@ type apiKeysResponse struct { } // List all API-KEY in the organization associated to {ORG-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-orgs-get-all/ func (s *APIKeysServiceOp) List(ctx context.Context, orgID string, listOptions *ListOptions) ([]APIKey, *Response, error) { path := fmt.Sprintf(apiKeysPath, orgID) @@ -99,6 +101,7 @@ func (s *APIKeysServiceOp) List(ctx context.Context, orgID string, listOptions * } // Get gets the APIKey specified to {API-KEY-ID} from the organization associated to {ORG-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-orgs-get-one/ func (s *APIKeysServiceOp) Get(ctx context.Context, orgID, apiKeyID string) (*APIKey, *Response, error) { if apiKeyID == "" { @@ -124,6 +127,7 @@ func (s *APIKeysServiceOp) Get(ctx context.Context, orgID, apiKeyID string) (*AP } // Create an API Key by the {ORG-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-orgs-create-one/ func (s *APIKeysServiceOp) Create(ctx context.Context, orgID string, createRequest *APIKeyInput) (*APIKey, *Response, error) { if createRequest == nil { @@ -146,7 +150,8 @@ func (s *APIKeysServiceOp) Create(ctx context.Context, orgID string, createReque return root, resp, err } -// Update a API Key in the organization associated to {ORG-ID} +// Update a API Key in the organization associated to {ORG-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-orgs-update-one/ func (s *APIKeysServiceOp) Update(ctx context.Context, orgID, apiKeyID string, updateRequest *APIKeyInput) (*APIKey, *Response, error) { if updateRequest == nil { @@ -171,6 +176,7 @@ func (s *APIKeysServiceOp) Update(ctx context.Context, orgID, apiKeyID string, u } // Delete the API Key specified to {API-KEY-ID} from the organization associated to {ORG-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/apiKey-delete-one-apiKey/ func (s *APIKeysServiceOp) Delete(ctx context.Context, orgID, apiKeyID string) (*Response, error) { if apiKeyID == "" { diff --git a/mongodbatlas/auditing.go b/mongodbatlas/auditing.go index 61dd2bf5f..e6fa90404 100644 --- a/mongodbatlas/auditing.go +++ b/mongodbatlas/auditing.go @@ -47,6 +47,7 @@ type Auditing struct { } // Get audit configuration for the project associated with {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/auditing-get-auditLog/ func (s *AuditingsServiceOp) Get(ctx context.Context, groupID string) (*Auditing, *Response, error) { if groupID == "" { @@ -69,6 +70,7 @@ func (s *AuditingsServiceOp) Get(ctx context.Context, groupID string) (*Auditing } // Configure the audit configuration for the project associated with {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/auditing-set-auditLog/ func (s *AuditingsServiceOp) Configure(ctx context.Context, groupID string, configRequest *Auditing) (*Auditing, *Response, error) { if configRequest == nil { diff --git a/mongodbatlas/checkpoints.go b/mongodbatlas/checkpoints.go index b339cb044..b83eee9e5 100644 --- a/mongodbatlas/checkpoints.go +++ b/mongodbatlas/checkpoints.go @@ -65,6 +65,7 @@ type Checkpoints struct { } // List all checkpoints for the specified sharded cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/checkpoints-get-all/ func (s CheckpointsServiceOp) List(ctx context.Context, groupID, clusterName string, listOptions *ListOptions) (*Checkpoints, *Response, error) { if groupID == "" { @@ -92,6 +93,7 @@ func (s CheckpointsServiceOp) List(ctx context.Context, groupID, clusterName str } // Get one checkpoint for the specified sharded cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/checkpoints-get-one/ func (s CheckpointsServiceOp) Get(ctx context.Context, groupID, clusterName, checkpointID string) (*Checkpoint, *Response, error) { if groupID == "" { diff --git a/mongodbatlas/cloud_provider_regions.go b/mongodbatlas/cloud_provider_regions.go index b141f5b48..938eb89a3 100644 --- a/mongodbatlas/cloud_provider_regions.go +++ b/mongodbatlas/cloud_provider_regions.go @@ -20,12 +20,12 @@ import ( "net/http" ) -const ( - cloudProviderRegionsBasePath = "groups/%s/clusters/provider/regions" -) +const cloudProviderRegionsBasePath = "groups/%s/clusters/provider/regions" // CloudProviderRegionsService is an interface for interfacing with the Cloud Provider Regions // endpoints of the MongoDB Atlas API. +// +// See more: https://docs.atlas.mongodb.com/reference/api/cluster-get-regions/ type CloudProviderRegionsService interface { List(context.Context, string, *CloudProviderRegionsOptions) (*CloudProviders, *Response, error) } @@ -67,7 +67,9 @@ type CloudProviderRegionsOptions struct { Tier string `url:"tier,omitempty"` } -// List gets the available regions for each cloud provider +// List gets the available regions for each cloud provider. +// +// See more: https://docs.atlas.mongodb.com/reference/api/cluster-get-regions/ func (s *CloudProviderRegionsServiceOp) List(ctx context.Context, groupID string, options *CloudProviderRegionsOptions) (*CloudProviders, *Response, error) { if groupID == "" { return nil, nil, NewArgError("groupId", "must be set") diff --git a/mongodbatlas/cloud_provider_snapshot_backup_policies.go b/mongodbatlas/cloud_provider_snapshot_backup_policies.go index 48a90c0e7..5943792c7 100644 --- a/mongodbatlas/cloud_provider_snapshot_backup_policies.go +++ b/mongodbatlas/cloud_provider_snapshot_backup_policies.go @@ -26,6 +26,7 @@ const ( // CloudProviderSnapshotBackupPoliciesService is an interface for interfacing with the Cloud Provider Snapshots Backup Policy // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-schedule/ type CloudProviderSnapshotBackupPoliciesService interface { Get(context.Context, string, string) (*CloudProviderSnapshotBackupPolicy, *Response, error) diff --git a/mongodbatlas/cloud_provider_snapshot_restore_jobs.go b/mongodbatlas/cloud_provider_snapshot_restore_jobs.go index 1bdd033ca..6e4a5a5c5 100644 --- a/mongodbatlas/cloud_provider_snapshot_restore_jobs.go +++ b/mongodbatlas/cloud_provider_snapshot_restore_jobs.go @@ -20,12 +20,11 @@ import ( "net/http" ) -const ( - cloudProviderSnapshotRestoreJobBasePath = "groups" -) +const cloudProviderSnapshotRestoreJobBasePath = "groups" // CloudProviderSnapshotRestoreJobsService is an interface for interfacing with the CloudProviderSnapshotRestoreJobs // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs/ type CloudProviderSnapshotRestoreJobsService interface { List(context.Context, *SnapshotReqPathParameters, *ListOptions) (*CloudProviderSnapshotRestoreJobs, *Response, error) @@ -74,6 +73,7 @@ type Component struct { } // List gets all cloud provider snapshot restore jobs for the specified cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-get-all/ func (s *CloudProviderSnapshotRestoreJobsServiceOp) List(ctx context.Context, requestParameters *SnapshotReqPathParameters, listOptions *ListOptions) (*CloudProviderSnapshotRestoreJobs, *Response, error) { if requestParameters.GroupID == "" { @@ -108,6 +108,7 @@ func (s *CloudProviderSnapshotRestoreJobsServiceOp) List(ctx context.Context, re } // Get gets one cloud provider snapshot restore jobs for the specified cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-get-one/ func (s *CloudProviderSnapshotRestoreJobsServiceOp) Get(ctx context.Context, requestParameters *SnapshotReqPathParameters) (*CloudProviderSnapshotRestoreJob, *Response, error) { if requestParameters.GroupID == "" { @@ -137,6 +138,7 @@ func (s *CloudProviderSnapshotRestoreJobsServiceOp) Get(ctx context.Context, req } // Create creates a new restore job from a cloud provider snapshot associated to the specified cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-create-one/ func (s *CloudProviderSnapshotRestoreJobsServiceOp) Create(ctx context.Context, requestParameters *SnapshotReqPathParameters, createRequest *CloudProviderSnapshotRestoreJob) (*CloudProviderSnapshotRestoreJob, *Response, error) { // Verify if is download or automated @@ -176,6 +178,7 @@ func (s *CloudProviderSnapshotRestoreJobsServiceOp) Create(ctx context.Context, } // Delete cancels the cloud provider snapshot manual download restore job associated to {JOB-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-restore-jobs-delete-one/ func (s *CloudProviderSnapshotRestoreJobsServiceOp) Delete(ctx context.Context, requestParameters *SnapshotReqPathParameters) (*Response, error) { if requestParameters.GroupID == "" { diff --git a/mongodbatlas/cloud_provider_snapshots.go b/mongodbatlas/cloud_provider_snapshots.go index 5f5ef9d99..fd0ef2489 100644 --- a/mongodbatlas/cloud_provider_snapshots.go +++ b/mongodbatlas/cloud_provider_snapshots.go @@ -26,6 +26,7 @@ const ( // CloudProviderSnapshotsService is an interface for interfacing with the Cloud Provider Snapshots // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot/ type CloudProviderSnapshotsService interface { GetAllCloudProviderSnapshots(context.Context, *SnapshotReqPathParameters, *ListOptions) (*CloudProviderSnapshots, *Response, error) @@ -72,6 +73,7 @@ type SnapshotReqPathParameters struct { } // GetAllCloudProviderSnapshots gets all cloud provider snapshots for the specified cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-get-all/ func (s *CloudProviderSnapshotsServiceOp) GetAllCloudProviderSnapshots(ctx context.Context, requestParameters *SnapshotReqPathParameters, listOptions *ListOptions) (*CloudProviderSnapshots, *Response, error) { if requestParameters.GroupID == "" { @@ -107,6 +109,7 @@ func (s *CloudProviderSnapshotsServiceOp) GetAllCloudProviderSnapshots(ctx conte } // GetOneCloudProviderSnapshot gets the snapshot associated to {SNAPSHOT-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-get-one/ func (s *CloudProviderSnapshotsServiceOp) GetOneCloudProviderSnapshot(ctx context.Context, requestParameters *SnapshotReqPathParameters) (*CloudProviderSnapshot, *Response, error) { if requestParameters.GroupID == "" { @@ -136,6 +139,7 @@ func (s *CloudProviderSnapshotsServiceOp) GetOneCloudProviderSnapshot(ctx contex } // Create takes one on-demand snapshot. Atlas takes on-demand snapshots immediately, unlike scheduled snapshots which occur at regular intervals. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-take-one-ondemand/ func (s *CloudProviderSnapshotsServiceOp) Create(ctx context.Context, requestParameters *SnapshotReqPathParameters, createRequest *CloudProviderSnapshot) (*CloudProviderSnapshot, *Response, error) { if requestParameters.GroupID == "" { @@ -165,6 +169,7 @@ func (s *CloudProviderSnapshotsServiceOp) Create(ctx context.Context, requestPar } // Delete deletes the snapshot associated to {SNAPSHOT-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-delete-one/ func (s *CloudProviderSnapshotsServiceOp) Delete(ctx context.Context, requestParameters *SnapshotReqPathParameters) (*Response, error) { if requestParameters.GroupID == "" { diff --git a/mongodbatlas/custom_db_roles.go b/mongodbatlas/custom_db_roles.go index 2a9f09137..af3ae10b5 100644 --- a/mongodbatlas/custom_db_roles.go +++ b/mongodbatlas/custom_db_roles.go @@ -66,6 +66,7 @@ type CustomDBRole struct { } // List gets all custom db roles in the project. +// // See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-get-all-roles/ func (s *CustomDBRolesServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) (*[]CustomDBRole, *Response, error) { path := fmt.Sprintf(dbCustomDBRolesBasePath, groupID) @@ -90,6 +91,7 @@ func (s *CustomDBRolesServiceOp) List(ctx context.Context, groupID string, listO } // Get gets a single Custom MongoDB Role in the project. +// // See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-get-single-role/ func (s *CustomDBRolesServiceOp) Get(ctx context.Context, groupID, roleName string) (*CustomDBRole, *Response, error) { if roleName == "" { @@ -114,6 +116,7 @@ func (s *CustomDBRolesServiceOp) Get(ctx context.Context, groupID, roleName stri } // Create create a new Custom MongoDB Role in the project. +// // See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-create-a-role/ func (s *CustomDBRolesServiceOp) Create(ctx context.Context, groupID string, createRequest *CustomDBRole) (*CustomDBRole, *Response, error) { if createRequest == nil { @@ -137,6 +140,7 @@ func (s *CustomDBRolesServiceOp) Create(ctx context.Context, groupID string, cre } // Update updates a single Custom MongoDB Role. +// // See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-update-a-role/ func (s *CustomDBRolesServiceOp) Update(ctx context.Context, groupID, roleName string, updateRequest *CustomDBRole) (*CustomDBRole, *Response, error) { if updateRequest == nil { @@ -161,6 +165,7 @@ func (s *CustomDBRolesServiceOp) Update(ctx context.Context, groupID, roleName s } // Delete deletes a single Custom MongoDB Role. +// // See more: https://docs.atlas.mongodb.com/reference/api/custom-roles-delete-a-role/ func (s *CustomDBRolesServiceOp) Delete(ctx context.Context, groupID, roleName string) (*Response, error) { if roleName == "" { diff --git a/mongodbatlas/data_lakes.go b/mongodbatlas/data_lakes.go index 4c4938e5a..305c8cba1 100644 --- a/mongodbatlas/data_lakes.go +++ b/mongodbatlas/data_lakes.go @@ -20,9 +20,7 @@ import ( "net/http" ) -const ( - dataLakesBasePath = "groups" -) +const dataLakesBasePath = "groups" // DataLakeService is an interface for interfacing with the Data Lake endpoints of the MongoDB Atlas API. // diff --git a/mongodbatlas/database_users.go b/mongodbatlas/database_users.go index 295660393..263169b70 100644 --- a/mongodbatlas/database_users.go +++ b/mongodbatlas/database_users.go @@ -34,6 +34,7 @@ var awsIAMType = map[string]struct{}{ // DatabaseUsersService is an interface for interfacing with the Database Users // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/database-users/index.html type DatabaseUsersService interface { List(context.Context, string, *ListOptions) ([]DatabaseUser, *Response, error) @@ -111,6 +112,7 @@ type databaseUsers struct { } // List gets all users in the project. +// // See more: https://docs.atlas.mongodb.com/reference/api/database-users-get-all-users/ func (s *DatabaseUsersServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) ([]DatabaseUser, *Response, error) { path := fmt.Sprintf(dbUsersBasePath, groupID) @@ -140,6 +142,7 @@ func (s *DatabaseUsersServiceOp) List(ctx context.Context, groupID string, listO } // Get gets a single user in the project. +// // See more: https://docs.atlas.mongodb.com/reference/api/database-users-get-single-user/ func (s *DatabaseUsersServiceOp) Get(ctx context.Context, databaseName, groupID, username string) (*DatabaseUser, *Response, error) { if databaseName == "" { @@ -170,6 +173,7 @@ func (s *DatabaseUsersServiceOp) Get(ctx context.Context, databaseName, groupID, } // Create creates a user for the project. +// // See more: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/ func (s *DatabaseUsersServiceOp) Create(ctx context.Context, groupID string, createRequest *DatabaseUser) (*DatabaseUser, *Response, error) { if createRequest == nil { @@ -193,6 +197,7 @@ func (s *DatabaseUsersServiceOp) Create(ctx context.Context, groupID string, cre } // Update updates a user for the project. +// // See more: https://docs.atlas.mongodb.com/reference/api/database-users-update-a-user/ func (s *DatabaseUsersServiceOp) Update(ctx context.Context, groupID, username string, updateRequest *DatabaseUser) (*DatabaseUser, *Response, error) { if updateRequest == nil { @@ -218,6 +223,7 @@ func (s *DatabaseUsersServiceOp) Update(ctx context.Context, groupID, username s } // Delete deletes a user for the project. +// // See more: https://docs.atlas.mongodb.com/reference/api/database-users-delete-a-user/ func (s *DatabaseUsersServiceOp) Delete(ctx context.Context, databaseName, groupID, username string) (*Response, error) { if databaseName == "" { diff --git a/mongodbatlas/encryptions_at_rest.go b/mongodbatlas/encryptions_at_rest.go index 2693a3794..a12f965a2 100644 --- a/mongodbatlas/encryptions_at_rest.go +++ b/mongodbatlas/encryptions_at_rest.go @@ -121,6 +121,7 @@ type GoogleCloudKms struct { } // Create takes one on-demand snapshot. Atlas takes on-demand snapshots immediately, unlike scheduled snapshots which occur at regular intervals. +// // See more: https://docs.atlas.mongodb.com/reference/api/enable-configure-encryptionatrest/ func (s *EncryptionsAtRestServiceOp) Create(ctx context.Context, createRequest *EncryptionAtRest) (*EncryptionAtRest, *Response, error) { if createRequest == nil { @@ -146,6 +147,7 @@ func (s *EncryptionsAtRestServiceOp) Create(ctx context.Context, createRequest * } // Get retrieves the current configuration for Encryption at Rest for an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/get-configuration-encryptionatrest/ func (s *EncryptionsAtRestServiceOp) Get(ctx context.Context, groupID string) (*EncryptionAtRest, *Response, error) { if groupID == "" { @@ -169,6 +171,7 @@ func (s *EncryptionsAtRestServiceOp) Get(ctx context.Context, groupID string) (* } // Delete disable the AWS, Azure and Google Encryption at Rest. +// // See more: https://docs.atlas.mongodb.com/reference/api/enable-configure-encryptionatrest/ func (s *EncryptionsAtRestServiceOp) Delete(ctx context.Context, groupID string) (*Response, error) { if groupID == "" { diff --git a/mongodbatlas/events.go b/mongodbatlas/events.go index 412230cdf..3a8a0eb8d 100644 --- a/mongodbatlas/events.go +++ b/mongodbatlas/events.go @@ -20,11 +20,14 @@ import ( "net/http" ) -const eventsPathProjects = "groups/%s/events" -const eventsPathOrganization = "orgs/%s/events" +const ( + eventsPathProjects = "groups/%s/events" + eventsPathOrganization = "orgs/%s/events" +) // EventsService is an interface for interfacing with the Events // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/events/ type EventsService interface { ListOrganizationEvents(context.Context, string, *EventListOptions) (*EventResponse, *Response, error) @@ -88,6 +91,7 @@ type EventListOptions struct { } // ListOrganizationEvents lists all events in the organization associated to {ORG-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/events-orgs-get-all/ func (s *EventsServiceOp) ListOrganizationEvents(ctx context.Context, orgID string, listOptions *EventListOptions) (*EventResponse, *Response, error) { if orgID == "" { @@ -116,6 +120,7 @@ func (s *EventsServiceOp) ListOrganizationEvents(ctx context.Context, orgID stri } // GetOrganizationEvent gets the alert specified to {EVENT-ID} from the organization associated to {ORG-ID}. +// // See more: https://docs.opsmanager.mongodb.com/current/reference/api/events/get-one-event-for-org/ func (s *EventsServiceOp) GetOrganizationEvent(ctx context.Context, orgID, eventID string) (*Event, *Response, error) { if orgID == "" { @@ -142,6 +147,7 @@ func (s *EventsServiceOp) GetOrganizationEvent(ctx context.Context, orgID, event } // ListProjectEvents lists all events in the project associated to {PROJECT-ID}. +// // See more: https://docs.opsmanager.mongodb.com/current/reference/api/events/get-all-events-for-project/ func (s *EventsServiceOp) ListProjectEvents(ctx context.Context, groupID string, listOptions *EventListOptions) (*EventResponse, *Response, error) { if groupID == "" { @@ -170,6 +176,7 @@ func (s *EventsServiceOp) ListProjectEvents(ctx context.Context, groupID string, } // GetProjectEvent gets the alert specified to {EVENT-ID} from the project associated to {PROJECT-ID}. +// // See more: https://docs.opsmanager.mongodb.com/current/reference/api/events/get-one-event-for-project/ func (s *EventsServiceOp) GetProjectEvent(ctx context.Context, groupID, eventID string) (*Event, *Response, error) { if groupID == "" { diff --git a/mongodbatlas/global_clusters.go b/mongodbatlas/global_clusters.go index e8abbb5bd..a7ae35890 100644 --- a/mongodbatlas/global_clusters.go +++ b/mongodbatlas/global_clusters.go @@ -24,6 +24,7 @@ const globalClustersBasePath = "groups/%s/clusters/%s/globalWrites/%s" // GlobalClustersService is an interface for interfacing with the Global Clusters // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/global-clusters/ type GlobalClustersService interface { Get(context.Context, string, string) (*GlobalCluster, *Response, error) @@ -64,6 +65,7 @@ type CustomZoneMapping struct { } // Get retrieves all managed namespaces and custom zone mappings associated with the specified Global Cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-retrieve-namespaces/ func (s *GlobalClustersServiceOp) Get(ctx context.Context, groupID, clusterName string) (*GlobalCluster, *Response, error) { if clusterName == "" { @@ -87,6 +89,7 @@ func (s *GlobalClustersServiceOp) Get(ctx context.Context, groupID, clusterName } // AddManagedNamespace adds a managed namespace to the specified Global Cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/ func (s *GlobalClustersServiceOp) AddManagedNamespace(ctx context.Context, groupID, clusterName string, createRequest *ManagedNamespace) (*GlobalCluster, *Response, error) { if createRequest == nil { @@ -110,6 +113,7 @@ func (s *GlobalClustersServiceOp) AddManagedNamespace(ctx context.Context, group } // DeleteManagedNamespace deletes the managed namespace configuration of the global cluster given. +// // See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-delete-namespace/ func (s *GlobalClustersServiceOp) DeleteManagedNamespace(ctx context.Context, groupID, clusterName string, deleteRequest *ManagedNamespace) (*GlobalCluster, *Response, error) { if deleteRequest == nil { @@ -138,6 +142,7 @@ func (s *GlobalClustersServiceOp) DeleteManagedNamespace(ctx context.Context, gr } // AddCustomZoneMappings adds an entry to the list of custom zone mappings for the specified Global Cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-add-customzonemapping/ func (s *GlobalClustersServiceOp) AddCustomZoneMappings(ctx context.Context, groupID, clusterName string, createRequest *CustomZoneMappingsRequest) (*GlobalCluster, *Response, error) { if createRequest == nil { @@ -161,6 +166,7 @@ func (s *GlobalClustersServiceOp) AddCustomZoneMappings(ctx context.Context, gro } // DeleteCustomZoneMappings removes all custom zone mappings from the specified Global Cluster. +// // See more: https://docs.atlas.mongodb.com/reference/api/global-clusters-delete-namespace/ func (s *GlobalClustersServiceOp) DeleteCustomZoneMappings(ctx context.Context, groupID, clusterName string) (*GlobalCluster, *Response, error) { path := fmt.Sprintf(globalClustersBasePath, groupID, clusterName, "customZoneMapping") diff --git a/mongodbatlas/logs.go b/mongodbatlas/logs.go index bdc517b1c..98032ac44 100644 --- a/mongodbatlas/logs.go +++ b/mongodbatlas/logs.go @@ -44,6 +44,7 @@ type DateRangetOptions struct { // Get gets a compressed (.gz) log file that contains a range of log messages for a particular host. // Note: The input parameter out (io.Writer) is not closed by this function. +// // See more: https://docs.atlas.mongodb.com/reference/api/logs/ func (s *LogsServiceOp) Get(ctx context.Context, groupID, hostName, logName string, out io.Writer, opts *DateRangetOptions) (*Response, error) { if groupID == "" { diff --git a/mongodbatlas/maintenance.go b/mongodbatlas/maintenance.go index 67cde3f25..38092593b 100644 --- a/mongodbatlas/maintenance.go +++ b/mongodbatlas/maintenance.go @@ -40,6 +40,7 @@ const ( // MaintenanceWindowsService is an interface for interfacing with the Maintenance Windows // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/maintenance-windows/ type MaintenanceWindowsService interface { Get(context.Context, string) (*MaintenanceWindow, *Response, error) @@ -63,6 +64,7 @@ type MaintenanceWindow struct { } // Get gets the current user-defined maintenance window for the given project. +// // See more: https://docs.atlas.mongodb.com/reference/api/maintenance-windows-view-in-one-project/ func (s *MaintenanceWindowsServiceOp) Get(ctx context.Context, groupID string) (*MaintenanceWindow, *Response, error) { if groupID == "" { @@ -85,6 +87,7 @@ func (s *MaintenanceWindowsServiceOp) Get(ctx context.Context, groupID string) ( } // Update the current maintenance window for the given project. +// // See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-update/ func (s *MaintenanceWindowsServiceOp) Update(ctx context.Context, groupID string, updateRequest *MaintenanceWindow) (*Response, error) { if updateRequest == nil { @@ -110,6 +113,7 @@ func (s *MaintenanceWindowsServiceOp) Update(ctx context.Context, groupID string } // Defer maintenance for the given project for one week. +// // See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-defer/ func (s *MaintenanceWindowsServiceOp) Defer(ctx context.Context, groupID string) (*Response, error) { if groupID == "" { @@ -129,6 +133,7 @@ func (s *MaintenanceWindowsServiceOp) Defer(ctx context.Context, groupID string) } // Reset clears the current maintenance window for the given project. +// // See more: https://docs.atlas.mongodb.com/reference/api/maintenance-window-clear/ func (s *MaintenanceWindowsServiceOp) Reset(ctx context.Context, groupID string) (*Response, error) { if groupID == "" { diff --git a/mongodbatlas/private_endpoints.go b/mongodbatlas/private_endpoints.go index f9019a051..bb1f12afc 100644 --- a/mongodbatlas/private_endpoints.go +++ b/mongodbatlas/private_endpoints.go @@ -29,7 +29,7 @@ const ( // PrivateEndpointsService is an interface for interfacing with the Private Endpoints // of the MongoDB Atlas API. // -// See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint/ +// See more: https://docs.atlas.mongodb.com/reference/api/private-endpoints/ type PrivateEndpointsService interface { Create(context.Context, string, *PrivateEndpointConnection) (*PrivateEndpointConnection, *Response, error) Get(context.Context, string, string, string) (*PrivateEndpointConnection, *Response, error) diff --git a/mongodbatlas/private_endpoints_deprecated.go b/mongodbatlas/private_endpoints_deprecated.go index a253dff3e..811021cc4 100644 --- a/mongodbatlas/private_endpoints_deprecated.go +++ b/mongodbatlas/private_endpoints_deprecated.go @@ -22,6 +22,7 @@ import ( // PrivateEndpointsServiceDeprecated is an interface for interfacing with the Private Endpoints // of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint/ type PrivateEndpointsServiceDeprecated interface { Create(context.Context, string, *PrivateEndpointConnectionDeprecated) (*PrivateEndpointConnectionDeprecated, *Response, error) @@ -59,6 +60,7 @@ type InterfaceEndpointConnectionDeprecated struct { } // Create one private endpoint connection in an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-create-one-private-endpoint-connection/ func (s *PrivateEndpointsServiceOpDeprecated) Create(ctx context.Context, groupID string, createRequest *PrivateEndpointConnectionDeprecated) (*PrivateEndpointConnectionDeprecated, *Response, error) { if groupID == "" { @@ -85,6 +87,7 @@ func (s *PrivateEndpointsServiceOpDeprecated) Create(ctx context.Context, groupI } // Get retrieves details for one private endpoint connection by ID in an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-get-one-private-endpoint-connection/ func (s *PrivateEndpointsServiceOpDeprecated) Get(ctx context.Context, groupID, privateLinkID string) (*PrivateEndpointConnectionDeprecated, *Response, error) { if groupID == "" { @@ -112,6 +115,7 @@ func (s *PrivateEndpointsServiceOpDeprecated) Get(ctx context.Context, groupID, } // List retrieves details for all private endpoint connections in an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-get-all-private-endpoint-connections/ func (s *PrivateEndpointsServiceOpDeprecated) List(ctx context.Context, groupID string, listOptions *ListOptions) ([]PrivateEndpointConnectionDeprecated, *Response, error) { if groupID == "" { @@ -141,6 +145,7 @@ func (s *PrivateEndpointsServiceOpDeprecated) List(ctx context.Context, groupID } // Delete removes one private endpoint connection in an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-delete-one-private-endpoint-connection/ func (s *PrivateEndpointsServiceOpDeprecated) Delete(ctx context.Context, groupID, privateLinkID string) (*Response, error) { if groupID == "" { @@ -162,6 +167,7 @@ func (s *PrivateEndpointsServiceOpDeprecated) Delete(ctx context.Context, groupI } // AddOneInterfaceEndpoint adds one interface endpoint to a private endpoint connection in an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-create-one-interface-endpoint/ func (s *PrivateEndpointsServiceOpDeprecated) AddOneInterfaceEndpoint(ctx context.Context, groupID, privateLinkID, interfaceEndpointID string) (*InterfaceEndpointConnectionDeprecated, *Response, error) { if groupID == "" { @@ -192,6 +198,7 @@ func (s *PrivateEndpointsServiceOpDeprecated) AddOneInterfaceEndpoint(ctx contex } // GetOneInterfaceEndpoint retrieves one interface endpoint in a private endpoint connection in an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-get-one-interface-endpoint/ func (s *PrivateEndpointsServiceOpDeprecated) GetOneInterfaceEndpoint(ctx context.Context, groupID, privateLinkID, interfaceEndpointID string) (*InterfaceEndpointConnectionDeprecated, *Response, error) { if groupID == "" { @@ -222,6 +229,7 @@ func (s *PrivateEndpointsServiceOpDeprecated) GetOneInterfaceEndpoint(ctx contex } // DeleteOneInterfaceEndpoint removes one interface endpoint from a private endpoint connection in an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/private-endpoint-delete-one-interface-endpoint/ func (s *PrivateEndpointsServiceOpDeprecated) DeleteOneInterfaceEndpoint(ctx context.Context, groupID, privateLinkID, interfaceEndpointID string) (*Response, error) { if groupID == "" { diff --git a/mongodbatlas/private_ip_mode.go b/mongodbatlas/private_ip_mode.go index 084d96ef5..4afcafc99 100644 --- a/mongodbatlas/private_ip_mode.go +++ b/mongodbatlas/private_ip_mode.go @@ -24,6 +24,7 @@ const privateIPModePath = "groups/%s/privateIpMode" // PrivateIPModeService is an interface for interfacing with the PrivateIpMode // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/get-private-ip-mode-for-project/ type PrivateIPModeService interface { Get(context.Context, string) (*PrivateIPMode, *Response, error) @@ -42,6 +43,7 @@ type PrivateIPMode struct { } // Get Verify Connect via Peering Only Mode from the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/get-private-ip-mode-for-project/ func (s *PrivateIPModeServiceOp) Get(ctx context.Context, groupID string) (*PrivateIPMode, *Response, error) { path := fmt.Sprintf(privateIPModePath, groupID) @@ -60,7 +62,8 @@ func (s *PrivateIPModeServiceOp) Get(ctx context.Context, groupID string) (*Priv return root, resp, err } -// Update connection via Peering Only Mode in the project associated to {GROUP-ID} +// Update connection via Peering Only Mode in the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/set-private-ip-mode-for-project/ func (s *PrivateIPModeServiceOp) Update(ctx context.Context, groupID string, updateRequest *PrivateIPMode) (*PrivateIPMode, *Response, error) { if updateRequest == nil { diff --git a/mongodbatlas/process_database_measurements.go b/mongodbatlas/process_database_measurements.go index 6770fb083..bb5bed5e8 100644 --- a/mongodbatlas/process_database_measurements.go +++ b/mongodbatlas/process_database_measurements.go @@ -24,6 +24,7 @@ const processDatabaseMeasurementsPath = processesDatabasesPath + "/%s/measuremen // ProcessDatabaseMeasurementsService is an interface for interfacing with the process database measurements // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/process-databases-measurements/ type ProcessDatabaseMeasurementsService interface { List(context.Context, string, string, int, string, *ProcessMeasurementListOptions) (*ProcessDatabaseMeasurements, *Response, error) @@ -42,6 +43,7 @@ type ProcessDatabaseMeasurements struct { var _ ProcessDatabaseMeasurementsService = &ProcessDatabaseMeasurementsServiceOp{} // List list measurements for a specific Atlas MongoDB database. +// // See more: https://docs.atlas.mongodb.com/reference/api/process-databases-measurements/ func (s *ProcessDatabaseMeasurementsServiceOp) List(ctx context.Context, groupID, hostName string, port int, databaseName string, opts *ProcessMeasurementListOptions) (*ProcessDatabaseMeasurements, *Response, error) { if groupID == "" { diff --git a/mongodbatlas/process_disk_measurements.go b/mongodbatlas/process_disk_measurements.go index 391db8be7..df24704a8 100644 --- a/mongodbatlas/process_disk_measurements.go +++ b/mongodbatlas/process_disk_measurements.go @@ -42,6 +42,7 @@ type ProcessDiskMeasurements struct { var _ ProcessDiskMeasurementsService = &ProcessDiskMeasurementsServiceOp{} // List lists measurements for a specific Atlas MongoDB disk. +// // See more: https://docs.atlas.mongodb.com/reference/api/process-disks-measurements/#get-measurements-of-a-disk-for-a-mongodb-process func (s *ProcessDiskMeasurementsServiceOp) List(ctx context.Context, groupID, hostName string, port int, diskName string, opts *ProcessMeasurementListOptions) (*ProcessDiskMeasurements, *Response, error) { if groupID == "" { diff --git a/mongodbatlas/process_disks.go b/mongodbatlas/process_disks.go index 7e9f713cc..335c28d69 100644 --- a/mongodbatlas/process_disks.go +++ b/mongodbatlas/process_disks.go @@ -24,6 +24,7 @@ const processesDisksPath = "groups/%s/processes/%s:%d/disks" // ProcessDisksService is an interface for interfacing with the Process Measurements // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/process-disks/ type ProcessDisksService interface { List(context.Context, string, string, int, *ListOptions) (*ProcessDisksResponse, *Response, error) @@ -49,6 +50,7 @@ type ProcessDisk struct { } // List gets partitions for a specific Atlas MongoDB process. +// // See more: https://docs.atlas.mongodb.com/reference/api/process-disks/ func (s *ProcessDisksServiceOp) List(ctx context.Context, groupID, host string, port int, opts *ListOptions) (*ProcessDisksResponse, *Response, error) { if groupID == "" { diff --git a/mongodbatlas/process_measurements.go b/mongodbatlas/process_measurements.go index f7c21ae1f..6ed2274e1 100644 --- a/mongodbatlas/process_measurements.go +++ b/mongodbatlas/process_measurements.go @@ -24,6 +24,7 @@ const processMeasurementsPath = "groups/%s/processes/%s:%d/measurements" // ProcessMeasurementsService is an interface for interfacing with the Process Measurements // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/process-measurements/ type ProcessMeasurementsService interface { List(context.Context, string, string, int, *ProcessMeasurementListOptions) (*ProcessMeasurements, *Response, error) @@ -71,6 +72,7 @@ type ProcessMeasurementListOptions struct { } // List lists measurements for a specific Atlas MongoDB process. +// // See more: https://docs.atlas.mongodb.com/reference/api/process-measurements/ func (s *ProcessMeasurementsServiceOp) List(ctx context.Context, groupID, host string, port int, opts *ProcessMeasurementListOptions) (*ProcessMeasurements, *Response, error) { if groupID == "" { diff --git a/mongodbatlas/project_api_key.go b/mongodbatlas/project_api_key.go index d3830ac58..fece663b4 100644 --- a/mongodbatlas/project_api_key.go +++ b/mongodbatlas/project_api_key.go @@ -24,6 +24,7 @@ const projectAPIKeysPath = "groups/%s/apiKeys" // ProjectAPIKeysService is an interface for interfacing with the APIKeys // endpoints of the MongoDB Atlas API. +// // See more: https://docs.atlas.mongodb.com/reference/api/apiKeys/#organization-api-keys-on-projects-endpoints type ProjectAPIKeysService interface { List(context.Context, string, *ListOptions) ([]APIKey, *Response, error) @@ -44,6 +45,7 @@ type AssignAPIKey struct { } // List all API-KEY in the organization associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/get-all-apiKeys-in-one-project/ func (s *ProjectAPIKeysOp) List(ctx context.Context, groupID string, listOptions *ListOptions) ([]APIKey, *Response, error) { path := fmt.Sprintf(projectAPIKeysPath, groupID) @@ -73,6 +75,7 @@ func (s *ProjectAPIKeysOp) List(ctx context.Context, groupID string, listOptions } // Create an API Key by the {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/create-one-apiKey-in-one-project/ func (s *ProjectAPIKeysOp) Create(ctx context.Context, groupID string, createRequest *APIKeyInput) (*APIKey, *Response, error) { if createRequest == nil { @@ -96,6 +99,7 @@ func (s *ProjectAPIKeysOp) Create(ctx context.Context, groupID string, createReq } // Assign an API-KEY related to {GROUP-ID} to a the project with {API-KEY-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/assign-one-org-apiKey-to-one-project/ func (s *ProjectAPIKeysOp) Assign(ctx context.Context, groupID, keyID string, assignAPIKeyRequest *AssignAPIKey) (*Response, error) { if groupID == "" { @@ -121,6 +125,7 @@ func (s *ProjectAPIKeysOp) Assign(ctx context.Context, groupID, keyID string, as } // Unassign an API-KEY related to {GROUP-ID} to a the project with {API-KEY-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/delete-one-apiKey-in-one-project/ func (s *ProjectAPIKeysOp) Unassign(ctx context.Context, groupID, keyID string) (*Response, error) { if groupID == "" { diff --git a/mongodbatlas/project_ip_whitelist.go b/mongodbatlas/project_ip_whitelist.go index a4fa5afaa..48d645f80 100644 --- a/mongodbatlas/project_ip_whitelist.go +++ b/mongodbatlas/project_ip_whitelist.go @@ -91,6 +91,7 @@ func (s *ProjectIPWhitelistServiceOp) Create(ctx context.Context, groupID string } // Get gets the whitelist entry specified to {WHITELIST-ENTRY} from the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/whitelist-get-one-entry/ func (s *ProjectIPWhitelistServiceOp) Get(ctx context.Context, groupID, whiteListEntry string) (*ProjectIPWhitelist, *Response, error) { if whiteListEntry == "" { @@ -116,6 +117,7 @@ func (s *ProjectIPWhitelistServiceOp) Get(ctx context.Context, groupID, whiteLis } // List all whitelist entries in the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/whitelist-get-all/ func (s *ProjectIPWhitelistServiceOp) List(ctx context.Context, groupID string, listOptions *ListOptions) ([]ProjectIPWhitelist, *Response, error) { path := fmt.Sprintf(projectIPWhitelistPath, groupID) @@ -144,7 +146,8 @@ func (s *ProjectIPWhitelistServiceOp) List(ctx context.Context, groupID string, return root.Results, resp, nil } -// Update one or more whitelist entries in the project associated to {GROUP-ID} +// Update one or more whitelist entries in the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/whitelist-update-one/ func (s *ProjectIPWhitelistServiceOp) Update(ctx context.Context, groupID string, updateRequest []*ProjectIPWhitelist) ([]ProjectIPWhitelist, *Response, error) { if updateRequest == nil { @@ -172,6 +175,7 @@ func (s *ProjectIPWhitelistServiceOp) Update(ctx context.Context, groupID string } // Delete the whitelist entry specified to {WHITELIST-ENTRY} from the project associated to {GROUP-ID}. +// // See more: https://docs.atlas.mongodb.com/reference/api/whitelist-delete-one/ func (s *ProjectIPWhitelistServiceOp) Delete(ctx context.Context, groupID, whitelistEntry string) (*Response, error) { if whitelistEntry == "" { diff --git a/mongodbatlas/teams.go b/mongodbatlas/teams.go index 7123c72ff..51a011851 100644 --- a/mongodbatlas/teams.go +++ b/mongodbatlas/teams.go @@ -122,6 +122,9 @@ func (s *TeamsServiceOp) List(ctx context.Context, orgID string, listOptions *Li // // See more: https://docs.atlas.mongodb.com/reference/api/teams-get-one-by-id/ func (s *TeamsServiceOp) Get(ctx context.Context, orgID, teamID string) (*Team, *Response, error) { + if orgID == "" { + return nil, nil, NewArgError("orgID", "must be set") + } if teamID == "" { return nil, nil, NewArgError("teamID", "must be set") } @@ -147,6 +150,9 @@ func (s *TeamsServiceOp) Get(ctx context.Context, orgID, teamID string) (*Team, // // See more: https://docs.atlas.mongodb.com/reference/api/project-get-one-by-name/ func (s *TeamsServiceOp) GetOneTeamByName(ctx context.Context, orgID, teamName string) (*Team, *Response, error) { + if orgID == "" { + return nil, nil, NewArgError("orgID", "must be set") + } if teamName == "" { return nil, nil, NewArgError("teamName", "must be set") } @@ -175,6 +181,9 @@ func (s *TeamsServiceOp) GetTeamUsersAssigned(ctx context.Context, orgID, teamID if orgID == "" { return nil, nil, NewArgError("orgID", "must be set") } + if teamID == "" { + return nil, nil, NewArgError("teamID", "must be set") + } basePath := fmt.Sprintf(teamsBasePath, orgID) path := fmt.Sprintf("%s/%s/users", basePath, teamID) @@ -201,6 +210,9 @@ func (s *TeamsServiceOp) GetTeamUsersAssigned(ctx context.Context, orgID, teamID // // See more: https://docs.atlas.mongodb.com/reference/api/teams-create-one/ func (s *TeamsServiceOp) Create(ctx context.Context, orgID string, createRequest *Team) (*Team, *Response, error) { + if orgID == "" { + return nil, nil, NewArgError("orgID", "must be set") + } if createRequest == nil { return nil, nil, NewArgError("createRequest", "cannot be nil") } @@ -223,6 +235,12 @@ func (s *TeamsServiceOp) Create(ctx context.Context, orgID string, createRequest // // See more: https://docs.atlas.mongodb.com/reference/api/teams-rename-one/ func (s *TeamsServiceOp) Rename(ctx context.Context, orgID, teamID, teamName string) (*Team, *Response, error) { + if orgID == "" { + return nil, nil, NewArgError("orgID", "must be set") + } + if teamID == "" { + return nil, nil, NewArgError("teamID", "must be set") + } if teamName == "" { return nil, nil, NewArgError("teamName", "cannot be nil") } @@ -250,6 +268,12 @@ func (s *TeamsServiceOp) Rename(ctx context.Context, orgID, teamID, teamName str // // See more: https://docs.atlas.mongodb.com/reference/api/teams-update-roles/ func (s *TeamsServiceOp) UpdateTeamRoles(ctx context.Context, orgID, teamID string, updateTeamRolesRequest *TeamUpdateRoles) ([]TeamRoles, *Response, error) { + if orgID == "" { + return nil, nil, NewArgError("orgID", "must be set") + } + if teamID == "" { + return nil, nil, NewArgError("teamID", "must be set") + } if updateTeamRolesRequest == nil { return nil, nil, NewArgError("updateTeamRolesRequest", "cannot be nil") } @@ -278,6 +302,12 @@ func (s *TeamsServiceOp) UpdateTeamRoles(ctx context.Context, orgID, teamID stri // // See more: https://docs.atlas.mongodb.com/reference/api/teams-add-user/ func (s *TeamsServiceOp) AddUsersToTeam(ctx context.Context, orgID, teamID string, usersID []string) ([]AtlasUser, *Response, error) { + if orgID == "" { + return nil, nil, NewArgError("orgID", "must be set") + } + if teamID == "" { + return nil, nil, NewArgError("teamID", "must be set") + } if len(usersID) < 1 { return nil, nil, NewArgError("usersID", "cannot empty at leas one userID must be set") } @@ -313,6 +343,12 @@ func (s *TeamsServiceOp) AddUsersToTeam(ctx context.Context, orgID, teamID strin // // See more: https://docs.atlas.mongodb.com/reference/api/teams-remove-user/ func (s *TeamsServiceOp) RemoveUserToTeam(ctx context.Context, orgID, teamID, userID string) (*Response, error) { + if orgID == "" { + return nil, NewArgError("orgID", "must be set") + } + if teamID == "" { + return nil, NewArgError("teamID", "must be set") + } if userID == "" { return nil, NewArgError("userID", "cannot be nil") } @@ -337,6 +373,9 @@ func (s *TeamsServiceOp) RemoveUserToTeam(ctx context.Context, orgID, teamID, us // // See more: https://docs.atlas.mongodb.com/reference/api/teams-delete-one/ func (s *TeamsServiceOp) RemoveTeamFromOrganization(ctx context.Context, orgID, teamID string) (*Response, error) { + if orgID == "" { + return nil, NewArgError("orgID", "must be set") + } if teamID == "" { return nil, NewArgError("teamID", "cannot be nil") } @@ -361,6 +400,9 @@ func (s *TeamsServiceOp) RemoveTeamFromOrganization(ctx context.Context, orgID, // // See more: https://docs.atlas.mongodb.com/reference/api/teams-remove-from-project/ func (s *TeamsServiceOp) RemoveTeamFromProject(ctx context.Context, groupID, teamID string) (*Response, error) { + if groupID == "" { + return nil, NewArgError("groupID", "must be set") + } if teamID == "" { return nil, NewArgError("teamID", "cannot be nil") } diff --git a/mongodbatlas/whitelist_api_keys.go b/mongodbatlas/whitelist_api_keys.go index 2be188b94..ecbdd3f7a 100644 --- a/mongodbatlas/whitelist_api_keys.go +++ b/mongodbatlas/whitelist_api_keys.go @@ -69,6 +69,7 @@ type WhitelistAPIKeysReq struct { } // List gets all Whitelist API keys. +// // See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-org-whitelist-get-all/ func (s *WhitelistAPIKeysServiceOp) List(ctx context.Context, orgID, apiKeyID string, listOptions *ListOptions) (*WhitelistAPIKeys, *Response, error) { if orgID == "" { @@ -103,6 +104,7 @@ func (s *WhitelistAPIKeysServiceOp) List(ctx context.Context, orgID, apiKeyID st } // Get gets the Whitelist API keys. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-get-one/ func (s *WhitelistAPIKeysServiceOp) Get(ctx context.Context, orgID, apiKeyID, ipAddress string) (*WhitelistAPIKey, *Response, error) { if orgID == "" { @@ -131,7 +133,9 @@ func (s *WhitelistAPIKeysServiceOp) Get(ctx context.Context, orgID, apiKeyID, ip return root, resp, err } -// Create a submit a POST request containing ipAddress or cidrBlock values which are not already present in the whitelist, Atlas adds those entries to the list of existing entries in the whitelist. +// Create a submit a POST request containing ipAddress or cidrBlock values which are not already present in the whitelist, +// Atlas adds those entries to the list of existing entries in the whitelist. +// // See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-org-whitelist-create/ func (s *WhitelistAPIKeysServiceOp) Create(ctx context.Context, orgID, apiKeyID string, createRequest []*WhitelistAPIKeysReq) (*WhitelistAPIKeys, *Response, error) { if orgID == "" { @@ -161,6 +165,7 @@ func (s *WhitelistAPIKeysServiceOp) Create(ctx context.Context, orgID, apiKeyID } // Delete deletes the Whitelist API keys. +// // See more: https://docs.atlas.mongodb.com/reference/api/cloud-provider-snapshot-delete-one/ func (s *WhitelistAPIKeysServiceOp) Delete(ctx context.Context, orgID, apiKeyID, ipAddress string) (*Response, error) { if orgID == "" { diff --git a/mongodbatlas/x509_authentication_database_users.go b/mongodbatlas/x509_authentication_database_users.go index 3a2faf6d2..533119c88 100644 --- a/mongodbatlas/x509_authentication_database_users.go +++ b/mongodbatlas/x509_authentication_database_users.go @@ -25,6 +25,7 @@ const x509AuthDBUsersPath = "groups/%s/databaseUsers/%s/certs" const x509CustomerAuthDBUserPath = "groups/%s/userSecurity" // X509AuthDBUsersService is an interface for interfacing with the x509 Authentication Database Users. +// // See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration/ type X509AuthDBUsersService interface { CreateUserCertificate(context.Context, string, string, int) (*UserCertificate, *Response, error) @@ -71,6 +72,7 @@ type CustomerX509 struct { } // CreateUserCertificate generates an Atlas-managed X.509 certificate for a MongoDB user that authenticates using X.509 certificates. +// // See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-create-certificate/ func (s *X509AuthDBUsersServiceOp) CreateUserCertificate(ctx context.Context, groupID, username string, monthsUntilExpiration int) (*UserCertificate, *Response, error) { if groupID == "" { @@ -107,6 +109,7 @@ func (s *X509AuthDBUsersServiceOp) CreateUserCertificate(ctx context.Context, gr } // GetUserCertificates gets a list of all Atlas-managed, unexpired certificates for a user. +// // See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-get-certificates/ func (s *X509AuthDBUsersServiceOp) GetUserCertificates(ctx context.Context, groupID, username string) ([]UserCertificate, *Response, error) { if groupID == "" { @@ -137,6 +140,7 @@ func (s *X509AuthDBUsersServiceOp) GetUserCertificates(ctx context.Context, grou } // SaveConfiguration saves a customer-managed X.509 configuration for an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-save/ func (s *X509AuthDBUsersServiceOp) SaveConfiguration(ctx context.Context, groupID string, customerX509 *CustomerX509) (*CustomerX509, *Response, error) { if groupID == "" { @@ -163,6 +167,7 @@ func (s *X509AuthDBUsersServiceOp) SaveConfiguration(ctx context.Context, groupI } // GetCurrentX509Conf gets the current customer-managed X.509 configuration details for an Atlas project. +// // See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-get-current/ func (s *X509AuthDBUsersServiceOp) GetCurrentX509Conf(ctx context.Context, groupID string) (*CustomerX509, *Response, error) { if groupID == "" { @@ -186,6 +191,7 @@ func (s *X509AuthDBUsersServiceOp) GetCurrentX509Conf(ctx context.Context, group } // DisableCustomerX509 clears customer-managed X.509 settings on a project. This disables customer-managed X.509. +// // See more: https://docs.atlas.mongodb.com/reference/api/x509-configuration-disable-advanced/ func (s *X509AuthDBUsersServiceOp) DisableCustomerX509(ctx context.Context, groupID string) (*Response, error) { if groupID == "" {