Skip to content

Commit

Permalink
docs fix godoc rendering (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
gssbzn committed Apr 12, 2021
1 parent 66fae8a commit 729c84c
Show file tree
Hide file tree
Showing 28 changed files with 157 additions and 17 deletions.
8 changes: 8 additions & 0 deletions mongodbatlas/alert_configurations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand All @@ -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 == "" {
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 == "" {
Expand All @@ -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"
Expand Down
8 changes: 7 additions & 1 deletion mongodbatlas/api_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 == "" {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 == "" {
Expand Down
2 changes: 2 additions & 0 deletions mongodbatlas/auditing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand All @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions mongodbatlas/checkpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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 == "" {
Expand Down
10 changes: 6 additions & 4 deletions mongodbatlas/cloud_provider_regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions mongodbatlas/cloud_provider_snapshot_backup_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 6 additions & 3 deletions mongodbatlas/cloud_provider_snapshot_restore_jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 == "" {
Expand Down
5 changes: 5 additions & 0 deletions mongodbatlas/cloud_provider_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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 == "" {
Expand Down
5 changes: 5 additions & 0 deletions mongodbatlas/custom_db_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 == "" {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 == "" {
Expand Down
4 changes: 1 addition & 3 deletions mongodbatlas/data_lakes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
6 changes: 6 additions & 0 deletions mongodbatlas/database_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 == "" {
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 == "" {
Expand Down

0 comments on commit 729c84c

Please sign in to comment.