├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── config.yml ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── autorelease.yaml │ ├── autoupdate-preview.yaml │ ├── autoupdate-prod.yaml │ ├── issues.yml │ ├── pr.yml │ ├── shellcheck.yml │ └── stale.yml ├── .github_changelog_generator ├── .gitignore ├── .golangci.yml ├── .mockery.yaml ├── .tool-versions ├── CODEOWNERS.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── MAINTENANCE.md ├── Makefile ├── README.md ├── SECURITY.md ├── admin ├── .gitignore ├── api_access_tracking.go ├── api_alert_configurations.go ├── api_alerts.go ├── api_atlas_search.go ├── api_auditing.go ├── api_aws_clusters_dns.go ├── api_cloud_backups.go ├── api_cloud_migration_service.go ├── api_cloud_provider_access.go ├── api_cluster_outage_simulation.go ├── api_clusters.go ├── api_collection_level_metrics.go ├── api_custom_database_roles.go ├── api_data_federation.go ├── api_data_lake_pipelines.go ├── api_database_users.go ├── api_encryption_at_rest_using_customer_key_management.go ├── api_events.go ├── api_federated_authentication.go ├── api_flex_clusters.go ├── api_flex_restore_jobs.go ├── api_flex_snapshots.go ├── api_global_clusters.go ├── api_invoices.go ├── api_ldap_configuration.go ├── api_legacy_backup.go ├── api_maintenance_windows_.go ├── api_mongo_db_cloud_users.go ├── api_monitoring_and_logs.go ├── api_network_peering.go ├── api_online_archive.go ├── api_organizations.go ├── api_performance_advisor.go ├── api_private_endpoint_services.go ├── api_programmatic_api_keys.go ├── api_project_ip_access_list.go ├── api_projects.go ├── api_push_based_log_export.go ├── api_resource_policies.go ├── api_rolling_index.go ├── api_root.go ├── api_serverless_instances.go ├── api_serverless_private_endpoints.go ├── api_service_accounts.go ├── api_shared_tier_restore_jobs.go ├── api_shared_tier_snapshots.go ├── api_streams.go ├── api_teams.go ├── api_third_party_integrations.go ├── api_x509_authentication.go ├── atlas_client.go ├── client.go ├── configuration.go ├── doc.go ├── model_access_list_item.go ├── model_account_details.go ├── model_acknowledge_alert.go ├── model_add_or_remove_group_role.go ├── model_add_or_remove_org_role.go ├── model_add_or_remove_user_from_team.go ├── model_add_user_to_team.go ├── model_advanced_auto_scaling_settings.go ├── model_advanced_compute_auto_scaling.go ├── model_advanced_disk_backup_snapshot_schedule_policy.go ├── model_alert_view_for_nds_group.go ├── model_alerts_notification_root_for_group.go ├── model_alerts_toggle.go ├── model_api_atlas_checkpoint.go ├── model_api_atlas_cluster_advanced_configuration.go ├── model_api_atlas_fts_analyzers.go ├── model_api_atlas_fts_analyzers_tokenizer.go ├── model_api_atlas_fts_mappings.go ├── model_api_atlas_invalid_policy.go ├── model_api_atlas_invalid_policy_error_detail.go ├── model_api_atlas_invalid_resource_policy_create_error.go ├── model_api_atlas_non_compliant_resource.go ├── model_api_atlas_policy.go ├── model_api_atlas_policy_create.go ├── model_api_atlas_policy_metadata.go ├── model_api_atlas_resource_policy.go ├── model_api_atlas_resource_policy_create.go ├── model_api_atlas_resource_policy_edit.go ├── model_api_atlas_resource_policy_metadata.go ├── model_api_atlas_snapshot_schedule.go ├── model_api_atlas_user_metadata.go ├── model_api_bson_timestamp.go ├── model_api_checkpoint_part.go ├── model_api_error.go ├── model_api_host_view_atlas.go ├── model_api_key.go ├── model_api_key_user_details.go ├── model_api_measurements_general_view_atlas.go ├── model_api_private_download_delivery_url.go ├── model_api_public_usage_details_query_request.go ├── model_api_search_deployment_request.go ├── model_api_search_deployment_response.go ├── model_api_search_deployment_spec.go ├── model_atlas_cluster_outage_simulation_outage_filter.go ├── model_atlas_organization.go ├── model_atlas_search_analyzer.go ├── model_atlas_tenant_cluster_upgrade_request20240805.go ├── model_audit_log.go ├── model_auth_federation_role_mapping.go ├── model_auto_export_policy.go ├── model_available_cloud_provider_region.go ├── model_available_clusters_deployment.go ├── model_aws_custom_dns_enabled.go ├── model_awskms_configuration.go ├── model_azure_key_vault.go ├── model_backup_compliance_on_demand_policy_item.go ├── model_backup_compliance_scheduled_policy_item.go ├── model_backup_label.go ├── model_backup_online_archive.go ├── model_backup_online_archive_create.go ├── model_backup_restore_job.go ├── model_backup_restore_job_delivery.go ├── model_backup_snapshot.go ├── model_backup_snapshot_part.go ├── model_backup_snapshot_retention.go ├── model_backup_tenant_snapshot.go ├── model_bad_request_detail.go ├── model_base_network_peering_connection_settings.go ├── model_base_search_index_create_request_definition.go ├── model_base_search_index_response_latest_definition.go ├── model_bi_connector.go ├── model_billing_invoice.go ├── model_billing_invoice_metadata.go ├── model_billing_payment.go ├── model_billing_refund.go ├── model_cloud_access_role_assignment.go ├── model_cloud_app_user.go ├── model_cloud_cluster.go ├── model_cloud_database_user.go ├── model_cloud_provider_access_awsiam_role.go ├── model_cloud_provider_access_awsiam_role_all_of.go ├── model_cloud_provider_access_azure_service_principal.go ├── model_cloud_provider_access_azure_service_principal_all_of.go ├── model_cloud_provider_access_feature_usage.go ├── model_cloud_provider_access_feature_usage_push_based_log_export_feature_id.go ├── model_cloud_provider_access_role.go ├── model_cloud_provider_access_role_request.go ├── model_cloud_provider_access_role_request_update.go ├── model_cloud_provider_access_roles.go ├── model_cloud_provider_container.go ├── model_cloud_provider_endpoint_service_request.go ├── model_cloud_provider_regions.go ├── model_cloud_region_config20240805.go ├── model_cloud_search_metrics.go ├── model_cluster_auto_scaling_settings.go ├── model_cluster_cloud_provider_instance_size.go ├── model_cluster_compute_auto_scaling.go ├── model_cluster_connection_strings.go ├── model_cluster_description20240805.go ├── model_cluster_description_auto_scaling_mode_configuration.go ├── model_cluster_description_connection_strings_private_endpoint.go ├── model_cluster_description_connection_strings_private_endpoint_endpoint.go ├── model_cluster_description_process_args20240805.go ├── model_cluster_free_auto_scaling.go ├── model_cluster_ip_addresses.go ├── model_cluster_outage_simulation.go ├── model_cluster_provider_settings.go ├── model_cluster_search_index.go ├── model_cluster_serverless_backup_options.go ├── model_cluster_status.go ├── model_coll_stats_ranked_namespaces.go ├── model_collation.go ├── model_component_label.go ├── model_connected_org_config.go ├── model_connected_org_config_role_assignment.go ├── model_control_plane_ip_addresses.go ├── model_cost_explorer_filter_request_body.go ├── model_cost_explorer_filter_response.go ├── model_create_atlas_organization_api_key.go ├── model_create_atlas_project_api_key.go ├── model_create_data_process_region.go ├── model_create_endpoint_request.go ├── model_create_gcp_forwarding_rule_request.go ├── model_create_organization_request.go ├── model_create_organization_response.go ├── model_create_push_based_log_export_project_request.go ├── model_criteria.go ├── model_custom_zone_mappings.go ├── model_data_expiration_rule.go ├── model_data_federation_azure_cloud_provider_config.go ├── model_data_federation_gcp_cloud_provider_config.go ├── model_data_federation_limit.go ├── model_data_federation_tenant_query_limit.go ├── model_data_lake_api_base.go ├── model_data_lake_atlas_store_read_concern.go ├── model_data_lake_atlas_store_read_preference.go ├── model_data_lake_atlas_store_read_preference_tag.go ├── model_data_lake_aws_cloud_provider_config.go ├── model_data_lake_cloud_provider_config.go ├── model_data_lake_data_process_region.go ├── model_data_lake_database_collection.go ├── model_data_lake_database_data_source_settings.go ├── model_data_lake_database_instance.go ├── model_data_lake_ingestion_pipeline.go ├── model_data_lake_pipelines_partition_field.go ├── model_data_lake_storage.go ├── model_data_lake_store_settings.go ├── model_data_lake_tenant.go ├── model_data_process_region.go ├── model_data_protection_settings20231001.go ├── model_database_inherited_role.go ├── model_database_permitted_namespace_resource.go ├── model_database_privilege_action.go ├── model_database_rolling_index_request.go ├── model_database_user_role.go ├── model_dataset_retention_policy.go ├── model_db_role_to_execute.go ├── model_db_user_tlsx509_settings.go ├── model_dedicated_hardware_spec20240805.go ├── model_delete_copied_backups20240805.go ├── model_destination.go ├── model_disk_backup_api_policy_item.go ├── model_disk_backup_copy_setting20240805.go ├── model_disk_backup_export_job.go ├── model_disk_backup_export_job_request.go ├── model_disk_backup_export_member.go ├── model_disk_backup_on_demand_snapshot_request.go ├── model_disk_backup_replica_set.go ├── model_disk_backup_restore_member.go ├── model_disk_backup_sharded_cluster_snapshot.go ├── model_disk_backup_sharded_cluster_snapshot_member.go ├── model_disk_backup_snapshot.go ├── model_disk_backup_snapshot_export_bucket_request.go ├── model_disk_backup_snapshot_export_bucket_response.go ├── model_disk_backup_snapshot_restore_job.go ├── model_disk_backup_snapshot_schedule20240805.go ├── model_disk_gb_auto_scaling.go ├── model_drop_index_suggestions_index.go ├── model_drop_index_suggestions_response.go ├── model_ear_private_endpoint.go ├── model_employee_access_grant.go ├── model_encryption_at_rest.go ├── model_endpoint_service.go ├── model_event_type_details.go ├── model_event_view_for_nds_group.go ├── model_event_view_for_org.go ├── model_export_status.go ├── model_extra_retention_setting.go ├── model_federated_user.go ├── model_federation_identity_provider.go ├── model_federation_identity_provider_update.go ├── model_federation_oidc_identity_provider.go ├── model_federation_oidc_identity_provider_update.go ├── model_field_transformation.go ├── model_field_violation.go ├── model_flex_backup_restore_job20241113.go ├── model_flex_backup_restore_job_create20241113.go ├── model_flex_backup_settings20241113.go ├── model_flex_backup_snapshot20241113.go ├── model_flex_backup_snapshot_download_create20241113.go ├── model_flex_cluster_description20241113.go ├── model_flex_cluster_description_create20241113.go ├── model_flex_cluster_description_update20241113.go ├── model_flex_cluster_metric_threshold.go ├── model_flex_connection_strings20241113.go ├── model_flex_provider_settings20241113.go ├── model_flex_provider_settings_create20241113.go ├── model_free_compute_auto_scaling_rules.go ├── model_fts_metric.go ├── model_gcp_consumer_forwarding_rule.go ├── model_geo_sharding20240805.go ├── model_google_cloud_kms.go ├── model_group.go ├── model_group_alerts_config.go ├── model_group_invitation.go ├── model_group_invitation_request.go ├── model_group_invitation_update_request.go ├── model_group_ip_addresses.go ├── model_group_maintenance_window.go ├── model_group_migration_request.go ├── model_group_paginated_event.go ├── model_group_role.go ├── model_group_role_assignment.go ├── model_group_service.go ├── model_group_service_account.go ├── model_group_service_account_request.go ├── model_group_service_account_role_assignment.go ├── model_group_service_account_update_request.go ├── model_group_settings.go ├── model_group_update.go ├── model_group_user_request.go ├── model_group_user_response.go ├── model_hardware_spec20240805.go ├── model_inbound_control_plane_cloud_provider_ip_addresses.go ├── model_index_options.go ├── model_ingestion_pipeline_run.go ├── model_ingestion_sink.go ├── model_ingestion_source.go ├── model_invoice_line_item.go ├── model_ldap_security_settings.go ├── model_ldap_verify_connectivity_job_request.go ├── model_ldap_verify_connectivity_job_request_params.go ├── model_ldap_verify_connectivity_job_request_validation.go ├── model_legacy_atlas_cluster.go ├── model_legacy_atlas_tenant_cluster_upgrade_request.go ├── model_legacy_replication_spec.go ├── model_link.go ├── model_link_atlas.go ├── model_live_import_available_project.go ├── model_live_import_validation.go ├── model_live_migration_request20240530.go ├── model_live_migration_response.go ├── model_managed_namespaces.go ├── model_mdb_available_version.go ├── model_measurement_disk_partition.go ├── model_measurements_coll_stats_latency_cluster.go ├── model_measurements_coll_stats_latency_host.go ├── model_measurements_indexes.go ├── model_measurements_non_index.go ├── model_mesurements_database.go ├── model_metric_data_point.go ├── model_metric_data_point_atlas.go ├── model_metrics_measurement.go ├── model_metrics_measurement_atlas.go ├── model_mongo_db_access_logs.go ├── model_mongo_db_access_logs_list.go ├── model_namespace_obj.go ├── model_namespaces.go ├── model_namespaces_request.go ├── model_network_permission_entry.go ├── model_network_permission_entry_status.go ├── model_number_metric_value.go ├── model_online_archive_schedule.go ├── model_org_federation_settings.go ├── model_org_group.go ├── model_org_paginated_event.go ├── model_org_service_account.go ├── model_org_service_account_request.go ├── model_org_service_account_update_request.go ├── model_org_user_request.go ├── model_org_user_response.go ├── model_org_user_roles_request.go ├── model_org_user_roles_response.go ├── model_org_user_update_request.go ├── model_organization_invitation.go ├── model_organization_invitation_group_role_assignments_request.go ├── model_organization_invitation_request.go ├── model_organization_invitation_update_request.go ├── model_organization_settings.go ├── model_outbound_control_plane_cloud_provider_ip_addresses.go ├── model_paginated_alert.go ├── model_paginated_alert_config.go ├── model_paginated_api_api_user.go ├── model_paginated_api_app_user.go ├── model_paginated_api_atlas_checkpoint.go ├── model_paginated_api_atlas_database_user.go ├── model_paginated_api_atlas_disk_backup_export_job.go ├── model_paginated_api_atlas_ear_private_endpoint.go ├── model_paginated_api_atlas_flex_backup_restore_job20241113.go ├── model_paginated_api_atlas_flex_backup_snapshot20241113.go ├── model_paginated_api_atlas_provider_regions.go ├── model_paginated_api_atlas_serverless_backup_restore_job.go ├── model_paginated_api_atlas_serverless_backup_snapshot.go ├── model_paginated_api_invoice.go ├── model_paginated_api_invoice_metadata.go ├── model_paginated_api_streams_connection.go ├── model_paginated_api_streams_private_link.go ├── model_paginated_api_streams_stream_processor_with_stats.go ├── model_paginated_api_streams_tenant.go ├── model_paginated_api_user_access_list_response.go ├── model_paginated_atlas_group.go ├── model_paginated_available_version.go ├── model_paginated_backup_snapshot.go ├── model_paginated_backup_snapshot_export_buckets.go ├── model_paginated_cloud_backup_replica_set.go ├── model_paginated_cloud_backup_restore_job.go ├── model_paginated_cloud_backup_sharded_cluster_snapshot.go ├── model_paginated_cloud_provider_container.go ├── model_paginated_cluster_description20240805.go ├── model_paginated_connected_org_configs.go ├── model_paginated_container_peer.go ├── model_paginated_database.go ├── model_paginated_disk_partition.go ├── model_paginated_event_type_details_response.go ├── model_paginated_federation_identity_provider.go ├── model_paginated_flex_clusters20241113.go ├── model_paginated_group_service_accounts.go ├── model_paginated_group_user.go ├── model_paginated_host_view_atlas.go ├── model_paginated_integration.go ├── model_paginated_network_access.go ├── model_paginated_online_archive.go ├── model_paginated_org_group.go ├── model_paginated_org_service_accounts.go ├── model_paginated_org_user.go ├── model_paginated_organization.go ├── model_paginated_pipeline_run.go ├── model_paginated_private_network_endpoint_id_entry.go ├── model_paginated_public_api_usage_details_line_item.go ├── model_paginated_restore_job.go ├── model_paginated_role_mapping.go ├── model_paginated_serverless_instance_description.go ├── model_paginated_service_account_group.go ├── model_paginated_service_account_ip_access_entry.go ├── model_paginated_snapshot.go ├── model_paginated_team.go ├── model_paginated_team_role.go ├── model_paginated_tenant_restore.go ├── model_paginated_tenant_snapshot.go ├── model_paginated_user_cert.go ├── model_partition_field.go ├── model_pem_file_info.go ├── model_pem_file_info_update.go ├── model_performance_advisor_index.go ├── model_performance_advisor_op_stats.go ├── model_performance_advisor_operation.go ├── model_performance_advisor_response.go ├── model_performance_advisor_shape.go ├── model_performance_advisor_slow_query.go ├── model_performance_advisor_slow_query_list.go ├── model_performance_advisor_slow_query_metrics.go ├── model_pin_fcv.go ├── model_pinned_namespaces.go ├── model_pipeline_run_stats.go ├── model_private_endpoint_hostname.go ├── model_private_ip_mode.go ├── model_private_link_endpoint.go ├── model_private_network_endpoint_id_entry.go ├── model_project_setting_item.go ├── model_protected_hours.go ├── model_public_api_usage_details_line_item.go ├── model_push_based_log_export_project.go ├── model_raw.go ├── model_region_spec.go ├── model_replication_spec20240805.go ├── model_resource_tag.go ├── model_restore_job_file_hash.go ├── model_sample_dataset_status.go ├── model_schema_advisor_item_recommendation.go ├── model_schema_advisor_namespace_triggers.go ├── model_schema_advisor_response.go ├── model_schema_advisor_trigger_details.go ├── model_search_index_create_request.go ├── model_search_index_definition_version.go ├── model_search_index_response.go ├── model_search_index_update_request.go ├── model_search_index_update_request_definition.go ├── model_search_mappings.go ├── model_search_synonym_mapping_definition.go ├── model_serverless_backup_restore_job.go ├── model_serverless_backup_snapshot.go ├── model_serverless_connection_strings_private_endpoint_item.go ├── model_serverless_connection_strings_private_endpoint_list.go ├── model_serverless_instance_description.go ├── model_serverless_instance_description_connection_strings.go ├── model_serverless_instance_description_create.go ├── model_serverless_instance_description_update.go ├── model_serverless_provider_settings.go ├── model_serverless_tenant_create_request.go ├── model_serverless_tenant_endpoint.go ├── model_serverless_tenant_endpoint_update.go ├── model_service_account_group.go ├── model_service_account_ip_access_list_entry.go ├── model_service_account_secret.go ├── model_service_account_secret_request.go ├── model_shard_entry.go ├── model_shard_keys.go ├── model_sharding_request.go ├── model_source.go ├── model_state_reason.go ├── model_stream_config.go ├── model_stream_processor_metric_threshold.go ├── model_streams_aws_connection_config.go ├── model_streams_connection.go ├── model_streams_data_process_region.go ├── model_streams_dlq.go ├── model_streams_kafka_authentication.go ├── model_streams_kafka_networking.go ├── model_streams_kafka_networking_access.go ├── model_streams_kafka_security.go ├── model_streams_matcher.go ├── model_streams_modify_stream_processor.go ├── model_streams_modify_stream_processor_options.go ├── model_streams_options.go ├── model_streams_private_link_connection.go ├── model_streams_processor.go ├── model_streams_processor_with_stats.go ├── model_streams_sample_connections.go ├── model_streams_start_stream_processor_with.go ├── model_streams_tenant.go ├── model_synonym_mapping_status_detail.go ├── model_synonym_source.go ├── model_system_status.go ├── model_target_org.go ├── model_target_org_request.go ├── model_team.go ├── model_team_response.go ├── model_team_role.go ├── model_team_update.go ├── model_tenant_restore.go ├── model_third_party_integration.go ├── model_trigger_ingestion_pipeline_request.go ├── model_update_atlas_organization_api_key.go ├── model_update_atlas_project_api_key.go ├── model_update_custom_db_role.go ├── model_update_group_roles_for_user.go ├── model_update_org_roles_for_user.go ├── model_usage_details_filter_request.go ├── model_user_access_list_request.go ├── model_user_access_list_response.go ├── model_user_access_role_assignment.go ├── model_user_cert.go ├── model_user_custom_db_role.go ├── model_user_scope.go ├── model_user_security.go ├── model_user_to_dn_mapping.go ├── model_vector_search_host_status_detail.go ├── model_vector_search_index_definition.go ├── model_vector_search_index_status_detail.go ├── model_vpc_peering_action_challenge.go ├── model_x509_certificate.go ├── model_x509_certificate_update.go ├── model_zone_mapping.go ├── response.go └── utils.go ├── auth ├── auth.go ├── clientcredentials │ ├── clientcredentials.go │ ├── clientcredentials_test.go │ ├── doc.go │ └── transport.go ├── code │ ├── device_flow.go │ ├── device_flow_test.go │ ├── doc.go │ ├── oauth.go │ ├── oauth_test.go │ └── token.go └── token.go ├── bin └── .keep ├── docs ├── README.md ├── doc_1_concepts.md ├── doc_2_error_handling.md ├── doc_3_migration.md ├── doc_4_authentication.md ├── doc_5_best_practices.md ├── doc_last_reference.md └── docs │ ├── AWSClustersDNSApi.md │ ├── AWSCustomDNSEnabled.md │ ├── AWSKMSConfiguration.md │ ├── AccessListItem.md │ ├── AccessTrackingApi.md │ ├── AccountDetails.md │ ├── AcknowledgeAlert.md │ ├── AddOrRemoveGroupRole.md │ ├── AddOrRemoveOrgRole.md │ ├── AddOrRemoveUserFromTeam.md │ ├── AddUserToTeam.md │ ├── AdvancedAutoScalingSettings.md │ ├── AdvancedComputeAutoScaling.md │ ├── AdvancedDiskBackupSnapshotSchedulePolicy.md │ ├── AlertConfigurationsApi.md │ ├── AlertViewForNdsGroup.md │ ├── AlertsApi.md │ ├── AlertsNotificationRootForGroup.md │ ├── AlertsToggle.md │ ├── ApiAtlasCheckpoint.md │ ├── ApiAtlasClusterAdvancedConfiguration.md │ ├── ApiAtlasFTSAnalyzers.md │ ├── ApiAtlasFTSAnalyzersTokenizer.md │ ├── ApiAtlasFTSMappings.md │ ├── ApiAtlasInvalidPolicy.md │ ├── ApiAtlasInvalidPolicyErrorDetail.md │ ├── ApiAtlasInvalidResourcePolicyCreateError.md │ ├── ApiAtlasNonCompliantResource.md │ ├── ApiAtlasPolicy.md │ ├── ApiAtlasPolicyCreate.md │ ├── ApiAtlasPolicyMetadata.md │ ├── ApiAtlasResourcePolicy.md │ ├── ApiAtlasResourcePolicyCreate.md │ ├── ApiAtlasResourcePolicyEdit.md │ ├── ApiAtlasResourcePolicyMetadata.md │ ├── ApiAtlasSnapshotSchedule.md │ ├── ApiAtlasUserMetadata.md │ ├── ApiBSONTimestamp.md │ ├── ApiCheckpointPart.md │ ├── ApiError.md │ ├── ApiHostViewAtlas.md │ ├── ApiKey.md │ ├── ApiKeyUserDetails.md │ ├── ApiMeasurementsGeneralViewAtlas.md │ ├── ApiPrivateDownloadDeliveryUrl.md │ ├── ApiPublicUsageDetailsQueryRequest.md │ ├── ApiSearchDeploymentRequest.md │ ├── ApiSearchDeploymentResponse.md │ ├── ApiSearchDeploymentSpec.md │ ├── AtlasClusterOutageSimulationOutageFilter.md │ ├── AtlasOrganization.md │ ├── AtlasSearchAnalyzer.md │ ├── AtlasSearchApi.md │ ├── AtlasTenantClusterUpgradeRequest20240805.md │ ├── AuditLog.md │ ├── AuditingApi.md │ ├── AuthFederationRoleMapping.md │ ├── AutoExportPolicy.md │ ├── AvailableCloudProviderRegion.md │ ├── AvailableClustersDeployment.md │ ├── AzureKeyVault.md │ ├── BackupComplianceOnDemandPolicyItem.md │ ├── BackupComplianceScheduledPolicyItem.md │ ├── BackupLabel.md │ ├── BackupOnlineArchive.md │ ├── BackupOnlineArchiveCreate.md │ ├── BackupRestoreJob.md │ ├── BackupRestoreJobDelivery.md │ ├── BackupSnapshot.md │ ├── BackupSnapshotPart.md │ ├── BackupSnapshotRetention.md │ ├── BackupTenantSnapshot.md │ ├── BadRequestDetail.md │ ├── BaseNetworkPeeringConnectionSettings.md │ ├── BaseSearchIndexCreateRequestDefinition.md │ ├── BaseSearchIndexResponseLatestDefinition.md │ ├── BiConnector.md │ ├── BillingInvoice.md │ ├── BillingInvoiceMetadata.md │ ├── BillingPayment.md │ ├── BillingRefund.md │ ├── CloudAccessRoleAssignment.md │ ├── CloudAppUser.md │ ├── CloudBackupsApi.md │ ├── CloudCluster.md │ ├── CloudDatabaseUser.md │ ├── CloudMigrationServiceApi.md │ ├── CloudProviderAccessAWSIAMRole.md │ ├── CloudProviderAccessAWSIAMRoleAllOf.md │ ├── CloudProviderAccessApi.md │ ├── CloudProviderAccessAzureServicePrincipal.md │ ├── CloudProviderAccessAzureServicePrincipalAllOf.md │ ├── CloudProviderAccessFeatureUsage.md │ ├── CloudProviderAccessFeatureUsagePushBasedLogExportFeatureId.md │ ├── CloudProviderAccessRole.md │ ├── CloudProviderAccessRoleRequest.md │ ├── CloudProviderAccessRoleRequestUpdate.md │ ├── CloudProviderAccessRoles.md │ ├── CloudProviderContainer.md │ ├── CloudProviderEndpointServiceRequest.md │ ├── CloudProviderRegions.md │ ├── CloudRegionConfig20240805.md │ ├── CloudSearchMetrics.md │ ├── ClusterAutoScalingSettings.md │ ├── ClusterCloudProviderInstanceSize.md │ ├── ClusterComputeAutoScaling.md │ ├── ClusterConnectionStrings.md │ ├── ClusterDescription20240805.md │ ├── ClusterDescriptionAutoScalingModeConfiguration.md │ ├── ClusterDescriptionConnectionStringsPrivateEndpoint.md │ ├── ClusterDescriptionConnectionStringsPrivateEndpointEndpoint.md │ ├── ClusterDescriptionProcessArgs20240805.md │ ├── ClusterFreeAutoScaling.md │ ├── ClusterIPAddresses.md │ ├── ClusterOutageSimulation.md │ ├── ClusterOutageSimulationApi.md │ ├── ClusterProviderSettings.md │ ├── ClusterSearchIndex.md │ ├── ClusterServerlessBackupOptions.md │ ├── ClusterStatus.md │ ├── ClustersApi.md │ ├── CollStatsRankedNamespaces.md │ ├── Collation.md │ ├── CollectionLevelMetricsApi.md │ ├── ComponentLabel.md │ ├── ConnectedOrgConfig.md │ ├── ConnectedOrgConfigRoleAssignment.md │ ├── ControlPlaneIPAddresses.md │ ├── CostExplorerFilterRequestBody.md │ ├── CostExplorerFilterResponse.md │ ├── CreateAtlasOrganizationApiKey.md │ ├── CreateAtlasProjectApiKey.md │ ├── CreateDataProcessRegion.md │ ├── CreateEndpointRequest.md │ ├── CreateGCPForwardingRuleRequest.md │ ├── CreateOrganizationRequest.md │ ├── CreateOrganizationResponse.md │ ├── CreatePushBasedLogExportProjectRequest.md │ ├── Criteria.md │ ├── CustomDatabaseRolesApi.md │ ├── CustomZoneMappings.md │ ├── DBRoleToExecute.md │ ├── DBUserTLSX509Settings.md │ ├── DataExpirationRule.md │ ├── DataFederationApi.md │ ├── DataFederationAzureCloudProviderConfig.md │ ├── DataFederationGCPCloudProviderConfig.md │ ├── DataFederationLimit.md │ ├── DataFederationTenantQueryLimit.md │ ├── DataLakeAWSCloudProviderConfig.md │ ├── DataLakeApiBase.md │ ├── DataLakeAtlasStoreReadConcern.md │ ├── DataLakeAtlasStoreReadPreference.md │ ├── DataLakeAtlasStoreReadPreferenceTag.md │ ├── DataLakeCloudProviderConfig.md │ ├── DataLakeDataProcessRegion.md │ ├── DataLakeDatabaseCollection.md │ ├── DataLakeDatabaseDataSourceSettings.md │ ├── DataLakeDatabaseInstance.md │ ├── DataLakeIngestionPipeline.md │ ├── DataLakePipelinesApi.md │ ├── DataLakePipelinesPartitionField.md │ ├── DataLakeStorage.md │ ├── DataLakeStoreSettings.md │ ├── DataLakeTenant.md │ ├── DataProcessRegion.md │ ├── DataProtectionSettings20231001.md │ ├── DatabaseInheritedRole.md │ ├── DatabasePermittedNamespaceResource.md │ ├── DatabasePrivilegeAction.md │ ├── DatabaseRollingIndexRequest.md │ ├── DatabaseUserRole.md │ ├── DatabaseUsersApi.md │ ├── DatasetRetentionPolicy.md │ ├── DedicatedHardwareSpec20240805.md │ ├── DeleteCopiedBackups20240805.md │ ├── Destination.md │ ├── DiskBackupApiPolicyItem.md │ ├── DiskBackupCopySetting20240805.md │ ├── DiskBackupExportJob.md │ ├── DiskBackupExportJobRequest.md │ ├── DiskBackupExportMember.md │ ├── DiskBackupOnDemandSnapshotRequest.md │ ├── DiskBackupReplicaSet.md │ ├── DiskBackupRestoreMember.md │ ├── DiskBackupShardedClusterSnapshot.md │ ├── DiskBackupShardedClusterSnapshotMember.md │ ├── DiskBackupSnapshot.md │ ├── DiskBackupSnapshotExportBucketRequest.md │ ├── DiskBackupSnapshotExportBucketResponse.md │ ├── DiskBackupSnapshotRestoreJob.md │ ├── DiskBackupSnapshotSchedule20240805.md │ ├── DiskGBAutoScaling.md │ ├── DropIndexSuggestionsIndex.md │ ├── DropIndexSuggestionsResponse.md │ ├── EARPrivateEndpoint.md │ ├── EmployeeAccessGrant.md │ ├── EncryptionAtRest.md │ ├── EncryptionAtRestUsingCustomerKeyManagementApi.md │ ├── EndpointService.md │ ├── EventTypeDetails.md │ ├── EventViewForNdsGroup.md │ ├── EventViewForOrg.md │ ├── EventsApi.md │ ├── ExportStatus.md │ ├── ExtraRetentionSetting.md │ ├── FTSMetric.md │ ├── FederatedAuthenticationApi.md │ ├── FederatedUser.md │ ├── FederationIdentityProvider.md │ ├── FederationIdentityProviderUpdate.md │ ├── FederationOidcIdentityProvider.md │ ├── FederationOidcIdentityProviderUpdate.md │ ├── FieldTransformation.md │ ├── FieldViolation.md │ ├── FlexBackupRestoreJob20241113.md │ ├── FlexBackupRestoreJobCreate20241113.md │ ├── FlexBackupSettings20241113.md │ ├── FlexBackupSnapshot20241113.md │ ├── FlexBackupSnapshotDownloadCreate20241113.md │ ├── FlexClusterDescription20241113.md │ ├── FlexClusterDescriptionCreate20241113.md │ ├── FlexClusterDescriptionUpdate20241113.md │ ├── FlexClusterMetricThreshold.md │ ├── FlexClustersApi.md │ ├── FlexConnectionStrings20241113.md │ ├── FlexProviderSettings20241113.md │ ├── FlexProviderSettingsCreate20241113.md │ ├── FlexRestoreJobsApi.md │ ├── FlexSnapshotsApi.md │ ├── FreeComputeAutoScalingRules.md │ ├── GCPConsumerForwardingRule.md │ ├── GeoSharding20240805.md │ ├── GlobalClustersApi.md │ ├── GoogleCloudKMS.md │ ├── Group.md │ ├── GroupAlertsConfig.md │ ├── GroupIPAddresses.md │ ├── GroupInvitation.md │ ├── GroupInvitationRequest.md │ ├── GroupInvitationUpdateRequest.md │ ├── GroupMaintenanceWindow.md │ ├── GroupMigrationRequest.md │ ├── GroupPaginatedEvent.md │ ├── GroupRole.md │ ├── GroupRoleAssignment.md │ ├── GroupService.md │ ├── GroupServiceAccount.md │ ├── GroupServiceAccountRequest.md │ ├── GroupServiceAccountRoleAssignment.md │ ├── GroupServiceAccountUpdateRequest.md │ ├── GroupSettings.md │ ├── GroupUpdate.md │ ├── GroupUserRequest.md │ ├── GroupUserResponse.md │ ├── HardwareSpec20240805.md │ ├── InboundControlPlaneCloudProviderIPAddresses.md │ ├── IndexOptions.md │ ├── IngestionPipelineRun.md │ ├── IngestionSink.md │ ├── IngestionSource.md │ ├── InvoiceLineItem.md │ ├── InvoicesApi.md │ ├── LDAPConfigurationApi.md │ ├── LDAPSecuritySettings.md │ ├── LDAPVerifyConnectivityJobRequest.md │ ├── LDAPVerifyConnectivityJobRequestParams.md │ ├── LDAPVerifyConnectivityJobRequestValidation.md │ ├── LegacyAtlasCluster.md │ ├── LegacyAtlasTenantClusterUpgradeRequest.md │ ├── LegacyBackupApi.md │ ├── LegacyReplicationSpec.md │ ├── Link.md │ ├── LinkAtlas.md │ ├── LiveImportAvailableProject.md │ ├── LiveImportValidation.md │ ├── LiveMigrationRequest20240530.md │ ├── LiveMigrationResponse.md │ ├── MaintenanceWindowsApi.md │ ├── ManagedNamespaces.md │ ├── MdbAvailableVersion.md │ ├── MeasurementDiskPartition.md │ ├── MeasurementsCollStatsLatencyCluster.md │ ├── MeasurementsCollStatsLatencyHost.md │ ├── MeasurementsIndexes.md │ ├── MeasurementsNonIndex.md │ ├── MesurementsDatabase.md │ ├── MetricDataPoint.md │ ├── MetricDataPointAtlas.md │ ├── MetricsMeasurement.md │ ├── MetricsMeasurementAtlas.md │ ├── MongoDBAccessLogs.md │ ├── MongoDBAccessLogsList.md │ ├── MongoDBCloudUsersApi.md │ ├── MonitoringAndLogsApi.md │ ├── NamespaceObj.md │ ├── Namespaces.md │ ├── NamespacesRequest.md │ ├── NetworkPeeringApi.md │ ├── NetworkPermissionEntry.md │ ├── NetworkPermissionEntryStatus.md │ ├── NumberMetricValue.md │ ├── OnlineArchiveApi.md │ ├── OnlineArchiveSchedule.md │ ├── OrgFederationSettings.md │ ├── OrgGroup.md │ ├── OrgPaginatedEvent.md │ ├── OrgServiceAccount.md │ ├── OrgServiceAccountRequest.md │ ├── OrgServiceAccountUpdateRequest.md │ ├── OrgUserRequest.md │ ├── OrgUserResponse.md │ ├── OrgUserRolesRequest.md │ ├── OrgUserRolesResponse.md │ ├── OrgUserUpdateRequest.md │ ├── OrganizationInvitation.md │ ├── OrganizationInvitationGroupRoleAssignmentsRequest.md │ ├── OrganizationInvitationRequest.md │ ├── OrganizationInvitationUpdateRequest.md │ ├── OrganizationSettings.md │ ├── OrganizationsApi.md │ ├── OutboundControlPlaneCloudProviderIPAddresses.md │ ├── PaginatedAlert.md │ ├── PaginatedAlertConfig.md │ ├── PaginatedApiApiUser.md │ ├── PaginatedApiAppUser.md │ ├── PaginatedApiAtlasCheckpoint.md │ ├── PaginatedApiAtlasDatabaseUser.md │ ├── PaginatedApiAtlasDiskBackupExportJob.md │ ├── PaginatedApiAtlasEARPrivateEndpoint.md │ ├── PaginatedApiAtlasFlexBackupRestoreJob20241113.md │ ├── PaginatedApiAtlasFlexBackupSnapshot20241113.md │ ├── PaginatedApiAtlasProviderRegions.md │ ├── PaginatedApiAtlasServerlessBackupRestoreJob.md │ ├── PaginatedApiAtlasServerlessBackupSnapshot.md │ ├── PaginatedApiInvoice.md │ ├── PaginatedApiInvoiceMetadata.md │ ├── PaginatedApiStreamsConnection.md │ ├── PaginatedApiStreamsPrivateLink.md │ ├── PaginatedApiStreamsStreamProcessorWithStats.md │ ├── PaginatedApiStreamsTenant.md │ ├── PaginatedApiUserAccessListResponse.md │ ├── PaginatedAtlasGroup.md │ ├── PaginatedAvailableVersion.md │ ├── PaginatedBackupSnapshot.md │ ├── PaginatedBackupSnapshotExportBuckets.md │ ├── PaginatedCloudBackupReplicaSet.md │ ├── PaginatedCloudBackupRestoreJob.md │ ├── PaginatedCloudBackupShardedClusterSnapshot.md │ ├── PaginatedCloudProviderContainer.md │ ├── PaginatedClusterDescription20240805.md │ ├── PaginatedConnectedOrgConfigs.md │ ├── PaginatedContainerPeer.md │ ├── PaginatedDatabase.md │ ├── PaginatedDiskPartition.md │ ├── PaginatedEventTypeDetailsResponse.md │ ├── PaginatedFederationIdentityProvider.md │ ├── PaginatedFlexClusters20241113.md │ ├── PaginatedGroupServiceAccounts.md │ ├── PaginatedGroupUser.md │ ├── PaginatedHostViewAtlas.md │ ├── PaginatedIntegration.md │ ├── PaginatedNetworkAccess.md │ ├── PaginatedOnlineArchive.md │ ├── PaginatedOrgGroup.md │ ├── PaginatedOrgServiceAccounts.md │ ├── PaginatedOrgUser.md │ ├── PaginatedOrganization.md │ ├── PaginatedPipelineRun.md │ ├── PaginatedPrivateNetworkEndpointIdEntry.md │ ├── PaginatedPublicApiUsageDetailsLineItem.md │ ├── PaginatedRestoreJob.md │ ├── PaginatedRoleMapping.md │ ├── PaginatedServerlessInstanceDescription.md │ ├── PaginatedServiceAccountGroup.md │ ├── PaginatedServiceAccountIPAccessEntry.md │ ├── PaginatedSnapshot.md │ ├── PaginatedTeam.md │ ├── PaginatedTeamRole.md │ ├── PaginatedTenantRestore.md │ ├── PaginatedTenantSnapshot.md │ ├── PaginatedUserCert.md │ ├── PartitionField.md │ ├── PemFileInfo.md │ ├── PemFileInfoUpdate.md │ ├── PerformanceAdvisorApi.md │ ├── PerformanceAdvisorIndex.md │ ├── PerformanceAdvisorOpStats.md │ ├── PerformanceAdvisorOperation.md │ ├── PerformanceAdvisorResponse.md │ ├── PerformanceAdvisorShape.md │ ├── PerformanceAdvisorSlowQuery.md │ ├── PerformanceAdvisorSlowQueryList.md │ ├── PerformanceAdvisorSlowQueryMetrics.md │ ├── PinFCV.md │ ├── PinnedNamespaces.md │ ├── PipelineRunStats.md │ ├── PrivateEndpointHostname.md │ ├── PrivateEndpointServicesApi.md │ ├── PrivateIPMode.md │ ├── PrivateLinkEndpoint.md │ ├── PrivateNetworkEndpointIdEntry.md │ ├── ProgrammaticAPIKeysApi.md │ ├── ProjectIPAccessListApi.md │ ├── ProjectSettingItem.md │ ├── ProjectsApi.md │ ├── ProtectedHours.md │ ├── PublicApiUsageDetailsLineItem.md │ ├── PushBasedLogExportApi.md │ ├── PushBasedLogExportProject.md │ ├── Raw.md │ ├── RegionSpec.md │ ├── ReplicationSpec20240805.md │ ├── ResourcePoliciesApi.md │ ├── ResourceTag.md │ ├── RestoreJobFileHash.md │ ├── RollingIndexApi.md │ ├── RootApi.md │ ├── SampleDatasetStatus.md │ ├── SchemaAdvisorItemRecommendation.md │ ├── SchemaAdvisorNamespaceTriggers.md │ ├── SchemaAdvisorResponse.md │ ├── SchemaAdvisorTriggerDetails.md │ ├── SearchIndexCreateRequest.md │ ├── SearchIndexDefinitionVersion.md │ ├── SearchIndexResponse.md │ ├── SearchIndexUpdateRequest.md │ ├── SearchIndexUpdateRequestDefinition.md │ ├── SearchMappings.md │ ├── SearchSynonymMappingDefinition.md │ ├── ServerlessBackupRestoreJob.md │ ├── ServerlessBackupSnapshot.md │ ├── ServerlessConnectionStringsPrivateEndpointItem.md │ ├── ServerlessConnectionStringsPrivateEndpointList.md │ ├── ServerlessInstanceDescription.md │ ├── ServerlessInstanceDescriptionConnectionStrings.md │ ├── ServerlessInstanceDescriptionCreate.md │ ├── ServerlessInstanceDescriptionUpdate.md │ ├── ServerlessInstancesApi.md │ ├── ServerlessPrivateEndpointsApi.md │ ├── ServerlessProviderSettings.md │ ├── ServerlessTenantCreateRequest.md │ ├── ServerlessTenantEndpoint.md │ ├── ServerlessTenantEndpointUpdate.md │ ├── ServiceAccountGroup.md │ ├── ServiceAccountIPAccessListEntry.md │ ├── ServiceAccountSecret.md │ ├── ServiceAccountSecretRequest.md │ ├── ServiceAccountsApi.md │ ├── ShardEntry.md │ ├── ShardKeys.md │ ├── ShardingRequest.md │ ├── SharedTierRestoreJobsApi.md │ ├── SharedTierSnapshotsApi.md │ ├── Source.md │ ├── StateReason.md │ ├── StreamConfig.md │ ├── StreamProcessorMetricThreshold.md │ ├── StreamsAWSConnectionConfig.md │ ├── StreamsApi.md │ ├── StreamsConnection.md │ ├── StreamsDLQ.md │ ├── StreamsDataProcessRegion.md │ ├── StreamsKafkaAuthentication.md │ ├── StreamsKafkaNetworking.md │ ├── StreamsKafkaNetworkingAccess.md │ ├── StreamsKafkaSecurity.md │ ├── StreamsMatcher.md │ ├── StreamsModifyStreamProcessor.md │ ├── StreamsModifyStreamProcessorOptions.md │ ├── StreamsOptions.md │ ├── StreamsPrivateLinkConnection.md │ ├── StreamsProcessor.md │ ├── StreamsProcessorWithStats.md │ ├── StreamsSampleConnections.md │ ├── StreamsStartStreamProcessorWith.md │ ├── StreamsTenant.md │ ├── SynonymMappingStatusDetail.md │ ├── SynonymSource.md │ ├── SystemStatus.md │ ├── TargetOrg.md │ ├── TargetOrgRequest.md │ ├── Team.md │ ├── TeamResponse.md │ ├── TeamRole.md │ ├── TeamUpdate.md │ ├── TeamsApi.md │ ├── TenantRestore.md │ ├── ThirdPartyIntegration.md │ ├── ThirdPartyIntegrationsApi.md │ ├── TriggerIngestionPipelineRequest.md │ ├── UpdateAtlasOrganizationApiKey.md │ ├── UpdateAtlasProjectApiKey.md │ ├── UpdateCustomDBRole.md │ ├── UpdateGroupRolesForUser.md │ ├── UpdateOrgRolesForUser.md │ ├── UsageDetailsFilterRequest.md │ ├── UserAccessListRequest.md │ ├── UserAccessListResponse.md │ ├── UserAccessRoleAssignment.md │ ├── UserCert.md │ ├── UserCustomDBRole.md │ ├── UserScope.md │ ├── UserSecurity.md │ ├── UserToDNMapping.md │ ├── VPCPeeringActionChallenge.md │ ├── VectorSearchHostStatusDetail.md │ ├── VectorSearchIndexDefinition.md │ ├── VectorSearchIndexStatusDetail.md │ ├── X509AuthenticationApi.md │ ├── X509Certificate.md │ ├── X509CertificateUpdate.md │ └── ZoneMapping.md ├── examples ├── README.md ├── aws_cluster │ └── aws.go ├── basic │ └── basic.go ├── db_users │ └── db_users.go ├── download │ └── downloadLogs.go ├── errors.go ├── go.mod ├── go.sum ├── invoice │ └── invoice.go ├── mock │ └── cluster_test.go ├── regions │ └── regions.go ├── retry │ └── retry.go ├── service_account_management │ └── sa_management.go └── service_account_token_store │ └── cached_token.go ├── githooks ├── pre-commit └── pre-push ├── go.mod ├── go.sum ├── internal └── core │ ├── client.go │ ├── constants.go │ ├── doc.go │ └── version.go ├── mockadmin ├── access_tracking_api.go ├── alert_configurations_api.go ├── alerts_api.go ├── atlas_search_api.go ├── auditing_api.go ├── aws_clusters_dns_api.go ├── cloud_backups_api.go ├── cloud_migration_service_api.go ├── cloud_provider_access_api.go ├── cluster_outage_simulation_api.go ├── clusters_api.go ├── collection_level_metrics_api.go ├── custom_database_roles_api.go ├── data_federation_api.go ├── data_lake_pipelines_api.go ├── database_users_api.go ├── encryption_at_rest_using_customer_key_management_api.go ├── events_api.go ├── federated_authentication_api.go ├── flex_clusters_api.go ├── flex_restore_jobs_api.go ├── flex_snapshots_api.go ├── global_clusters_api.go ├── invoices_api.go ├── ldap_configuration_api.go ├── legacy_backup_api.go ├── maintenance_windows_api.go ├── mongo_db_cloud_users_api.go ├── monitoring_and_logs_api.go ├── network_peering_api.go ├── online_archive_api.go ├── organizations_api.go ├── performance_advisor_api.go ├── private_endpoint_services_api.go ├── programmatic_api_keys_api.go ├── project_ip_access_list_api.go ├── projects_api.go ├── push_based_log_export_api.go ├── resource_policies_api.go ├── rolling_index_api.go ├── root_api.go ├── serverless_instances_api.go ├── serverless_private_endpoints_api.go ├── service_accounts_api.go ├── shared_tier_restore_jobs_api.go ├── shared_tier_snapshots_api.go ├── streams_api.go ├── teams_api.go ├── third_party_integrations_api.go └── x509_authentication_api.go ├── openapi ├── .keep ├── atlas-api-transformed.yaml ├── atlas-api.yaml └── versions.json ├── scripts ├── add-copy.sh └── toc.sh ├── test ├── example_client_test.go ├── generated │ └── .keep └── utils_test.go └── tools ├── .npmrc ├── CONTRIBUTING.md ├── Makefile ├── README.md ├── config ├── .go-ignore ├── .go-ignore-docs ├── .go-ignore-tests ├── config.yaml └── go-templates │ ├── README.mustache │ ├── api.mustache │ ├── api_doc.mustache │ ├── api_test.mustache │ ├── atlas_client.mustache │ ├── client.mustache │ ├── configuration.mustache │ ├── doc.mustache │ ├── gitignore.mustache │ ├── model.mustache │ ├── model_anyof.mustache │ ├── model_doc.mustache │ ├── model_enum.mustache │ ├── model_oneof.mustache │ ├── model_simple.mustache │ ├── nullable_model.mustache │ ├── openapi.mustache │ ├── partial_header.mustache │ ├── response.mustache │ ├── signing.mustache │ └── utils.mustache ├── openapitools.json ├── package-lock.json ├── package.json ├── releaser ├── README.md ├── breaking_changes │ ├── .keep │ ├── v20231115003.md │ ├── v20231115004.md │ ├── v20231115005.md │ ├── v20231115006.md │ ├── v20231115007.md │ ├── v20231115008.md │ ├── v20231115009.md │ ├── v20231115010.md │ ├── v20231115011.md │ ├── v20231115012.md │ ├── v20231115013.md │ ├── v20231115014.md │ ├── v20240530001.md │ ├── v20240530002.md │ ├── v20240530003.md │ ├── v20240530004.md │ ├── v20240530005.md │ ├── v20240805001.md │ ├── v20240805002.md │ ├── v20240805003.md │ ├── v20240805004.md │ ├── v20240805005.md │ ├── v20241023001.md │ ├── v20241023002.md │ ├── v20241113001.md │ ├── v20241113002.md │ ├── v20241113003.md │ ├── v20241113004.md │ ├── v20241113005.md │ ├── v20250219001.md │ ├── v20250312001.md │ ├── v20250312002.md │ └── v20250312003.md ├── scripts │ ├── breaking-changes.sh │ ├── extract-version.sh │ ├── new-version.sh │ ├── preview-version.sh │ ├── setghenv.sh │ ├── update-major-version.sh │ ├── update-minor-version.sh │ └── version-paths.sh └── templates │ ├── RELEASE_NOTES.tmpl │ └── VERSION.tmpl ├── scripts ├── fetch.sh ├── generate.sh ├── generate_docs.sh ├── generate_mocks.sh ├── generate_tests.sh └── transform.sh └── transformer ├── README.md ├── __tests__ ├── input.json ├── transformations-snapshots.js └── transformations.test.js └── src ├── atlasTransformations.js ├── discriminator.ignore.json ├── duplicate.ignore.json ├── engine ├── apifile.js ├── ignoreModel.js ├── readers.js ├── removeField.js ├── removeUnused.js └── transformers.js ├── field.transformations.json ├── name.ignore.json ├── oneOf.ignore.json ├── transform.js └── transformations ├── additionalPropertiesObject.js ├── allOf.js ├── anyOf.js ├── discriminator.js ├── fields.js ├── index.js ├── name.js ├── oneOf.js ├── removeEnums.js ├── removeInvalidParams.js ├── removeNullable.js ├── reorderResponseBodies.js └── swapArray.js /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Maintained by the API experience team 2 | * @mongodb/APIx-Integrations 3 | 4 | # All docs 5 | /docs @mongodb/docs-cloud-team 6 | 7 | # Docs exemptions 8 | /docs/docs @mongodb/APIx-Integrations 9 | /docs/doc_last_reference.md @mongodb/APIx-Integrations 10 | /docs/README.md @mongodb/APIx-Integrations 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | 14 | 15 | **Expected behavior** 16 | A clear and concise description of what you expected to happen. 17 | 18 | **Logs** 19 | If applicable, add logs to help explain your problem. 20 | 21 | **Desktop (please complete the following information):** 22 | - OS: [e.g. macOS] 23 | - Lib Version [e.g. 0.6.0] 24 | 25 | **Additional context** 26 | Add any other context about the problem here. 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: MongoDB Atlas Feature Request 4 | url: https://feedback.mongodb.com/forums/924145-atlas?category_id=370723 5 | about: Request a feature or up-vote an existing suggestion! 6 | - name: MongoDB Atlas Support 7 | url: https://support.mongodb.com/ 8 | about: Support is provided under MongoDB Atlas support plans. Please submit support questions within the Atlas UI. 9 | - name: MongoDB Atlas 10 | url: https://www.mongodb.com/cloud/atlas 11 | about: Learn more about MongoDB Atlas 12 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: gomod 4 | directory: "/" 5 | schedule: 6 | interval: weekly 7 | day: tuesday 8 | - package-ecosystem: gomod 9 | directory: "/examples" 10 | schedule: 11 | interval: monthly 12 | ignore: 13 | - dependency-name: "*" 14 | - package-ecosystem: github-actions 15 | directory: "/" 16 | schedule: 17 | interval: monthly 18 | day: tuesday 19 | - package-ecosystem: npm 20 | directory: "/tools" 21 | schedule: 22 | interval: weekly 23 | day: tuesday 24 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Please include a summary of the fix/feature/change, including any relevant motivation and context. 4 | 5 | Link to any related issue(s): 6 | 7 | ## Type of change: 8 | 9 | - [ ] Bug fix (non-breaking change which fixes an issue) 10 | - [ ] New feature (non-breaking change which adds functionality) 11 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 12 | - [ ] This change requires a documentation update 13 | 14 | ## Required Checklist: 15 | 16 | - [ ] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement) 17 | - [ ] I have added tests that prove my fix is effective or that my feature works 18 | - [ ] I have added any necessary documentation (if appropriate) 19 | - [ ] I have run `make fmt` and formatted my code 20 | 21 | ## Further comments 22 | 23 | -------------------------------------------------------------------------------- /.github/workflows/autorelease.yaml: -------------------------------------------------------------------------------- 1 | name: Autorelease 2 | on: 3 | workflow_dispatch: {} # workflow can be run manually 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - "internal/core/version.go" 9 | 10 | jobs: 11 | release: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 16 | - name: Release env 17 | working-directory: ./tools 18 | run: | 19 | ./releaser/scripts/setghenv.sh 20 | - name: Create Release 21 | uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 22 | with: 23 | body: ${{ env.RELEASE_NOTES }} 24 | tag_name: ${{ env.RELEASE_TAG }} 25 | name: ${{ env.RELEASE_TAG }} 26 | - name: Trigger Go proxy cache refresh 27 | run: | 28 | LATEST_SDK_TAG=$(curl -sSfL https://api.github.com/repos/mongodb/atlas-sdk-go/releases/latest | jq -r '.tag_name') 29 | LATEST_SDK_RELEASE=$(echo "${LATEST_SDK_TAG}" | cut -d '.' -f 1) 30 | echo "tag: ${LATEST_SDK_TAG}, release: ${LATEST_SDK_RELEASE}" 31 | curl -sSfL "https://proxy.golang.org/go.mongodb.org/atlas-sdk/${LATEST_SDK_RELEASE}/@v/${LATEST_SDK_TAG}.info" 32 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: CI 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | branches: 8 | - main 9 | pull_request: 10 | jobs: 11 | code-health: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 15 | - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 16 | with: 17 | go-version-file: go.mod 18 | cache: false # see https://github.com/golangci/golangci-lint-action/issues/807 19 | - name: lint 20 | uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 21 | with: 22 | version: v2.1.6 # Also update GOLANGCI_VERSION variable in Makefile when updating this version 23 | - name: tests 24 | run: make test 25 | - name: example-tests 26 | run: make test-examples 27 | 28 | build: 29 | needs: code-health # only run if code-health passes 30 | runs-on: ubuntu-latest 31 | steps: 32 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 33 | - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 34 | with: 35 | node-version: 20.x 36 | cache: npm 37 | cache-dependency-path: ./tools/package-lock.json 38 | - working-directory: ./tools 39 | run: | 40 | npm install 41 | npm run ci 42 | - run: make install-goimports 43 | - working-directory: ./tools 44 | run: | 45 | export PATH=${PATH}:`go env GOPATH`/bin 46 | make clean_and_generate 47 | - name: Fail when generate introducing diff 48 | run: | 49 | git diff --exit-code 50 | -------------------------------------------------------------------------------- /.github/workflows/shellcheck.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: shellcheck 3 | on: 4 | pull_request: 5 | paths: 6 | - "**/**.sh" 7 | 8 | jobs: 9 | shellcheck: 10 | name: shellcheck 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 14 | - name: Run ShellCheck 15 | uses: bewuethr/shellcheck-action@399ea5969c0215b8706a22205de0558cebdcc3cc 16 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Stale issues and PRs handler' 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 0 * * *' 7 | 8 | jobs: 9 | stale: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 13 | id: stale 14 | with: 15 | stale-issue-message: 'This issue has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!' 16 | stale-pr-message: 'This PR has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!' 17 | stale-issue-label: 'stale' 18 | stale-pr-label: 'stale' 19 | days-before-stale: 30 20 | days-before-close: 30 21 | exempt-pr-labels: 'not_stale' 22 | exempt-issue-labels: 'not_stale' 23 | -------------------------------------------------------------------------------- /.github_changelog_generator: -------------------------------------------------------------------------------- 1 | future-release=v0.25.0 2 | since-tag=v0.24.0 3 | date-format=%B %d, %Y 4 | base=CHANGELOG.md 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.dll 2 | *.exe 3 | .DS_Store 4 | .out 5 | bin/ 6 | modules-dev/ 7 | /pkg/ 8 | website/.vagrant 9 | website/.bundle 10 | website/build 11 | website/node_modules 12 | .vagrant/ 13 | *.backup 14 | ./*.tfstate 15 | .terraform/ 16 | *.log 17 | *.bak 18 | *~ 19 | .*.swp 20 | .idea 21 | *.iml 22 | *.test 23 | log.txt 24 | vendor/ 25 | .vscode/ 26 | 27 | 28 | # Test exclusions 29 | !command/test-fixtures/**/*.tfstate 30 | !command/test-fixtures/**/.terraform/ 31 | 32 | # Keep windows files with windows line endings 33 | *.winfile eol=crlf 34 | /.vs 35 | node_modules 36 | 37 | # Output of the go coverage tool 38 | *.out 39 | example_cluster_aws 40 | admin/api 41 | admin/.openapi-generator 42 | scripts/gh-md-toc 43 | docs/.openapi-generator/* 44 | 45 | /.trunk 46 | -------------------------------------------------------------------------------- /.mockery.yaml: -------------------------------------------------------------------------------- 1 | with-expecter: true 2 | disable-version-string: true 3 | dir: mockadmin 4 | outpkg: mockadmin 5 | filename: "{{ .InterfaceName | snakecase }}.go" 6 | mockname: "{{.InterfaceName}}" 7 | 8 | packages: 9 | go.mongodb.org/atlas-sdk/v20250312003/admin: 10 | config: 11 | include-regex: ".*Api" 12 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | nodejs 18.18.2 2 | 3 | -------------------------------------------------------------------------------- /CODEOWNERS.md: -------------------------------------------------------------------------------- 1 | Reviewers, please ensure that the CLA has been signed by referring to the [contributors tool](https://contributors.corp.mongodb.com) (internal link). 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project has adopted the [MongoDB Code of Conduct](https://www.mongodb.com/community-code-of-conduct). 4 | If you see any violations of the above or have any other concerns or questions please contact us 5 | using the following email alias: community-conduct@mongodb.com. 6 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SOURCE_FILES?=./... 2 | GOLANGCI_VERSION=v2.1.6 # Also update golangci-lint GH action in pr.yml when updating this version 3 | 4 | export GO111MODULE := on 5 | export PATH := ./bin:$(PATH) 6 | 7 | default: build 8 | 9 | .PHONY: link-git-hooks 10 | link-git-hooks: 11 | find .git/hooks -type l -exec rm {} \; 12 | find githooks -type f -exec ln -sf ../../{} .git/hooks/ \; 13 | 14 | .PHONY: build 15 | build: 16 | go install $(SOURCE_FILES) 17 | 18 | .PHONY: test 19 | test: 20 | go test $(SOURCE_FILES) -timeout=30s -parallel=4 -race 21 | 22 | .PHONY: test-examples 23 | test-examples: 24 | cd examples && go test ./... 25 | 26 | .PHONY: fmt 27 | fmt: 28 | @echo "==> Fixing source code with gofmt..." 29 | gofmt -s -w ./**/**/*.go 30 | 31 | .PHONY: lint-fix 32 | lint-fix: 33 | ./bin/golangci-lint run --fix 34 | 35 | .PHONY: lint 36 | lint: 37 | ./bin/golangci-lint run $(SOURCE_FILES) 38 | 39 | .PHONY: check 40 | check: test lint-fix 41 | 42 | .PHONY: install-golangci-lint 43 | install-golangci-lint: 44 | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s $(GOLANGCI_VERSION) 45 | 46 | .PHONY: install-goimports 47 | install-goimports: 48 | go install golang.org/x/tools/cmd/goimports@latest 49 | 50 | .PHONY: tools 51 | tools: install-golangci-lint install-goimports 52 | 53 | .PHONY: addcopy 54 | addcopy: 55 | @scripts/add-copy.sh 56 | 57 | TAG=$(patsubst v%,%,$(shell git describe --tags --dirty --always)) 58 | .PHONY: check-version 59 | check-version: 60 | scripts/check-version.sh "$(TAG)" 61 | 62 | .PHONY: openapi-pipeline 63 | openapi-pipeline: install-goimports 64 | echo "Running OpenAPI Generation and Validation process" 65 | $(MAKE) -C tools clean_client 66 | echo "Running client generation" 67 | $(MAKE) -C tools generate_client 68 | echo "Validating generated SDK" 69 | go test ./test 70 | 71 | .PHONY: gen-docs 72 | gen-docs: 73 | $(MAKE) -C tools generate_docs 74 | ./scripts/toc.sh 75 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | Any security concerns or vulnerabilities discovered in one of MongoDB’s products or hosted services 6 | can be responsibly disclosed by utilizing one of the methods described in our [create a vulnerability report](https://docs.mongodb.com/manual/tutorial/create-a-vulnerability-report/) docs page. 7 | 8 | While we greatly appreciate community reports regarding security issues, at this time MongoDB does not provide compensation for vulnerability reports. 9 | -------------------------------------------------------------------------------- /admin/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /admin/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package admin supports the MongoDB Atlas Admin API. 3 | 4 | See: https://github.com/mongodb/atlas-sdk-go#getting-started for more information 5 | */ 6 | package admin 7 | -------------------------------------------------------------------------------- /admin/model_add_or_remove_group_role.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // AddOrRemoveGroupRole struct for AddOrRemoveGroupRole 6 | type AddOrRemoveGroupRole struct { 7 | // Project-level role. 8 | GroupRole string `json:"groupRole"` 9 | } 10 | 11 | // NewAddOrRemoveGroupRole instantiates a new AddOrRemoveGroupRole object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewAddOrRemoveGroupRole(groupRole string) *AddOrRemoveGroupRole { 16 | this := AddOrRemoveGroupRole{} 17 | this.GroupRole = groupRole 18 | return &this 19 | } 20 | 21 | // NewAddOrRemoveGroupRoleWithDefaults instantiates a new AddOrRemoveGroupRole object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewAddOrRemoveGroupRoleWithDefaults() *AddOrRemoveGroupRole { 25 | this := AddOrRemoveGroupRole{} 26 | return &this 27 | } 28 | 29 | // GetGroupRole returns the GroupRole field value 30 | func (o *AddOrRemoveGroupRole) GetGroupRole() string { 31 | if o == nil { 32 | var ret string 33 | return ret 34 | } 35 | 36 | return o.GroupRole 37 | } 38 | 39 | // GetGroupRoleOk returns a tuple with the GroupRole field value 40 | // and a boolean to check if the value has been set. 41 | func (o *AddOrRemoveGroupRole) GetGroupRoleOk() (*string, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.GroupRole, true 46 | } 47 | 48 | // SetGroupRole sets field value 49 | func (o *AddOrRemoveGroupRole) SetGroupRole(v string) { 50 | o.GroupRole = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_add_or_remove_org_role.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // AddOrRemoveOrgRole struct for AddOrRemoveOrgRole 6 | type AddOrRemoveOrgRole struct { 7 | // Organization-level role. 8 | OrgRole string `json:"orgRole"` 9 | } 10 | 11 | // NewAddOrRemoveOrgRole instantiates a new AddOrRemoveOrgRole object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewAddOrRemoveOrgRole(orgRole string) *AddOrRemoveOrgRole { 16 | this := AddOrRemoveOrgRole{} 17 | this.OrgRole = orgRole 18 | return &this 19 | } 20 | 21 | // NewAddOrRemoveOrgRoleWithDefaults instantiates a new AddOrRemoveOrgRole object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewAddOrRemoveOrgRoleWithDefaults() *AddOrRemoveOrgRole { 25 | this := AddOrRemoveOrgRole{} 26 | return &this 27 | } 28 | 29 | // GetOrgRole returns the OrgRole field value 30 | func (o *AddOrRemoveOrgRole) GetOrgRole() string { 31 | if o == nil { 32 | var ret string 33 | return ret 34 | } 35 | 36 | return o.OrgRole 37 | } 38 | 39 | // GetOrgRoleOk returns a tuple with the OrgRole field value 40 | // and a boolean to check if the value has been set. 41 | func (o *AddOrRemoveOrgRole) GetOrgRoleOk() (*string, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.OrgRole, true 46 | } 47 | 48 | // SetOrgRole sets field value 49 | func (o *AddOrRemoveOrgRole) SetOrgRole(v string) { 50 | o.OrgRole = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_add_or_remove_user_from_team.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // AddOrRemoveUserFromTeam struct for AddOrRemoveUserFromTeam 6 | type AddOrRemoveUserFromTeam struct { 7 | // Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. 8 | // Write only field. 9 | Id string `json:"id"` 10 | } 11 | 12 | // NewAddOrRemoveUserFromTeam instantiates a new AddOrRemoveUserFromTeam object 13 | // This constructor will assign default values to properties that have it defined, 14 | // and makes sure properties required by API are set, but the set of arguments 15 | // will change when the set of required properties is changed 16 | func NewAddOrRemoveUserFromTeam(id string) *AddOrRemoveUserFromTeam { 17 | this := AddOrRemoveUserFromTeam{} 18 | this.Id = id 19 | return &this 20 | } 21 | 22 | // NewAddOrRemoveUserFromTeamWithDefaults instantiates a new AddOrRemoveUserFromTeam object 23 | // This constructor will only assign default values to properties that have it defined, 24 | // but it doesn't guarantee that properties required by API are set 25 | func NewAddOrRemoveUserFromTeamWithDefaults() *AddOrRemoveUserFromTeam { 26 | this := AddOrRemoveUserFromTeam{} 27 | return &this 28 | } 29 | 30 | // GetId returns the Id field value 31 | func (o *AddOrRemoveUserFromTeam) GetId() string { 32 | if o == nil { 33 | var ret string 34 | return ret 35 | } 36 | 37 | return o.Id 38 | } 39 | 40 | // GetIdOk returns a tuple with the Id field value 41 | // and a boolean to check if the value has been set. 42 | func (o *AddOrRemoveUserFromTeam) GetIdOk() (*string, bool) { 43 | if o == nil { 44 | return nil, false 45 | } 46 | return &o.Id, true 47 | } 48 | 49 | // SetId sets field value 50 | func (o *AddOrRemoveUserFromTeam) SetId(v string) { 51 | o.Id = v 52 | } 53 | -------------------------------------------------------------------------------- /admin/model_add_user_to_team.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // AddUserToTeam struct for AddUserToTeam 6 | type AddUserToTeam struct { 7 | // Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. 8 | Id string `json:"id"` 9 | } 10 | 11 | // NewAddUserToTeam instantiates a new AddUserToTeam object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewAddUserToTeam(id string) *AddUserToTeam { 16 | this := AddUserToTeam{} 17 | this.Id = id 18 | return &this 19 | } 20 | 21 | // NewAddUserToTeamWithDefaults instantiates a new AddUserToTeam object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewAddUserToTeamWithDefaults() *AddUserToTeam { 25 | this := AddUserToTeam{} 26 | return &this 27 | } 28 | 29 | // GetId returns the Id field value 30 | func (o *AddUserToTeam) GetId() string { 31 | if o == nil { 32 | var ret string 33 | return ret 34 | } 35 | 36 | return o.Id 37 | } 38 | 39 | // GetIdOk returns a tuple with the Id field value 40 | // and a boolean to check if the value has been set. 41 | func (o *AddUserToTeam) GetIdOk() (*string, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.Id, true 46 | } 47 | 48 | // SetId sets field value 49 | func (o *AddUserToTeam) SetId(v string) { 50 | o.Id = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_alerts_toggle.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // AlertsToggle Enables or disables the specified alert configuration in the specified project. 6 | type AlertsToggle struct { 7 | // Flag that indicates whether to enable or disable the specified alert configuration in the specified project. 8 | Enabled *bool `json:"enabled,omitempty"` 9 | } 10 | 11 | // NewAlertsToggle instantiates a new AlertsToggle object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewAlertsToggle() *AlertsToggle { 16 | this := AlertsToggle{} 17 | return &this 18 | } 19 | 20 | // NewAlertsToggleWithDefaults instantiates a new AlertsToggle object 21 | // This constructor will only assign default values to properties that have it defined, 22 | // but it doesn't guarantee that properties required by API are set 23 | func NewAlertsToggleWithDefaults() *AlertsToggle { 24 | this := AlertsToggle{} 25 | return &this 26 | } 27 | 28 | // GetEnabled returns the Enabled field value if set, zero value otherwise 29 | func (o *AlertsToggle) GetEnabled() bool { 30 | if o == nil || IsNil(o.Enabled) { 31 | var ret bool 32 | return ret 33 | } 34 | return *o.Enabled 35 | } 36 | 37 | // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise 38 | // and a boolean to check if the value has been set. 39 | func (o *AlertsToggle) GetEnabledOk() (*bool, bool) { 40 | if o == nil || IsNil(o.Enabled) { 41 | return nil, false 42 | } 43 | 44 | return o.Enabled, true 45 | } 46 | 47 | // HasEnabled returns a boolean if a field has been set. 48 | func (o *AlertsToggle) HasEnabled() bool { 49 | if o != nil && !IsNil(o.Enabled) { 50 | return true 51 | } 52 | 53 | return false 54 | } 55 | 56 | // SetEnabled gets a reference to the given bool and assigns it to the Enabled field. 57 | func (o *AlertsToggle) SetEnabled(v bool) { 58 | o.Enabled = &v 59 | } 60 | -------------------------------------------------------------------------------- /admin/model_api_atlas_policy_create.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // ApiAtlasPolicyCreate struct for ApiAtlasPolicyCreate 6 | type ApiAtlasPolicyCreate struct { 7 | // A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. 8 | Body string `json:"body"` 9 | } 10 | 11 | // NewApiAtlasPolicyCreate instantiates a new ApiAtlasPolicyCreate object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewApiAtlasPolicyCreate(body string) *ApiAtlasPolicyCreate { 16 | this := ApiAtlasPolicyCreate{} 17 | this.Body = body 18 | return &this 19 | } 20 | 21 | // NewApiAtlasPolicyCreateWithDefaults instantiates a new ApiAtlasPolicyCreate object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewApiAtlasPolicyCreateWithDefaults() *ApiAtlasPolicyCreate { 25 | this := ApiAtlasPolicyCreate{} 26 | return &this 27 | } 28 | 29 | // GetBody returns the Body field value 30 | func (o *ApiAtlasPolicyCreate) GetBody() string { 31 | if o == nil { 32 | var ret string 33 | return ret 34 | } 35 | 36 | return o.Body 37 | } 38 | 39 | // GetBodyOk returns a tuple with the Body field value 40 | // and a boolean to check if the value has been set. 41 | func (o *ApiAtlasPolicyCreate) GetBodyOk() (*string, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.Body, true 46 | } 47 | 48 | // SetBody sets field value 49 | func (o *ApiAtlasPolicyCreate) SetBody(v string) { 50 | o.Body = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_api_atlas_policy_metadata.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // ApiAtlasPolicyMetadata struct for ApiAtlasPolicyMetadata 6 | type ApiAtlasPolicyMetadata struct { 7 | // Unique 24-hexadecimal character string that identifies the policy. 8 | // Read only field. 9 | PolicyId *string `json:"policyId,omitempty"` 10 | } 11 | 12 | // NewApiAtlasPolicyMetadata instantiates a new ApiAtlasPolicyMetadata object 13 | // This constructor will assign default values to properties that have it defined, 14 | // and makes sure properties required by API are set, but the set of arguments 15 | // will change when the set of required properties is changed 16 | func NewApiAtlasPolicyMetadata() *ApiAtlasPolicyMetadata { 17 | this := ApiAtlasPolicyMetadata{} 18 | return &this 19 | } 20 | 21 | // NewApiAtlasPolicyMetadataWithDefaults instantiates a new ApiAtlasPolicyMetadata object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewApiAtlasPolicyMetadataWithDefaults() *ApiAtlasPolicyMetadata { 25 | this := ApiAtlasPolicyMetadata{} 26 | return &this 27 | } 28 | 29 | // GetPolicyId returns the PolicyId field value if set, zero value otherwise 30 | func (o *ApiAtlasPolicyMetadata) GetPolicyId() string { 31 | if o == nil || IsNil(o.PolicyId) { 32 | var ret string 33 | return ret 34 | } 35 | return *o.PolicyId 36 | } 37 | 38 | // GetPolicyIdOk returns a tuple with the PolicyId field value if set, nil otherwise 39 | // and a boolean to check if the value has been set. 40 | func (o *ApiAtlasPolicyMetadata) GetPolicyIdOk() (*string, bool) { 41 | if o == nil || IsNil(o.PolicyId) { 42 | return nil, false 43 | } 44 | 45 | return o.PolicyId, true 46 | } 47 | 48 | // HasPolicyId returns a boolean if a field has been set. 49 | func (o *ApiAtlasPolicyMetadata) HasPolicyId() bool { 50 | if o != nil && !IsNil(o.PolicyId) { 51 | return true 52 | } 53 | 54 | return false 55 | } 56 | 57 | // SetPolicyId gets a reference to the given string and assigns it to the PolicyId field. 58 | func (o *ApiAtlasPolicyMetadata) SetPolicyId(v string) { 59 | o.PolicyId = &v 60 | } 61 | -------------------------------------------------------------------------------- /admin/model_api_search_deployment_request.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // ApiSearchDeploymentRequest struct for ApiSearchDeploymentRequest 6 | type ApiSearchDeploymentRequest struct { 7 | // List of settings that configure the Search Nodes for your cluster. **NOTE**: We accept a single configuration for all nodes currently. 8 | Specs []ApiSearchDeploymentSpec `json:"specs"` 9 | } 10 | 11 | // NewApiSearchDeploymentRequest instantiates a new ApiSearchDeploymentRequest object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewApiSearchDeploymentRequest(specs []ApiSearchDeploymentSpec) *ApiSearchDeploymentRequest { 16 | this := ApiSearchDeploymentRequest{} 17 | this.Specs = specs 18 | return &this 19 | } 20 | 21 | // NewApiSearchDeploymentRequestWithDefaults instantiates a new ApiSearchDeploymentRequest object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewApiSearchDeploymentRequestWithDefaults() *ApiSearchDeploymentRequest { 25 | this := ApiSearchDeploymentRequest{} 26 | return &this 27 | } 28 | 29 | // GetSpecs returns the Specs field value 30 | func (o *ApiSearchDeploymentRequest) GetSpecs() []ApiSearchDeploymentSpec { 31 | if o == nil { 32 | var ret []ApiSearchDeploymentSpec 33 | return ret 34 | } 35 | 36 | return o.Specs 37 | } 38 | 39 | // GetSpecsOk returns a tuple with the Specs field value 40 | // and a boolean to check if the value has been set. 41 | func (o *ApiSearchDeploymentRequest) GetSpecsOk() (*[]ApiSearchDeploymentSpec, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.Specs, true 46 | } 47 | 48 | // SetSpecs sets field value 49 | func (o *ApiSearchDeploymentRequest) SetSpecs(v []ApiSearchDeploymentSpec) { 50 | o.Specs = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_aws_custom_dns_enabled.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // AWSCustomDNSEnabled struct for AWSCustomDNSEnabled 6 | type AWSCustomDNSEnabled struct { 7 | // Flag that indicates whether the project's clusters deployed to Amazon Web Services (AWS) use a custom Domain Name System (DNS). When `\"enabled\": true`, connect to your cluster using Private IP for Peering connection strings. 8 | Enabled bool `json:"enabled"` 9 | } 10 | 11 | // NewAWSCustomDNSEnabled instantiates a new AWSCustomDNSEnabled object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewAWSCustomDNSEnabled(enabled bool) *AWSCustomDNSEnabled { 16 | this := AWSCustomDNSEnabled{} 17 | this.Enabled = enabled 18 | return &this 19 | } 20 | 21 | // NewAWSCustomDNSEnabledWithDefaults instantiates a new AWSCustomDNSEnabled object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewAWSCustomDNSEnabledWithDefaults() *AWSCustomDNSEnabled { 25 | this := AWSCustomDNSEnabled{} 26 | return &this 27 | } 28 | 29 | // GetEnabled returns the Enabled field value 30 | func (o *AWSCustomDNSEnabled) GetEnabled() bool { 31 | if o == nil { 32 | var ret bool 33 | return ret 34 | } 35 | 36 | return o.Enabled 37 | } 38 | 39 | // GetEnabledOk returns a tuple with the Enabled field value 40 | // and a boolean to check if the value has been set. 41 | func (o *AWSCustomDNSEnabled) GetEnabledOk() (*bool, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.Enabled, true 46 | } 47 | 48 | // SetEnabled sets field value 49 | func (o *AWSCustomDNSEnabled) SetEnabled(v bool) { 50 | o.Enabled = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_bad_request_detail.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // BadRequestDetail Bad request detail. 6 | type BadRequestDetail struct { 7 | // Describes all violations in a client request. 8 | Fields *[]FieldViolation `json:"fields,omitempty"` 9 | } 10 | 11 | // NewBadRequestDetail instantiates a new BadRequestDetail object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewBadRequestDetail() *BadRequestDetail { 16 | this := BadRequestDetail{} 17 | return &this 18 | } 19 | 20 | // NewBadRequestDetailWithDefaults instantiates a new BadRequestDetail object 21 | // This constructor will only assign default values to properties that have it defined, 22 | // but it doesn't guarantee that properties required by API are set 23 | func NewBadRequestDetailWithDefaults() *BadRequestDetail { 24 | this := BadRequestDetail{} 25 | return &this 26 | } 27 | 28 | // GetFields returns the Fields field value if set, zero value otherwise 29 | func (o *BadRequestDetail) GetFields() []FieldViolation { 30 | if o == nil || IsNil(o.Fields) { 31 | var ret []FieldViolation 32 | return ret 33 | } 34 | return *o.Fields 35 | } 36 | 37 | // GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise 38 | // and a boolean to check if the value has been set. 39 | func (o *BadRequestDetail) GetFieldsOk() (*[]FieldViolation, bool) { 40 | if o == nil || IsNil(o.Fields) { 41 | return nil, false 42 | } 43 | 44 | return o.Fields, true 45 | } 46 | 47 | // HasFields returns a boolean if a field has been set. 48 | func (o *BadRequestDetail) HasFields() bool { 49 | if o != nil && !IsNil(o.Fields) { 50 | return true 51 | } 52 | 53 | return false 54 | } 55 | 56 | // SetFields gets a reference to the given []FieldViolation and assigns it to the Fields field. 57 | func (o *BadRequestDetail) SetFields(v []FieldViolation) { 58 | o.Fields = &v 59 | } 60 | -------------------------------------------------------------------------------- /admin/model_cluster_free_auto_scaling.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // ClusterFreeAutoScaling Range of instance sizes to which your cluster can scale. 6 | type ClusterFreeAutoScaling struct { 7 | Compute *FreeComputeAutoScalingRules `json:"compute,omitempty"` 8 | } 9 | 10 | // NewClusterFreeAutoScaling instantiates a new ClusterFreeAutoScaling object 11 | // This constructor will assign default values to properties that have it defined, 12 | // and makes sure properties required by API are set, but the set of arguments 13 | // will change when the set of required properties is changed 14 | func NewClusterFreeAutoScaling() *ClusterFreeAutoScaling { 15 | this := ClusterFreeAutoScaling{} 16 | return &this 17 | } 18 | 19 | // NewClusterFreeAutoScalingWithDefaults instantiates a new ClusterFreeAutoScaling object 20 | // This constructor will only assign default values to properties that have it defined, 21 | // but it doesn't guarantee that properties required by API are set 22 | func NewClusterFreeAutoScalingWithDefaults() *ClusterFreeAutoScaling { 23 | this := ClusterFreeAutoScaling{} 24 | return &this 25 | } 26 | 27 | // GetCompute returns the Compute field value if set, zero value otherwise 28 | func (o *ClusterFreeAutoScaling) GetCompute() FreeComputeAutoScalingRules { 29 | if o == nil || IsNil(o.Compute) { 30 | var ret FreeComputeAutoScalingRules 31 | return ret 32 | } 33 | return *o.Compute 34 | } 35 | 36 | // GetComputeOk returns a tuple with the Compute field value if set, nil otherwise 37 | // and a boolean to check if the value has been set. 38 | func (o *ClusterFreeAutoScaling) GetComputeOk() (*FreeComputeAutoScalingRules, bool) { 39 | if o == nil || IsNil(o.Compute) { 40 | return nil, false 41 | } 42 | 43 | return o.Compute, true 44 | } 45 | 46 | // HasCompute returns a boolean if a field has been set. 47 | func (o *ClusterFreeAutoScaling) HasCompute() bool { 48 | if o != nil && !IsNil(o.Compute) { 49 | return true 50 | } 51 | 52 | return false 53 | } 54 | 55 | // SetCompute gets a reference to the given FreeComputeAutoScalingRules and assigns it to the Compute field. 56 | func (o *ClusterFreeAutoScaling) SetCompute(v FreeComputeAutoScalingRules) { 57 | o.Compute = &v 58 | } 59 | -------------------------------------------------------------------------------- /admin/model_cost_explorer_filter_response.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // CostExplorerFilterResponse Response object to give information about created query. 6 | type CostExplorerFilterResponse struct { 7 | // The token used to identify the created Cost Explorer query. 8 | Token *string `json:"token,omitempty"` 9 | } 10 | 11 | // NewCostExplorerFilterResponse instantiates a new CostExplorerFilterResponse object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewCostExplorerFilterResponse() *CostExplorerFilterResponse { 16 | this := CostExplorerFilterResponse{} 17 | return &this 18 | } 19 | 20 | // NewCostExplorerFilterResponseWithDefaults instantiates a new CostExplorerFilterResponse object 21 | // This constructor will only assign default values to properties that have it defined, 22 | // but it doesn't guarantee that properties required by API are set 23 | func NewCostExplorerFilterResponseWithDefaults() *CostExplorerFilterResponse { 24 | this := CostExplorerFilterResponse{} 25 | return &this 26 | } 27 | 28 | // GetToken returns the Token field value if set, zero value otherwise 29 | func (o *CostExplorerFilterResponse) GetToken() string { 30 | if o == nil || IsNil(o.Token) { 31 | var ret string 32 | return ret 33 | } 34 | return *o.Token 35 | } 36 | 37 | // GetTokenOk returns a tuple with the Token field value if set, nil otherwise 38 | // and a boolean to check if the value has been set. 39 | func (o *CostExplorerFilterResponse) GetTokenOk() (*string, bool) { 40 | if o == nil || IsNil(o.Token) { 41 | return nil, false 42 | } 43 | 44 | return o.Token, true 45 | } 46 | 47 | // HasToken returns a boolean if a field has been set. 48 | func (o *CostExplorerFilterResponse) HasToken() bool { 49 | if o != nil && !IsNil(o.Token) { 50 | return true 51 | } 52 | 53 | return false 54 | } 55 | 56 | // SetToken gets a reference to the given string and assigns it to the Token field. 57 | func (o *CostExplorerFilterResponse) SetToken(v string) { 58 | o.Token = &v 59 | } 60 | -------------------------------------------------------------------------------- /admin/model_disk_gb_auto_scaling.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // DiskGBAutoScaling Setting that enables disk auto-scaling. 6 | type DiskGBAutoScaling struct { 7 | // Flag that indicates whether this cluster enables disk auto-scaling. The maximum memory allowed for the selected cluster tier and the oplog size can limit storage auto-scaling. 8 | Enabled *bool `json:"enabled,omitempty"` 9 | } 10 | 11 | // NewDiskGBAutoScaling instantiates a new DiskGBAutoScaling object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewDiskGBAutoScaling() *DiskGBAutoScaling { 16 | this := DiskGBAutoScaling{} 17 | return &this 18 | } 19 | 20 | // NewDiskGBAutoScalingWithDefaults instantiates a new DiskGBAutoScaling object 21 | // This constructor will only assign default values to properties that have it defined, 22 | // but it doesn't guarantee that properties required by API are set 23 | func NewDiskGBAutoScalingWithDefaults() *DiskGBAutoScaling { 24 | this := DiskGBAutoScaling{} 25 | return &this 26 | } 27 | 28 | // GetEnabled returns the Enabled field value if set, zero value otherwise 29 | func (o *DiskGBAutoScaling) GetEnabled() bool { 30 | if o == nil || IsNil(o.Enabled) { 31 | var ret bool 32 | return ret 33 | } 34 | return *o.Enabled 35 | } 36 | 37 | // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise 38 | // and a boolean to check if the value has been set. 39 | func (o *DiskGBAutoScaling) GetEnabledOk() (*bool, bool) { 40 | if o == nil || IsNil(o.Enabled) { 41 | return nil, false 42 | } 43 | 44 | return o.Enabled, true 45 | } 46 | 47 | // HasEnabled returns a boolean if a field has been set. 48 | func (o *DiskGBAutoScaling) HasEnabled() bool { 49 | if o != nil && !IsNil(o.Enabled) { 50 | return true 51 | } 52 | 53 | return false 54 | } 55 | 56 | // SetEnabled gets a reference to the given bool and assigns it to the Enabled field. 57 | func (o *DiskGBAutoScaling) SetEnabled(v bool) { 58 | o.Enabled = &v 59 | } 60 | -------------------------------------------------------------------------------- /admin/model_group_service.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // GroupService List of IP addresses in a project categorized by services. 6 | type GroupService struct { 7 | // IP addresses of clusters. 8 | // Read only field. 9 | Clusters *[]ClusterIPAddresses `json:"clusters,omitempty"` 10 | } 11 | 12 | // NewGroupService instantiates a new GroupService object 13 | // This constructor will assign default values to properties that have it defined, 14 | // and makes sure properties required by API are set, but the set of arguments 15 | // will change when the set of required properties is changed 16 | func NewGroupService() *GroupService { 17 | this := GroupService{} 18 | return &this 19 | } 20 | 21 | // NewGroupServiceWithDefaults instantiates a new GroupService object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewGroupServiceWithDefaults() *GroupService { 25 | this := GroupService{} 26 | return &this 27 | } 28 | 29 | // GetClusters returns the Clusters field value if set, zero value otherwise 30 | func (o *GroupService) GetClusters() []ClusterIPAddresses { 31 | if o == nil || IsNil(o.Clusters) { 32 | var ret []ClusterIPAddresses 33 | return ret 34 | } 35 | return *o.Clusters 36 | } 37 | 38 | // GetClustersOk returns a tuple with the Clusters field value if set, nil otherwise 39 | // and a boolean to check if the value has been set. 40 | func (o *GroupService) GetClustersOk() (*[]ClusterIPAddresses, bool) { 41 | if o == nil || IsNil(o.Clusters) { 42 | return nil, false 43 | } 44 | 45 | return o.Clusters, true 46 | } 47 | 48 | // HasClusters returns a boolean if a field has been set. 49 | func (o *GroupService) HasClusters() bool { 50 | if o != nil && !IsNil(o.Clusters) { 51 | return true 52 | } 53 | 54 | return false 55 | } 56 | 57 | // SetClusters gets a reference to the given []ClusterIPAddresses and assigns it to the Clusters field. 58 | func (o *GroupService) SetClusters(v []ClusterIPAddresses) { 59 | o.Clusters = &v 60 | } 61 | -------------------------------------------------------------------------------- /admin/model_group_service_account_role_assignment.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // GroupServiceAccountRoleAssignment struct for GroupServiceAccountRoleAssignment 6 | type GroupServiceAccountRoleAssignment struct { 7 | // The Project permissions for the Service Account in the specified Project. 8 | Roles []string `json:"roles"` 9 | } 10 | 11 | // NewGroupServiceAccountRoleAssignment instantiates a new GroupServiceAccountRoleAssignment object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewGroupServiceAccountRoleAssignment(roles []string) *GroupServiceAccountRoleAssignment { 16 | this := GroupServiceAccountRoleAssignment{} 17 | this.Roles = roles 18 | return &this 19 | } 20 | 21 | // NewGroupServiceAccountRoleAssignmentWithDefaults instantiates a new GroupServiceAccountRoleAssignment object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewGroupServiceAccountRoleAssignmentWithDefaults() *GroupServiceAccountRoleAssignment { 25 | this := GroupServiceAccountRoleAssignment{} 26 | return &this 27 | } 28 | 29 | // GetRoles returns the Roles field value 30 | func (o *GroupServiceAccountRoleAssignment) GetRoles() []string { 31 | if o == nil { 32 | var ret []string 33 | return ret 34 | } 35 | 36 | return o.Roles 37 | } 38 | 39 | // GetRolesOk returns a tuple with the Roles field value 40 | // and a boolean to check if the value has been set. 41 | func (o *GroupServiceAccountRoleAssignment) GetRolesOk() (*[]string, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.Roles, true 46 | } 47 | 48 | // SetRoles sets field value 49 | func (o *GroupServiceAccountRoleAssignment) SetRoles(v []string) { 50 | o.Roles = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_namespaces.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // Namespaces struct for Namespaces 6 | type Namespaces struct { 7 | // List that contains each combination of database, collection, and type on the specified host. 8 | // Read only field. 9 | Namespaces *[]NamespaceObj `json:"namespaces,omitempty"` 10 | } 11 | 12 | // NewNamespaces instantiates a new Namespaces object 13 | // This constructor will assign default values to properties that have it defined, 14 | // and makes sure properties required by API are set, but the set of arguments 15 | // will change when the set of required properties is changed 16 | func NewNamespaces() *Namespaces { 17 | this := Namespaces{} 18 | return &this 19 | } 20 | 21 | // NewNamespacesWithDefaults instantiates a new Namespaces object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewNamespacesWithDefaults() *Namespaces { 25 | this := Namespaces{} 26 | return &this 27 | } 28 | 29 | // GetNamespaces returns the Namespaces field value if set, zero value otherwise 30 | func (o *Namespaces) GetNamespaces() []NamespaceObj { 31 | if o == nil || IsNil(o.Namespaces) { 32 | var ret []NamespaceObj 33 | return ret 34 | } 35 | return *o.Namespaces 36 | } 37 | 38 | // GetNamespacesOk returns a tuple with the Namespaces field value if set, nil otherwise 39 | // and a boolean to check if the value has been set. 40 | func (o *Namespaces) GetNamespacesOk() (*[]NamespaceObj, bool) { 41 | if o == nil || IsNil(o.Namespaces) { 42 | return nil, false 43 | } 44 | 45 | return o.Namespaces, true 46 | } 47 | 48 | // HasNamespaces returns a boolean if a field has been set. 49 | func (o *Namespaces) HasNamespaces() bool { 50 | if o != nil && !IsNil(o.Namespaces) { 51 | return true 52 | } 53 | 54 | return false 55 | } 56 | 57 | // SetNamespaces gets a reference to the given []NamespaceObj and assigns it to the Namespaces field. 58 | func (o *Namespaces) SetNamespaces(v []NamespaceObj) { 59 | o.Namespaces = &v 60 | } 61 | -------------------------------------------------------------------------------- /admin/model_namespaces_request.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // NamespacesRequest struct for NamespacesRequest 6 | type NamespacesRequest struct { 7 | // List of namespace strings (combination of database and collection) on the specified host or cluster. 8 | // Write only field. 9 | Namespaces *[]string `json:"namespaces,omitempty"` 10 | } 11 | 12 | // NewNamespacesRequest instantiates a new NamespacesRequest object 13 | // This constructor will assign default values to properties that have it defined, 14 | // and makes sure properties required by API are set, but the set of arguments 15 | // will change when the set of required properties is changed 16 | func NewNamespacesRequest() *NamespacesRequest { 17 | this := NamespacesRequest{} 18 | return &this 19 | } 20 | 21 | // NewNamespacesRequestWithDefaults instantiates a new NamespacesRequest object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewNamespacesRequestWithDefaults() *NamespacesRequest { 25 | this := NamespacesRequest{} 26 | return &this 27 | } 28 | 29 | // GetNamespaces returns the Namespaces field value if set, zero value otherwise 30 | func (o *NamespacesRequest) GetNamespaces() []string { 31 | if o == nil || IsNil(o.Namespaces) { 32 | var ret []string 33 | return ret 34 | } 35 | return *o.Namespaces 36 | } 37 | 38 | // GetNamespacesOk returns a tuple with the Namespaces field value if set, nil otherwise 39 | // and a boolean to check if the value has been set. 40 | func (o *NamespacesRequest) GetNamespacesOk() (*[]string, bool) { 41 | if o == nil || IsNil(o.Namespaces) { 42 | return nil, false 43 | } 44 | 45 | return o.Namespaces, true 46 | } 47 | 48 | // HasNamespaces returns a boolean if a field has been set. 49 | func (o *NamespacesRequest) HasNamespaces() bool { 50 | if o != nil && !IsNil(o.Namespaces) { 51 | return true 52 | } 53 | 54 | return false 55 | } 56 | 57 | // SetNamespaces gets a reference to the given []string and assigns it to the Namespaces field. 58 | func (o *NamespacesRequest) SetNamespaces(v []string) { 59 | o.Namespaces = &v 60 | } 61 | -------------------------------------------------------------------------------- /admin/model_private_ip_mode.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // PrivateIPMode struct for PrivateIPMode 6 | type PrivateIPMode struct { 7 | // Flag that indicates whether someone enabled **Connect via Peering Only** mode for the specified project. 8 | Enabled bool `json:"enabled"` 9 | } 10 | 11 | // NewPrivateIPMode instantiates a new PrivateIPMode object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewPrivateIPMode(enabled bool) *PrivateIPMode { 16 | this := PrivateIPMode{} 17 | this.Enabled = enabled 18 | return &this 19 | } 20 | 21 | // NewPrivateIPModeWithDefaults instantiates a new PrivateIPMode object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewPrivateIPModeWithDefaults() *PrivateIPMode { 25 | this := PrivateIPMode{} 26 | return &this 27 | } 28 | 29 | // GetEnabled returns the Enabled field value 30 | func (o *PrivateIPMode) GetEnabled() bool { 31 | if o == nil { 32 | var ret bool 33 | return ret 34 | } 35 | 36 | return o.Enabled 37 | } 38 | 39 | // GetEnabledOk returns a tuple with the Enabled field value 40 | // and a boolean to check if the value has been set. 41 | func (o *PrivateIPMode) GetEnabledOk() (*bool, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.Enabled, true 46 | } 47 | 48 | // SetEnabled sets field value 49 | func (o *PrivateIPMode) SetEnabled(v bool) { 50 | o.Enabled = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_search_index_update_request.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // SearchIndexUpdateRequest struct for SearchIndexUpdateRequest 6 | type SearchIndexUpdateRequest struct { 7 | Definition SearchIndexUpdateRequestDefinition `json:"definition"` 8 | } 9 | 10 | // NewSearchIndexUpdateRequest instantiates a new SearchIndexUpdateRequest object 11 | // This constructor will assign default values to properties that have it defined, 12 | // and makes sure properties required by API are set, but the set of arguments 13 | // will change when the set of required properties is changed 14 | func NewSearchIndexUpdateRequest(definition SearchIndexUpdateRequestDefinition) *SearchIndexUpdateRequest { 15 | this := SearchIndexUpdateRequest{} 16 | this.Definition = definition 17 | return &this 18 | } 19 | 20 | // NewSearchIndexUpdateRequestWithDefaults instantiates a new SearchIndexUpdateRequest object 21 | // This constructor will only assign default values to properties that have it defined, 22 | // but it doesn't guarantee that properties required by API are set 23 | func NewSearchIndexUpdateRequestWithDefaults() *SearchIndexUpdateRequest { 24 | this := SearchIndexUpdateRequest{} 25 | return &this 26 | } 27 | 28 | // GetDefinition returns the Definition field value 29 | func (o *SearchIndexUpdateRequest) GetDefinition() SearchIndexUpdateRequestDefinition { 30 | if o == nil { 31 | var ret SearchIndexUpdateRequestDefinition 32 | return ret 33 | } 34 | 35 | return o.Definition 36 | } 37 | 38 | // GetDefinitionOk returns a tuple with the Definition field value 39 | // and a boolean to check if the value has been set. 40 | func (o *SearchIndexUpdateRequest) GetDefinitionOk() (*SearchIndexUpdateRequestDefinition, bool) { 41 | if o == nil { 42 | return nil, false 43 | } 44 | return &o.Definition, true 45 | } 46 | 47 | // SetDefinition sets field value 48 | func (o *SearchIndexUpdateRequest) SetDefinition(v SearchIndexUpdateRequestDefinition) { 49 | o.Definition = v 50 | } 51 | -------------------------------------------------------------------------------- /admin/model_shard_keys.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // ShardKeys Document that configures the shard key on the destination cluster. 6 | type ShardKeys struct { 7 | // List of fields to use for the shard key. 8 | // Write only field. 9 | Key *[]any `json:"key,omitempty"` 10 | } 11 | 12 | // NewShardKeys instantiates a new ShardKeys object 13 | // This constructor will assign default values to properties that have it defined, 14 | // and makes sure properties required by API are set, but the set of arguments 15 | // will change when the set of required properties is changed 16 | func NewShardKeys() *ShardKeys { 17 | this := ShardKeys{} 18 | return &this 19 | } 20 | 21 | // NewShardKeysWithDefaults instantiates a new ShardKeys object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewShardKeysWithDefaults() *ShardKeys { 25 | this := ShardKeys{} 26 | return &this 27 | } 28 | 29 | // GetKey returns the Key field value if set, zero value otherwise 30 | func (o *ShardKeys) GetKey() []any { 31 | if o == nil || IsNil(o.Key) { 32 | var ret []any 33 | return ret 34 | } 35 | return *o.Key 36 | } 37 | 38 | // GetKeyOk returns a tuple with the Key field value if set, nil otherwise 39 | // and a boolean to check if the value has been set. 40 | func (o *ShardKeys) GetKeyOk() (*[]any, bool) { 41 | if o == nil || IsNil(o.Key) { 42 | return nil, false 43 | } 44 | 45 | return o.Key, true 46 | } 47 | 48 | // HasKey returns a boolean if a field has been set. 49 | func (o *ShardKeys) HasKey() bool { 50 | if o != nil && !IsNil(o.Key) { 51 | return true 52 | } 53 | 54 | return false 55 | } 56 | 57 | // SetKey gets a reference to the given []any and assigns it to the Key field. 58 | func (o *ShardKeys) SetKey(v []any) { 59 | o.Key = &v 60 | } 61 | -------------------------------------------------------------------------------- /admin/model_synonym_source.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // SynonymSource Data set that stores words and their applicable synonyms. 6 | type SynonymSource struct { 7 | // Label that identifies the MongoDB collection that stores words and their applicable synonyms. 8 | Collection string `json:"collection"` 9 | } 10 | 11 | // NewSynonymSource instantiates a new SynonymSource object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewSynonymSource(collection string) *SynonymSource { 16 | this := SynonymSource{} 17 | this.Collection = collection 18 | return &this 19 | } 20 | 21 | // NewSynonymSourceWithDefaults instantiates a new SynonymSource object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewSynonymSourceWithDefaults() *SynonymSource { 25 | this := SynonymSource{} 26 | return &this 27 | } 28 | 29 | // GetCollection returns the Collection field value 30 | func (o *SynonymSource) GetCollection() string { 31 | if o == nil { 32 | var ret string 33 | return ret 34 | } 35 | 36 | return o.Collection 37 | } 38 | 39 | // GetCollectionOk returns a tuple with the Collection field value 40 | // and a boolean to check if the value has been set. 41 | func (o *SynonymSource) GetCollectionOk() (*string, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.Collection, true 46 | } 47 | 48 | // SetCollection sets field value 49 | func (o *SynonymSource) SetCollection(v string) { 50 | o.Collection = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_target_org.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // TargetOrg struct for TargetOrg 6 | type TargetOrg struct { 7 | // Link token that contains all the information required to complete the link. 8 | LinkToken string `json:"linkToken"` 9 | } 10 | 11 | // NewTargetOrg instantiates a new TargetOrg object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewTargetOrg(linkToken string) *TargetOrg { 16 | this := TargetOrg{} 17 | this.LinkToken = linkToken 18 | return &this 19 | } 20 | 21 | // NewTargetOrgWithDefaults instantiates a new TargetOrg object 22 | // This constructor will only assign default values to properties that have it defined, 23 | // but it doesn't guarantee that properties required by API are set 24 | func NewTargetOrgWithDefaults() *TargetOrg { 25 | this := TargetOrg{} 26 | return &this 27 | } 28 | 29 | // GetLinkToken returns the LinkToken field value 30 | func (o *TargetOrg) GetLinkToken() string { 31 | if o == nil { 32 | var ret string 33 | return ret 34 | } 35 | 36 | return o.LinkToken 37 | } 38 | 39 | // GetLinkTokenOk returns a tuple with the LinkToken field value 40 | // and a boolean to check if the value has been set. 41 | func (o *TargetOrg) GetLinkTokenOk() (*string, bool) { 42 | if o == nil { 43 | return nil, false 44 | } 45 | return &o.LinkToken, true 46 | } 47 | 48 | // SetLinkToken sets field value 49 | func (o *TargetOrg) SetLinkToken(v string) { 50 | o.LinkToken = v 51 | } 52 | -------------------------------------------------------------------------------- /admin/model_target_org_request.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | // TargetOrgRequest struct for TargetOrgRequest 6 | type TargetOrgRequest struct { 7 | // IP address access list entries associated with the API key. 8 | AccessListIps *[]string `json:"accessListIps,omitempty"` 9 | } 10 | 11 | // NewTargetOrgRequest instantiates a new TargetOrgRequest object 12 | // This constructor will assign default values to properties that have it defined, 13 | // and makes sure properties required by API are set, but the set of arguments 14 | // will change when the set of required properties is changed 15 | func NewTargetOrgRequest() *TargetOrgRequest { 16 | this := TargetOrgRequest{} 17 | return &this 18 | } 19 | 20 | // NewTargetOrgRequestWithDefaults instantiates a new TargetOrgRequest object 21 | // This constructor will only assign default values to properties that have it defined, 22 | // but it doesn't guarantee that properties required by API are set 23 | func NewTargetOrgRequestWithDefaults() *TargetOrgRequest { 24 | this := TargetOrgRequest{} 25 | return &this 26 | } 27 | 28 | // GetAccessListIps returns the AccessListIps field value if set, zero value otherwise 29 | func (o *TargetOrgRequest) GetAccessListIps() []string { 30 | if o == nil || IsNil(o.AccessListIps) { 31 | var ret []string 32 | return ret 33 | } 34 | return *o.AccessListIps 35 | } 36 | 37 | // GetAccessListIpsOk returns a tuple with the AccessListIps field value if set, nil otherwise 38 | // and a boolean to check if the value has been set. 39 | func (o *TargetOrgRequest) GetAccessListIpsOk() (*[]string, bool) { 40 | if o == nil || IsNil(o.AccessListIps) { 41 | return nil, false 42 | } 43 | 44 | return o.AccessListIps, true 45 | } 46 | 47 | // HasAccessListIps returns a boolean if a field has been set. 48 | func (o *TargetOrgRequest) HasAccessListIps() bool { 49 | if o != nil && !IsNil(o.AccessListIps) { 50 | return true 51 | } 52 | 53 | return false 54 | } 55 | 56 | // SetAccessListIps gets a reference to the given []string and assigns it to the AccessListIps field. 57 | func (o *TargetOrgRequest) SetAccessListIps(v []string) { 58 | o.AccessListIps = &v 59 | } 60 | -------------------------------------------------------------------------------- /admin/response.go: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | 3 | package admin 4 | 5 | import ( 6 | "net/http" 7 | ) 8 | 9 | // APIResponse stores the API response returned by the server. 10 | type APIResponse struct { 11 | *http.Response `json:"-"` 12 | Message string `json:"message,omitempty"` 13 | // Operation is the name of the OpenAPI operation. 14 | Operation string `json:"operation,omitempty"` 15 | // RequestURL is the request URL. This value is always available, even if the 16 | // embedded *http.Response is nil. 17 | RequestURL string `json:"url,omitempty"` 18 | // Method is the HTTP method used for the request. This value is always 19 | // available, even if the embedded *http.Response is nil. 20 | Method string `json:"method,omitempty"` 21 | // Payload holds the contents of the response body (which may be nil or empty). 22 | // This is provided here as the raw response.Body() reader will have already 23 | // been drained. 24 | Payload []byte `json:"-"` 25 | } 26 | 27 | // NewAPIResponse returns a new APIResponse object. 28 | func NewAPIResponse(r *http.Response) *APIResponse { 29 | response := &APIResponse{Response: r} 30 | return response 31 | } 32 | 33 | // NewAPIResponseWithError returns a new APIResponse object with the provided error message. 34 | func NewAPIResponseWithError(errorMessage string) *APIResponse { 35 | response := &APIResponse{Message: errorMessage} 36 | return response 37 | } 38 | -------------------------------------------------------------------------------- /auth/auth.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import "golang.org/x/oauth2" 4 | 5 | // oauth2 alias 6 | var ( 7 | // HTTPClient is the context key to use with golang.org/x/net/context's 8 | // WithValue function to associate an *http.Client value with a context. 9 | HTTPClient = oauth2.HTTPClient 10 | // ReuseTokenSource returns a TokenSource which repeatedly returns the 11 | // same token as long as it's valid, starting with t. 12 | // When its cached token is invalid, a new token is obtained from src. 13 | // 14 | // ReuseTokenSource is typically used to reuse tokens from a cache 15 | // (such as a file on disk) between runs of a program, rather than 16 | // obtaining new tokens unnecessarily. 17 | // 18 | // The initial token t may be nil, in which case the TokenSource is 19 | // wrapped in a caching version if it isn't one already. This also 20 | // means it's always safe to wrap ReuseTokenSource around any other 21 | // TokenSource without adverse effects. 22 | ReuseTokenSource = oauth2.ReuseTokenSource 23 | // NewClient creates an *http.Client from a Context and TokenSource. 24 | // The returned client is not valid beyond the lifetime of the context. 25 | // 26 | // Note that if a custom *http.Client is provided via the Context it 27 | // is used only for token acquisition and is not used to configure the 28 | // *http.Client returned from NewClient. 29 | // 30 | // As a special case, if src is nil, a non-OAuth2 client is returned 31 | // using the provided context. This exists to support related OAuth2 32 | // packages. 33 | NewClient = oauth2.NewClient 34 | ) 35 | -------------------------------------------------------------------------------- /auth/clientcredentials/clientcredentials_test.go: -------------------------------------------------------------------------------- 1 | package clientcredentials 2 | 3 | import ( 4 | "context" 5 | "net/http" 6 | "net/http/httptest" 7 | "testing" 8 | "time" 9 | 10 | "github.com/stretchr/testify/assert" 11 | "go.mongodb.org/atlas-sdk/v20250312003/auth" 12 | ) 13 | 14 | // mockOAuthRevokeEndpoint creates a mock OAuth revoke endpoint, 15 | // that simulates token revocation responses. 16 | func mockOAuthRevokeEndpoint(statusCode int) *httptest.Server { 17 | handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 18 | if r.Method != http.MethodPost || r.FormValue("token") == "" { 19 | http.Error(w, "invalid request", http.StatusBadRequest) 20 | return 21 | } 22 | w.WriteHeader(statusCode) 23 | }) 24 | return httptest.NewServer(handler) 25 | } 26 | 27 | // Test OAuthTokenSource_RevokeToken_Success tests successful token revocation. 28 | func TestOAuthTokenSource_RevokeToken_Success(t *testing.T) { 29 | mockServer := mockOAuthRevokeEndpoint(http.StatusOK) 30 | defer mockServer.Close() 31 | 32 | config := NewConfig("clientID", "clientSecret") 33 | config.RevokeURL = mockServer.URL 34 | expiry := time.Now().Add(1 * time.Hour) 35 | err := config.RevokeToken(context.Background(), &auth.Token{ 36 | AccessToken: "test", 37 | Expiry: expiry, 38 | ExpiresIn: expiry.Unix(), 39 | }) 40 | assert.NoError(t, err) 41 | } 42 | 43 | // TestOAuthTokenSource_RevokeToken_Failure tests token revocation failure due to unauthorized access. 44 | func TestOAuthTokenSource_RevokeToken_Failure(t *testing.T) { 45 | mockServer := mockOAuthRevokeEndpoint(http.StatusUnauthorized) 46 | defer mockServer.Close() 47 | 48 | config := NewConfig("clientID", "clientSecret") 49 | expiry := time.Now().Add(1 * time.Hour) 50 | err := config.RevokeToken(context.Background(), &auth.Token{ 51 | AccessToken: "test", 52 | Expiry: expiry, 53 | ExpiresIn: expiry.Unix(), 54 | }) 55 | assert.Error(t, err) 56 | assert.ErrorContains(t, err, "Failed to revoke Access Token when fetching new OAuth Token from remote server") 57 | } 58 | -------------------------------------------------------------------------------- /auth/clientcredentials/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /* 16 | Package credentials provide an SDK internal client_credentials grant implementation https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.4 17 | */ 18 | package clientcredentials 19 | -------------------------------------------------------------------------------- /auth/clientcredentials/transport.go: -------------------------------------------------------------------------------- 1 | package clientcredentials 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | // Transport supplies custom user agent to token requests 8 | type Transport struct { 9 | Base http.RoundTripper 10 | UserAgent string 11 | } 12 | 13 | func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { 14 | if t.UserAgent != "" { 15 | req.Header.Set("User-Agent", t.UserAgent) 16 | } 17 | return t.base().RoundTrip(req) 18 | } 19 | 20 | func (t *Transport) base() http.RoundTripper { 21 | if t.Base != nil { 22 | return t.Base 23 | } 24 | return http.DefaultTransport 25 | } 26 | -------------------------------------------------------------------------------- /auth/code/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /* 16 | Package auth provides a way to follow a Device Authorization Grant https://datatracker.ietf.org/doc/html/rfc8628. 17 | 18 | Usage 19 | 20 | import "go.mongodb.org/atlas-sdk/auth" 21 | 22 | Construct a new client Config, then use the various methods to complete a flow. 23 | For example: 24 | 25 | config, err := auth.NewConfigWithOptions(nil, auth.SetClientID("my-client-id"), auth.SetScopes([]string{"openid"})) 26 | if err != nil { 27 | panic(err) 28 | } 29 | code, _, err := config.RequestCode(context.TODO()) 30 | if err != nil { 31 | panic(err) 32 | } 33 | token, _, err := config.PollToken(context.TODO(), code) 34 | if err != nil { 35 | panic(err) 36 | } 37 | fmt.Println(token.AccessToken) 38 | 39 | NOTE: Using the https://godoc.org/context package, one can easily 40 | pass cancellation signals and deadlines to various services of the client for 41 | handling a request. In case there is no context available, then context.Background() 42 | can be used as a starting point. 43 | */ 44 | package code 45 | -------------------------------------------------------------------------------- /auth/code/token.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package code 16 | 17 | import ( 18 | "net/http" 19 | "time" 20 | ) 21 | 22 | type Token struct { 23 | AccessToken string `json:"access_token"` 24 | RefreshToken string `json:"refresh_token"` 25 | Scope string `json:"scope"` 26 | IDToken string `json:"id_token"` 27 | TokenType string `json:"token_type"` 28 | ExpiresIn int `json:"expires_in"` 29 | Expiry time.Time 30 | } 31 | 32 | func (t *Token) SetAuthHeader(r *http.Request) { 33 | r.Header.Set("Authorization", "Bearer "+t.AccessToken) 34 | } 35 | 36 | const expiryDelta = 10 * time.Second 37 | 38 | func (t *Token) expired() bool { 39 | if t.Expiry.IsZero() { 40 | return false 41 | } 42 | return t.Expiry.Round(0).Add(-expiryDelta).Before(time.Now()) 43 | } 44 | 45 | func (t *Token) Valid() bool { 46 | return t != nil && t.AccessToken != "" && !t.expired() 47 | } 48 | -------------------------------------------------------------------------------- /auth/token.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import "golang.org/x/oauth2" 4 | 5 | type ( 6 | // Token wraps golang.org/x/oauth2 oauth2.Token instance for compatibility with upstream 7 | Token = oauth2.Token 8 | // TokenSource wraps golang.org/x/oauth2 oauth2.TokenSource for compatibility with upstream 9 | TokenSource = oauth2.TokenSource 10 | ) 11 | -------------------------------------------------------------------------------- /bin/.keep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/doc_2_error_handling.md: -------------------------------------------------------------------------------- 1 | # Error Handling 2 | 3 | You can obtain detailed information about errors returned by the API when you use the Atlas Go SDK. Use the error code to determine the cause of the error. To learn more about API error codes, see [Atlas Administration API Error Codes](https://www.mongodb.com/docs/atlas/reference/api-errors/). 4 | 5 | Errors are represented by [ApiErrorObject](https://github.com/mongodb/atlas-sdk-go/blob/main/admin/model_api_error.go). 6 | 7 | ## Fetching Error Object 8 | 9 | To fetch the error object, execute the following: 10 | 11 | ```go 12 | // Surrounding code omitted for brevity 13 | 14 | projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute() 15 | apiError, ok := admin.AsError(err) 16 | fmt.Println(apiError) 17 | ``` 18 | 19 | ## Checking for the Existence of a Specific Error Code 20 | 21 | To check for the existence of a specific error code (e.g. `MAXIMUM_INDEXES_FOR_TENANT_EXCEEDED`), execute the following: 22 | 23 | ```go 24 | // Surrounding code omitted for brevity 25 | 26 | projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute() 27 | if admin.IsErrorCode(err, "code"){ 28 | // Do something 29 | } 30 | ``` 31 | 32 | ## Checking for the Existence of a Specific Response Status Code 33 | 34 | To check for the existence of a specific HTTP response error code, execute the following: 35 | 36 | ```go 37 | // Surrounding code omitted for brevity 38 | 39 | projects, response, err := admin.ProjectsApi.ListProjects(ctx).Execute() 40 | apiError, ok := admin.AsError(err) 41 | if ok && apiError.GetError() == 404 { 42 | // Do something 43 | } 44 | ``` 45 | 46 | ## Mocking Errors 47 | 48 | SDK errors can be mocked by creating instance of `GenericOpenAPIError` struct. 49 | 50 | ```go 51 | // Surrounding code omitted for brevity 52 | 53 | apiError := admin.GenericOpenAPIError{} 54 | apiError.SetModel(admin.ApiError{ 55 | Detail: admin.PtrString("Error when listing clusters"), 56 | Error: admin.PtrInt(400), 57 | ErrorCode: admin.PtrString("CLUSTERS_UNREACHABLE"), 58 | Reason: admin.PtrString("Clusters unreachable"), 59 | 60 | }) 61 | apiError.SetError("Mocked error") 62 | ``` 63 | 64 | Struct can be passed as `error` for the all SDK mocked methods. 65 | -------------------------------------------------------------------------------- /docs/docs/AWSCustomDNSEnabled.md: -------------------------------------------------------------------------------- 1 | # AWSCustomDNSEnabled 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Enabled** | **bool** | Flag that indicates whether the project's clusters deployed to Amazon Web Services (AWS) use a custom Domain Name System (DNS). When `\"enabled\": true`, connect to your cluster using Private IP for Peering connection strings. | 8 | 9 | ## Methods 10 | 11 | ### NewAWSCustomDNSEnabled 12 | 13 | `func NewAWSCustomDNSEnabled(enabled bool, ) *AWSCustomDNSEnabled` 14 | 15 | NewAWSCustomDNSEnabled instantiates a new AWSCustomDNSEnabled object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewAWSCustomDNSEnabledWithDefaults 21 | 22 | `func NewAWSCustomDNSEnabledWithDefaults() *AWSCustomDNSEnabled` 23 | 24 | NewAWSCustomDNSEnabledWithDefaults instantiates a new AWSCustomDNSEnabled object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetEnabled 29 | 30 | `func (o *AWSCustomDNSEnabled) GetEnabled() bool` 31 | 32 | GetEnabled returns the Enabled field if non-nil, zero value otherwise. 33 | 34 | ### GetEnabledOk 35 | 36 | `func (o *AWSCustomDNSEnabled) GetEnabledOk() (*bool, bool)` 37 | 38 | GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetEnabled 42 | 43 | `func (o *AWSCustomDNSEnabled) SetEnabled(v bool)` 44 | 45 | SetEnabled sets Enabled field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/AddOrRemoveGroupRole.md: -------------------------------------------------------------------------------- 1 | # AddOrRemoveGroupRole 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **GroupRole** | **string** | Project-level role. | 8 | 9 | ## Methods 10 | 11 | ### NewAddOrRemoveGroupRole 12 | 13 | `func NewAddOrRemoveGroupRole(groupRole string, ) *AddOrRemoveGroupRole` 14 | 15 | NewAddOrRemoveGroupRole instantiates a new AddOrRemoveGroupRole object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewAddOrRemoveGroupRoleWithDefaults 21 | 22 | `func NewAddOrRemoveGroupRoleWithDefaults() *AddOrRemoveGroupRole` 23 | 24 | NewAddOrRemoveGroupRoleWithDefaults instantiates a new AddOrRemoveGroupRole object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetGroupRole 29 | 30 | `func (o *AddOrRemoveGroupRole) GetGroupRole() string` 31 | 32 | GetGroupRole returns the GroupRole field if non-nil, zero value otherwise. 33 | 34 | ### GetGroupRoleOk 35 | 36 | `func (o *AddOrRemoveGroupRole) GetGroupRoleOk() (*string, bool)` 37 | 38 | GetGroupRoleOk returns a tuple with the GroupRole field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetGroupRole 42 | 43 | `func (o *AddOrRemoveGroupRole) SetGroupRole(v string)` 44 | 45 | SetGroupRole sets GroupRole field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/AddOrRemoveOrgRole.md: -------------------------------------------------------------------------------- 1 | # AddOrRemoveOrgRole 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **OrgRole** | **string** | Organization-level role. | 8 | 9 | ## Methods 10 | 11 | ### NewAddOrRemoveOrgRole 12 | 13 | `func NewAddOrRemoveOrgRole(orgRole string, ) *AddOrRemoveOrgRole` 14 | 15 | NewAddOrRemoveOrgRole instantiates a new AddOrRemoveOrgRole object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewAddOrRemoveOrgRoleWithDefaults 21 | 22 | `func NewAddOrRemoveOrgRoleWithDefaults() *AddOrRemoveOrgRole` 23 | 24 | NewAddOrRemoveOrgRoleWithDefaults instantiates a new AddOrRemoveOrgRole object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetOrgRole 29 | 30 | `func (o *AddOrRemoveOrgRole) GetOrgRole() string` 31 | 32 | GetOrgRole returns the OrgRole field if non-nil, zero value otherwise. 33 | 34 | ### GetOrgRoleOk 35 | 36 | `func (o *AddOrRemoveOrgRole) GetOrgRoleOk() (*string, bool)` 37 | 38 | GetOrgRoleOk returns a tuple with the OrgRole field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetOrgRole 42 | 43 | `func (o *AddOrRemoveOrgRole) SetOrgRole(v string)` 44 | 45 | SetOrgRole sets OrgRole field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/AddOrRemoveUserFromTeam.md: -------------------------------------------------------------------------------- 1 | # AddOrRemoveUserFromTeam 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Id** | **string** | Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. | 8 | 9 | ## Methods 10 | 11 | ### NewAddOrRemoveUserFromTeam 12 | 13 | `func NewAddOrRemoveUserFromTeam(id string, ) *AddOrRemoveUserFromTeam` 14 | 15 | NewAddOrRemoveUserFromTeam instantiates a new AddOrRemoveUserFromTeam object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewAddOrRemoveUserFromTeamWithDefaults 21 | 22 | `func NewAddOrRemoveUserFromTeamWithDefaults() *AddOrRemoveUserFromTeam` 23 | 24 | NewAddOrRemoveUserFromTeamWithDefaults instantiates a new AddOrRemoveUserFromTeam object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetId 29 | 30 | `func (o *AddOrRemoveUserFromTeam) GetId() string` 31 | 32 | GetId returns the Id field if non-nil, zero value otherwise. 33 | 34 | ### GetIdOk 35 | 36 | `func (o *AddOrRemoveUserFromTeam) GetIdOk() (*string, bool)` 37 | 38 | GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetId 42 | 43 | `func (o *AddOrRemoveUserFromTeam) SetId(v string)` 44 | 45 | SetId sets Id field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/AddUserToTeam.md: -------------------------------------------------------------------------------- 1 | # AddUserToTeam 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Id** | **string** | Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. | 8 | 9 | ## Methods 10 | 11 | ### NewAddUserToTeam 12 | 13 | `func NewAddUserToTeam(id string, ) *AddUserToTeam` 14 | 15 | NewAddUserToTeam instantiates a new AddUserToTeam object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewAddUserToTeamWithDefaults 21 | 22 | `func NewAddUserToTeamWithDefaults() *AddUserToTeam` 23 | 24 | NewAddUserToTeamWithDefaults instantiates a new AddUserToTeam object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetId 29 | 30 | `func (o *AddUserToTeam) GetId() string` 31 | 32 | GetId returns the Id field if non-nil, zero value otherwise. 33 | 34 | ### GetIdOk 35 | 36 | `func (o *AddUserToTeam) GetIdOk() (*string, bool)` 37 | 38 | GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetId 42 | 43 | `func (o *AddUserToTeam) SetId(v string)` 44 | 45 | SetId sets Id field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/AlertsToggle.md: -------------------------------------------------------------------------------- 1 | # AlertsToggle 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Enabled** | Pointer to **bool** | Flag that indicates whether to enable or disable the specified alert configuration in the specified project. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewAlertsToggle 12 | 13 | `func NewAlertsToggle() *AlertsToggle` 14 | 15 | NewAlertsToggle instantiates a new AlertsToggle object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewAlertsToggleWithDefaults 21 | 22 | `func NewAlertsToggleWithDefaults() *AlertsToggle` 23 | 24 | NewAlertsToggleWithDefaults instantiates a new AlertsToggle object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetEnabled 29 | 30 | `func (o *AlertsToggle) GetEnabled() bool` 31 | 32 | GetEnabled returns the Enabled field if non-nil, zero value otherwise. 33 | 34 | ### GetEnabledOk 35 | 36 | `func (o *AlertsToggle) GetEnabledOk() (*bool, bool)` 37 | 38 | GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetEnabled 42 | 43 | `func (o *AlertsToggle) SetEnabled(v bool)` 44 | 45 | SetEnabled sets Enabled field to given value. 46 | 47 | ### HasEnabled 48 | 49 | `func (o *AlertsToggle) HasEnabled() bool` 50 | 51 | HasEnabled returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/ApiAtlasInvalidPolicyErrorDetail.md: -------------------------------------------------------------------------------- 1 | # ApiAtlasInvalidPolicyErrorDetail 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Detail** | Pointer to **string** | A string that provides a detailed description of a validation error. | [optional] [readonly] 8 | 9 | ## Methods 10 | 11 | ### NewApiAtlasInvalidPolicyErrorDetail 12 | 13 | `func NewApiAtlasInvalidPolicyErrorDetail() *ApiAtlasInvalidPolicyErrorDetail` 14 | 15 | NewApiAtlasInvalidPolicyErrorDetail instantiates a new ApiAtlasInvalidPolicyErrorDetail object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewApiAtlasInvalidPolicyErrorDetailWithDefaults 21 | 22 | `func NewApiAtlasInvalidPolicyErrorDetailWithDefaults() *ApiAtlasInvalidPolicyErrorDetail` 23 | 24 | NewApiAtlasInvalidPolicyErrorDetailWithDefaults instantiates a new ApiAtlasInvalidPolicyErrorDetail object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetDetail 29 | 30 | `func (o *ApiAtlasInvalidPolicyErrorDetail) GetDetail() string` 31 | 32 | GetDetail returns the Detail field if non-nil, zero value otherwise. 33 | 34 | ### GetDetailOk 35 | 36 | `func (o *ApiAtlasInvalidPolicyErrorDetail) GetDetailOk() (*string, bool)` 37 | 38 | GetDetailOk returns a tuple with the Detail field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetDetail 42 | 43 | `func (o *ApiAtlasInvalidPolicyErrorDetail) SetDetail(v string)` 44 | 45 | SetDetail sets Detail field to given value. 46 | 47 | ### HasDetail 48 | 49 | `func (o *ApiAtlasInvalidPolicyErrorDetail) HasDetail() bool` 50 | 51 | HasDetail returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/ApiAtlasPolicyCreate.md: -------------------------------------------------------------------------------- 1 | # ApiAtlasPolicyCreate 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Body** | **string** | A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. | 8 | 9 | ## Methods 10 | 11 | ### NewApiAtlasPolicyCreate 12 | 13 | `func NewApiAtlasPolicyCreate(body string, ) *ApiAtlasPolicyCreate` 14 | 15 | NewApiAtlasPolicyCreate instantiates a new ApiAtlasPolicyCreate object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewApiAtlasPolicyCreateWithDefaults 21 | 22 | `func NewApiAtlasPolicyCreateWithDefaults() *ApiAtlasPolicyCreate` 23 | 24 | NewApiAtlasPolicyCreateWithDefaults instantiates a new ApiAtlasPolicyCreate object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetBody 29 | 30 | `func (o *ApiAtlasPolicyCreate) GetBody() string` 31 | 32 | GetBody returns the Body field if non-nil, zero value otherwise. 33 | 34 | ### GetBodyOk 35 | 36 | `func (o *ApiAtlasPolicyCreate) GetBodyOk() (*string, bool)` 37 | 38 | GetBodyOk returns a tuple with the Body field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetBody 42 | 43 | `func (o *ApiAtlasPolicyCreate) SetBody(v string)` 44 | 45 | SetBody sets Body field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/ApiAtlasPolicyMetadata.md: -------------------------------------------------------------------------------- 1 | # ApiAtlasPolicyMetadata 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **PolicyId** | Pointer to **string** | Unique 24-hexadecimal character string that identifies the policy. | [optional] [readonly] 8 | 9 | ## Methods 10 | 11 | ### NewApiAtlasPolicyMetadata 12 | 13 | `func NewApiAtlasPolicyMetadata() *ApiAtlasPolicyMetadata` 14 | 15 | NewApiAtlasPolicyMetadata instantiates a new ApiAtlasPolicyMetadata object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewApiAtlasPolicyMetadataWithDefaults 21 | 22 | `func NewApiAtlasPolicyMetadataWithDefaults() *ApiAtlasPolicyMetadata` 23 | 24 | NewApiAtlasPolicyMetadataWithDefaults instantiates a new ApiAtlasPolicyMetadata object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetPolicyId 29 | 30 | `func (o *ApiAtlasPolicyMetadata) GetPolicyId() string` 31 | 32 | GetPolicyId returns the PolicyId field if non-nil, zero value otherwise. 33 | 34 | ### GetPolicyIdOk 35 | 36 | `func (o *ApiAtlasPolicyMetadata) GetPolicyIdOk() (*string, bool)` 37 | 38 | GetPolicyIdOk returns a tuple with the PolicyId field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetPolicyId 42 | 43 | `func (o *ApiAtlasPolicyMetadata) SetPolicyId(v string)` 44 | 45 | SetPolicyId sets PolicyId field to given value. 46 | 47 | ### HasPolicyId 48 | 49 | `func (o *ApiAtlasPolicyMetadata) HasPolicyId() bool` 50 | 51 | HasPolicyId returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/ApiSearchDeploymentRequest.md: -------------------------------------------------------------------------------- 1 | # ApiSearchDeploymentRequest 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Specs** | [**[]ApiSearchDeploymentSpec**](ApiSearchDeploymentSpec.md) | List of settings that configure the Search Nodes for your cluster. **NOTE**: We accept a single configuration for all nodes currently. | 8 | 9 | ## Methods 10 | 11 | ### NewApiSearchDeploymentRequest 12 | 13 | `func NewApiSearchDeploymentRequest(specs []ApiSearchDeploymentSpec, ) *ApiSearchDeploymentRequest` 14 | 15 | NewApiSearchDeploymentRequest instantiates a new ApiSearchDeploymentRequest object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewApiSearchDeploymentRequestWithDefaults 21 | 22 | `func NewApiSearchDeploymentRequestWithDefaults() *ApiSearchDeploymentRequest` 23 | 24 | NewApiSearchDeploymentRequestWithDefaults instantiates a new ApiSearchDeploymentRequest object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetSpecs 29 | 30 | `func (o *ApiSearchDeploymentRequest) GetSpecs() []ApiSearchDeploymentSpec` 31 | 32 | GetSpecs returns the Specs field if non-nil, zero value otherwise. 33 | 34 | ### GetSpecsOk 35 | 36 | `func (o *ApiSearchDeploymentRequest) GetSpecsOk() (*[]ApiSearchDeploymentSpec, bool)` 37 | 38 | GetSpecsOk returns a tuple with the Specs field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetSpecs 42 | 43 | `func (o *ApiSearchDeploymentRequest) SetSpecs(v []ApiSearchDeploymentSpec)` 44 | 45 | SetSpecs sets Specs field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/BadRequestDetail.md: -------------------------------------------------------------------------------- 1 | # BadRequestDetail 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Fields** | Pointer to [**[]FieldViolation**](FieldViolation.md) | Describes all violations in a client request. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewBadRequestDetail 12 | 13 | `func NewBadRequestDetail() *BadRequestDetail` 14 | 15 | NewBadRequestDetail instantiates a new BadRequestDetail object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewBadRequestDetailWithDefaults 21 | 22 | `func NewBadRequestDetailWithDefaults() *BadRequestDetail` 23 | 24 | NewBadRequestDetailWithDefaults instantiates a new BadRequestDetail object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetFields 29 | 30 | `func (o *BadRequestDetail) GetFields() []FieldViolation` 31 | 32 | GetFields returns the Fields field if non-nil, zero value otherwise. 33 | 34 | ### GetFieldsOk 35 | 36 | `func (o *BadRequestDetail) GetFieldsOk() (*[]FieldViolation, bool)` 37 | 38 | GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetFields 42 | 43 | `func (o *BadRequestDetail) SetFields(v []FieldViolation)` 44 | 45 | SetFields sets Fields field to given value. 46 | 47 | ### HasFields 48 | 49 | `func (o *BadRequestDetail) HasFields() bool` 50 | 51 | HasFields returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/ClusterFreeAutoScaling.md: -------------------------------------------------------------------------------- 1 | # ClusterFreeAutoScaling 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Compute** | Pointer to [**FreeComputeAutoScalingRules**](FreeComputeAutoScalingRules.md) | | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewClusterFreeAutoScaling 12 | 13 | `func NewClusterFreeAutoScaling() *ClusterFreeAutoScaling` 14 | 15 | NewClusterFreeAutoScaling instantiates a new ClusterFreeAutoScaling object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewClusterFreeAutoScalingWithDefaults 21 | 22 | `func NewClusterFreeAutoScalingWithDefaults() *ClusterFreeAutoScaling` 23 | 24 | NewClusterFreeAutoScalingWithDefaults instantiates a new ClusterFreeAutoScaling object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetCompute 29 | 30 | `func (o *ClusterFreeAutoScaling) GetCompute() FreeComputeAutoScalingRules` 31 | 32 | GetCompute returns the Compute field if non-nil, zero value otherwise. 33 | 34 | ### GetComputeOk 35 | 36 | `func (o *ClusterFreeAutoScaling) GetComputeOk() (*FreeComputeAutoScalingRules, bool)` 37 | 38 | GetComputeOk returns a tuple with the Compute field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetCompute 42 | 43 | `func (o *ClusterFreeAutoScaling) SetCompute(v FreeComputeAutoScalingRules)` 44 | 45 | SetCompute sets Compute field to given value. 46 | 47 | ### HasCompute 48 | 49 | `func (o *ClusterFreeAutoScaling) HasCompute() bool` 50 | 51 | HasCompute returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/CostExplorerFilterResponse.md: -------------------------------------------------------------------------------- 1 | # CostExplorerFilterResponse 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Token** | Pointer to **string** | The token used to identify the created Cost Explorer query. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewCostExplorerFilterResponse 12 | 13 | `func NewCostExplorerFilterResponse() *CostExplorerFilterResponse` 14 | 15 | NewCostExplorerFilterResponse instantiates a new CostExplorerFilterResponse object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewCostExplorerFilterResponseWithDefaults 21 | 22 | `func NewCostExplorerFilterResponseWithDefaults() *CostExplorerFilterResponse` 23 | 24 | NewCostExplorerFilterResponseWithDefaults instantiates a new CostExplorerFilterResponse object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetToken 29 | 30 | `func (o *CostExplorerFilterResponse) GetToken() string` 31 | 32 | GetToken returns the Token field if non-nil, zero value otherwise. 33 | 34 | ### GetTokenOk 35 | 36 | `func (o *CostExplorerFilterResponse) GetTokenOk() (*string, bool)` 37 | 38 | GetTokenOk returns a tuple with the Token field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetToken 42 | 43 | `func (o *CostExplorerFilterResponse) SetToken(v string)` 44 | 45 | SetToken sets Token field to given value. 46 | 47 | ### HasToken 48 | 49 | `func (o *CostExplorerFilterResponse) HasToken() bool` 50 | 51 | HasToken returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/DataExpirationRule.md: -------------------------------------------------------------------------------- 1 | # DataExpirationRule 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **ExpireAfterDays** | Pointer to **int** | Number of days used in the date criteria for nominating documents for deletion. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewDataExpirationRule 12 | 13 | `func NewDataExpirationRule() *DataExpirationRule` 14 | 15 | NewDataExpirationRule instantiates a new DataExpirationRule object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewDataExpirationRuleWithDefaults 21 | 22 | `func NewDataExpirationRuleWithDefaults() *DataExpirationRule` 23 | 24 | NewDataExpirationRuleWithDefaults instantiates a new DataExpirationRule object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetExpireAfterDays 29 | 30 | `func (o *DataExpirationRule) GetExpireAfterDays() int` 31 | 32 | GetExpireAfterDays returns the ExpireAfterDays field if non-nil, zero value otherwise. 33 | 34 | ### GetExpireAfterDaysOk 35 | 36 | `func (o *DataExpirationRule) GetExpireAfterDaysOk() (*int, bool)` 37 | 38 | GetExpireAfterDaysOk returns a tuple with the ExpireAfterDays field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetExpireAfterDays 42 | 43 | `func (o *DataExpirationRule) SetExpireAfterDays(v int)` 44 | 45 | SetExpireAfterDays sets ExpireAfterDays field to given value. 46 | 47 | ### HasExpireAfterDays 48 | 49 | `func (o *DataExpirationRule) HasExpireAfterDays() bool` 50 | 51 | HasExpireAfterDays returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/DataLakeAtlasStoreReadConcern.md: -------------------------------------------------------------------------------- 1 | # DataLakeAtlasStoreReadConcern 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Level** | Pointer to **string** | Read Concern level that specifies the consistency and availability of the data read. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewDataLakeAtlasStoreReadConcern 12 | 13 | `func NewDataLakeAtlasStoreReadConcern() *DataLakeAtlasStoreReadConcern` 14 | 15 | NewDataLakeAtlasStoreReadConcern instantiates a new DataLakeAtlasStoreReadConcern object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewDataLakeAtlasStoreReadConcernWithDefaults 21 | 22 | `func NewDataLakeAtlasStoreReadConcernWithDefaults() *DataLakeAtlasStoreReadConcern` 23 | 24 | NewDataLakeAtlasStoreReadConcernWithDefaults instantiates a new DataLakeAtlasStoreReadConcern object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetLevel 29 | 30 | `func (o *DataLakeAtlasStoreReadConcern) GetLevel() string` 31 | 32 | GetLevel returns the Level field if non-nil, zero value otherwise. 33 | 34 | ### GetLevelOk 35 | 36 | `func (o *DataLakeAtlasStoreReadConcern) GetLevelOk() (*string, bool)` 37 | 38 | GetLevelOk returns a tuple with the Level field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetLevel 42 | 43 | `func (o *DataLakeAtlasStoreReadConcern) SetLevel(v string)` 44 | 45 | SetLevel sets Level field to given value. 46 | 47 | ### HasLevel 48 | 49 | `func (o *DataLakeAtlasStoreReadConcern) HasLevel() bool` 50 | 51 | HasLevel returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/DiskGBAutoScaling.md: -------------------------------------------------------------------------------- 1 | # DiskGBAutoScaling 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Enabled** | Pointer to **bool** | Flag that indicates whether this cluster enables disk auto-scaling. The maximum memory allowed for the selected cluster tier and the oplog size can limit storage auto-scaling. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewDiskGBAutoScaling 12 | 13 | `func NewDiskGBAutoScaling() *DiskGBAutoScaling` 14 | 15 | NewDiskGBAutoScaling instantiates a new DiskGBAutoScaling object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewDiskGBAutoScalingWithDefaults 21 | 22 | `func NewDiskGBAutoScalingWithDefaults() *DiskGBAutoScaling` 23 | 24 | NewDiskGBAutoScalingWithDefaults instantiates a new DiskGBAutoScaling object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetEnabled 29 | 30 | `func (o *DiskGBAutoScaling) GetEnabled() bool` 31 | 32 | GetEnabled returns the Enabled field if non-nil, zero value otherwise. 33 | 34 | ### GetEnabledOk 35 | 36 | `func (o *DiskGBAutoScaling) GetEnabledOk() (*bool, bool)` 37 | 38 | GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetEnabled 42 | 43 | `func (o *DiskGBAutoScaling) SetEnabled(v bool)` 44 | 45 | SetEnabled sets Enabled field to given value. 46 | 47 | ### HasEnabled 48 | 49 | `func (o *DiskGBAutoScaling) HasEnabled() bool` 50 | 51 | HasEnabled returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/FlexBackupSettings20241113.md: -------------------------------------------------------------------------------- 1 | # FlexBackupSettings20241113 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Enabled** | Pointer to **bool** | Flag that indicates whether backups are performed for this flex cluster. Backup uses flex cluster backups. | [optional] [readonly] [default to true] 8 | 9 | ## Methods 10 | 11 | ### NewFlexBackupSettings20241113 12 | 13 | `func NewFlexBackupSettings20241113() *FlexBackupSettings20241113` 14 | 15 | NewFlexBackupSettings20241113 instantiates a new FlexBackupSettings20241113 object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewFlexBackupSettings20241113WithDefaults 21 | 22 | `func NewFlexBackupSettings20241113WithDefaults() *FlexBackupSettings20241113` 23 | 24 | NewFlexBackupSettings20241113WithDefaults instantiates a new FlexBackupSettings20241113 object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetEnabled 29 | 30 | `func (o *FlexBackupSettings20241113) GetEnabled() bool` 31 | 32 | GetEnabled returns the Enabled field if non-nil, zero value otherwise. 33 | 34 | ### GetEnabledOk 35 | 36 | `func (o *FlexBackupSettings20241113) GetEnabledOk() (*bool, bool)` 37 | 38 | GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetEnabled 42 | 43 | `func (o *FlexBackupSettings20241113) SetEnabled(v bool)` 44 | 45 | SetEnabled sets Enabled field to given value. 46 | 47 | ### HasEnabled 48 | 49 | `func (o *FlexBackupSettings20241113) HasEnabled() bool` 50 | 51 | HasEnabled returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/GroupInvitationUpdateRequest.md: -------------------------------------------------------------------------------- 1 | # GroupInvitationUpdateRequest 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Roles** | Pointer to **[]string** | One or more project-level roles to assign to the MongoDB Cloud user. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewGroupInvitationUpdateRequest 12 | 13 | `func NewGroupInvitationUpdateRequest() *GroupInvitationUpdateRequest` 14 | 15 | NewGroupInvitationUpdateRequest instantiates a new GroupInvitationUpdateRequest object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewGroupInvitationUpdateRequestWithDefaults 21 | 22 | `func NewGroupInvitationUpdateRequestWithDefaults() *GroupInvitationUpdateRequest` 23 | 24 | NewGroupInvitationUpdateRequestWithDefaults instantiates a new GroupInvitationUpdateRequest object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetRoles 29 | 30 | `func (o *GroupInvitationUpdateRequest) GetRoles() []string` 31 | 32 | GetRoles returns the Roles field if non-nil, zero value otherwise. 33 | 34 | ### GetRolesOk 35 | 36 | `func (o *GroupInvitationUpdateRequest) GetRolesOk() (*[]string, bool)` 37 | 38 | GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetRoles 42 | 43 | `func (o *GroupInvitationUpdateRequest) SetRoles(v []string)` 44 | 45 | SetRoles sets Roles field to given value. 46 | 47 | ### HasRoles 48 | 49 | `func (o *GroupInvitationUpdateRequest) HasRoles() bool` 50 | 51 | HasRoles returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/GroupService.md: -------------------------------------------------------------------------------- 1 | # GroupService 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Clusters** | Pointer to [**[]ClusterIPAddresses**](ClusterIPAddresses.md) | IP addresses of clusters. | [optional] [readonly] 8 | 9 | ## Methods 10 | 11 | ### NewGroupService 12 | 13 | `func NewGroupService() *GroupService` 14 | 15 | NewGroupService instantiates a new GroupService object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewGroupServiceWithDefaults 21 | 22 | `func NewGroupServiceWithDefaults() *GroupService` 23 | 24 | NewGroupServiceWithDefaults instantiates a new GroupService object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetClusters 29 | 30 | `func (o *GroupService) GetClusters() []ClusterIPAddresses` 31 | 32 | GetClusters returns the Clusters field if non-nil, zero value otherwise. 33 | 34 | ### GetClustersOk 35 | 36 | `func (o *GroupService) GetClustersOk() (*[]ClusterIPAddresses, bool)` 37 | 38 | GetClustersOk returns a tuple with the Clusters field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetClusters 42 | 43 | `func (o *GroupService) SetClusters(v []ClusterIPAddresses)` 44 | 45 | SetClusters sets Clusters field to given value. 46 | 47 | ### HasClusters 48 | 49 | `func (o *GroupService) HasClusters() bool` 50 | 51 | HasClusters returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/GroupServiceAccountRoleAssignment.md: -------------------------------------------------------------------------------- 1 | # GroupServiceAccountRoleAssignment 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Roles** | **[]string** | The Project permissions for the Service Account in the specified Project. | 8 | 9 | ## Methods 10 | 11 | ### NewGroupServiceAccountRoleAssignment 12 | 13 | `func NewGroupServiceAccountRoleAssignment(roles []string, ) *GroupServiceAccountRoleAssignment` 14 | 15 | NewGroupServiceAccountRoleAssignment instantiates a new GroupServiceAccountRoleAssignment object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewGroupServiceAccountRoleAssignmentWithDefaults 21 | 22 | `func NewGroupServiceAccountRoleAssignmentWithDefaults() *GroupServiceAccountRoleAssignment` 23 | 24 | NewGroupServiceAccountRoleAssignmentWithDefaults instantiates a new GroupServiceAccountRoleAssignment object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetRoles 29 | 30 | `func (o *GroupServiceAccountRoleAssignment) GetRoles() []string` 31 | 32 | GetRoles returns the Roles field if non-nil, zero value otherwise. 33 | 34 | ### GetRolesOk 35 | 36 | `func (o *GroupServiceAccountRoleAssignment) GetRolesOk() (*[]string, bool)` 37 | 38 | GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetRoles 42 | 43 | `func (o *GroupServiceAccountRoleAssignment) SetRoles(v []string)` 44 | 45 | SetRoles sets Roles field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/MongoDBAccessLogsList.md: -------------------------------------------------------------------------------- 1 | # MongoDBAccessLogsList 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **AccessLogs** | Pointer to [**[]MongoDBAccessLogs**](MongoDBAccessLogs.md) | Authentication attempt, one per object, made against the cluster. | [optional] [readonly] 8 | 9 | ## Methods 10 | 11 | ### NewMongoDBAccessLogsList 12 | 13 | `func NewMongoDBAccessLogsList() *MongoDBAccessLogsList` 14 | 15 | NewMongoDBAccessLogsList instantiates a new MongoDBAccessLogsList object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewMongoDBAccessLogsListWithDefaults 21 | 22 | `func NewMongoDBAccessLogsListWithDefaults() *MongoDBAccessLogsList` 23 | 24 | NewMongoDBAccessLogsListWithDefaults instantiates a new MongoDBAccessLogsList object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetAccessLogs 29 | 30 | `func (o *MongoDBAccessLogsList) GetAccessLogs() []MongoDBAccessLogs` 31 | 32 | GetAccessLogs returns the AccessLogs field if non-nil, zero value otherwise. 33 | 34 | ### GetAccessLogsOk 35 | 36 | `func (o *MongoDBAccessLogsList) GetAccessLogsOk() (*[]MongoDBAccessLogs, bool)` 37 | 38 | GetAccessLogsOk returns a tuple with the AccessLogs field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetAccessLogs 42 | 43 | `func (o *MongoDBAccessLogsList) SetAccessLogs(v []MongoDBAccessLogs)` 44 | 45 | SetAccessLogs sets AccessLogs field to given value. 46 | 47 | ### HasAccessLogs 48 | 49 | `func (o *MongoDBAccessLogsList) HasAccessLogs() bool` 50 | 51 | HasAccessLogs returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/Namespaces.md: -------------------------------------------------------------------------------- 1 | # Namespaces 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Namespaces** | Pointer to [**[]NamespaceObj**](NamespaceObj.md) | List that contains each combination of database, collection, and type on the specified host. | [optional] [readonly] 8 | 9 | ## Methods 10 | 11 | ### NewNamespaces 12 | 13 | `func NewNamespaces() *Namespaces` 14 | 15 | NewNamespaces instantiates a new Namespaces object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewNamespacesWithDefaults 21 | 22 | `func NewNamespacesWithDefaults() *Namespaces` 23 | 24 | NewNamespacesWithDefaults instantiates a new Namespaces object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetNamespaces 29 | 30 | `func (o *Namespaces) GetNamespaces() []NamespaceObj` 31 | 32 | GetNamespaces returns the Namespaces field if non-nil, zero value otherwise. 33 | 34 | ### GetNamespacesOk 35 | 36 | `func (o *Namespaces) GetNamespacesOk() (*[]NamespaceObj, bool)` 37 | 38 | GetNamespacesOk returns a tuple with the Namespaces field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetNamespaces 42 | 43 | `func (o *Namespaces) SetNamespaces(v []NamespaceObj)` 44 | 45 | SetNamespaces sets Namespaces field to given value. 46 | 47 | ### HasNamespaces 48 | 49 | `func (o *Namespaces) HasNamespaces() bool` 50 | 51 | HasNamespaces returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/NamespacesRequest.md: -------------------------------------------------------------------------------- 1 | # NamespacesRequest 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Namespaces** | Pointer to **[]string** | List of namespace strings (combination of database and collection) on the specified host or cluster. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewNamespacesRequest 12 | 13 | `func NewNamespacesRequest() *NamespacesRequest` 14 | 15 | NewNamespacesRequest instantiates a new NamespacesRequest object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewNamespacesRequestWithDefaults 21 | 22 | `func NewNamespacesRequestWithDefaults() *NamespacesRequest` 23 | 24 | NewNamespacesRequestWithDefaults instantiates a new NamespacesRequest object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetNamespaces 29 | 30 | `func (o *NamespacesRequest) GetNamespaces() []string` 31 | 32 | GetNamespaces returns the Namespaces field if non-nil, zero value otherwise. 33 | 34 | ### GetNamespacesOk 35 | 36 | `func (o *NamespacesRequest) GetNamespacesOk() (*[]string, bool)` 37 | 38 | GetNamespacesOk returns a tuple with the Namespaces field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetNamespaces 42 | 43 | `func (o *NamespacesRequest) SetNamespaces(v []string)` 44 | 45 | SetNamespaces sets Namespaces field to given value. 46 | 47 | ### HasNamespaces 48 | 49 | `func (o *NamespacesRequest) HasNamespaces() bool` 50 | 51 | HasNamespaces returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/PrivateIPMode.md: -------------------------------------------------------------------------------- 1 | # PrivateIPMode 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Enabled** | **bool** | Flag that indicates whether someone enabled **Connect via Peering Only** mode for the specified project. | 8 | 9 | ## Methods 10 | 11 | ### NewPrivateIPMode 12 | 13 | `func NewPrivateIPMode(enabled bool, ) *PrivateIPMode` 14 | 15 | NewPrivateIPMode instantiates a new PrivateIPMode object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewPrivateIPModeWithDefaults 21 | 22 | `func NewPrivateIPModeWithDefaults() *PrivateIPMode` 23 | 24 | NewPrivateIPModeWithDefaults instantiates a new PrivateIPMode object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetEnabled 29 | 30 | `func (o *PrivateIPMode) GetEnabled() bool` 31 | 32 | GetEnabled returns the Enabled field if non-nil, zero value otherwise. 33 | 34 | ### GetEnabledOk 35 | 36 | `func (o *PrivateIPMode) GetEnabledOk() (*bool, bool)` 37 | 38 | GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetEnabled 42 | 43 | `func (o *PrivateIPMode) SetEnabled(v bool)` 44 | 45 | SetEnabled sets Enabled field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/SearchIndexUpdateRequest.md: -------------------------------------------------------------------------------- 1 | # SearchIndexUpdateRequest 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Definition** | [**SearchIndexUpdateRequestDefinition**](SearchIndexUpdateRequestDefinition.md) | | 8 | 9 | ## Methods 10 | 11 | ### NewSearchIndexUpdateRequest 12 | 13 | `func NewSearchIndexUpdateRequest(definition SearchIndexUpdateRequestDefinition, ) *SearchIndexUpdateRequest` 14 | 15 | NewSearchIndexUpdateRequest instantiates a new SearchIndexUpdateRequest object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewSearchIndexUpdateRequestWithDefaults 21 | 22 | `func NewSearchIndexUpdateRequestWithDefaults() *SearchIndexUpdateRequest` 23 | 24 | NewSearchIndexUpdateRequestWithDefaults instantiates a new SearchIndexUpdateRequest object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetDefinition 29 | 30 | `func (o *SearchIndexUpdateRequest) GetDefinition() SearchIndexUpdateRequestDefinition` 31 | 32 | GetDefinition returns the Definition field if non-nil, zero value otherwise. 33 | 34 | ### GetDefinitionOk 35 | 36 | `func (o *SearchIndexUpdateRequest) GetDefinitionOk() (*SearchIndexUpdateRequestDefinition, bool)` 37 | 38 | GetDefinitionOk returns a tuple with the Definition field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetDefinition 42 | 43 | `func (o *SearchIndexUpdateRequest) SetDefinition(v SearchIndexUpdateRequestDefinition)` 44 | 45 | SetDefinition sets Definition field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/ServerlessTenantCreateRequest.md: -------------------------------------------------------------------------------- 1 | # ServerlessTenantCreateRequest 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Comment** | Pointer to **string** | Human-readable comment associated with the private endpoint. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewServerlessTenantCreateRequest 12 | 13 | `func NewServerlessTenantCreateRequest() *ServerlessTenantCreateRequest` 14 | 15 | NewServerlessTenantCreateRequest instantiates a new ServerlessTenantCreateRequest object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewServerlessTenantCreateRequestWithDefaults 21 | 22 | `func NewServerlessTenantCreateRequestWithDefaults() *ServerlessTenantCreateRequest` 23 | 24 | NewServerlessTenantCreateRequestWithDefaults instantiates a new ServerlessTenantCreateRequest object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetComment 29 | 30 | `func (o *ServerlessTenantCreateRequest) GetComment() string` 31 | 32 | GetComment returns the Comment field if non-nil, zero value otherwise. 33 | 34 | ### GetCommentOk 35 | 36 | `func (o *ServerlessTenantCreateRequest) GetCommentOk() (*string, bool)` 37 | 38 | GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetComment 42 | 43 | `func (o *ServerlessTenantCreateRequest) SetComment(v string)` 44 | 45 | SetComment sets Comment field to given value. 46 | 47 | ### HasComment 48 | 49 | `func (o *ServerlessTenantCreateRequest) HasComment() bool` 50 | 51 | HasComment returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/ServiceAccountGroup.md: -------------------------------------------------------------------------------- 1 | # ServiceAccountGroup 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **GroupId** | Pointer to **string** | Unique 24-hexadecimal digit string that identifies your project. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. | [optional] [readonly] 8 | 9 | ## Methods 10 | 11 | ### NewServiceAccountGroup 12 | 13 | `func NewServiceAccountGroup() *ServiceAccountGroup` 14 | 15 | NewServiceAccountGroup instantiates a new ServiceAccountGroup object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewServiceAccountGroupWithDefaults 21 | 22 | `func NewServiceAccountGroupWithDefaults() *ServiceAccountGroup` 23 | 24 | NewServiceAccountGroupWithDefaults instantiates a new ServiceAccountGroup object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetGroupId 29 | 30 | `func (o *ServiceAccountGroup) GetGroupId() string` 31 | 32 | GetGroupId returns the GroupId field if non-nil, zero value otherwise. 33 | 34 | ### GetGroupIdOk 35 | 36 | `func (o *ServiceAccountGroup) GetGroupIdOk() (*string, bool)` 37 | 38 | GetGroupIdOk returns a tuple with the GroupId field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetGroupId 42 | 43 | `func (o *ServiceAccountGroup) SetGroupId(v string)` 44 | 45 | SetGroupId sets GroupId field to given value. 46 | 47 | ### HasGroupId 48 | 49 | `func (o *ServiceAccountGroup) HasGroupId() bool` 50 | 51 | HasGroupId returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/ShardKeys.md: -------------------------------------------------------------------------------- 1 | # ShardKeys 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Key** | Pointer to [**[]any**](any.md) | List of fields to use for the shard key. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewShardKeys 12 | 13 | `func NewShardKeys() *ShardKeys` 14 | 15 | NewShardKeys instantiates a new ShardKeys object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewShardKeysWithDefaults 21 | 22 | `func NewShardKeysWithDefaults() *ShardKeys` 23 | 24 | NewShardKeysWithDefaults instantiates a new ShardKeys object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetKey 29 | 30 | `func (o *ShardKeys) GetKey() []any` 31 | 32 | GetKey returns the Key field if non-nil, zero value otherwise. 33 | 34 | ### GetKeyOk 35 | 36 | `func (o *ShardKeys) GetKeyOk() (*[]any, bool)` 37 | 38 | GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetKey 42 | 43 | `func (o *ShardKeys) SetKey(v []any)` 44 | 45 | SetKey sets Key field to given value. 46 | 47 | ### HasKey 48 | 49 | `func (o *ShardKeys) HasKey() bool` 50 | 51 | HasKey returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/docs/SynonymSource.md: -------------------------------------------------------------------------------- 1 | # SynonymSource 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Collection** | **string** | Label that identifies the MongoDB collection that stores words and their applicable synonyms. | 8 | 9 | ## Methods 10 | 11 | ### NewSynonymSource 12 | 13 | `func NewSynonymSource(collection string, ) *SynonymSource` 14 | 15 | NewSynonymSource instantiates a new SynonymSource object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewSynonymSourceWithDefaults 21 | 22 | `func NewSynonymSourceWithDefaults() *SynonymSource` 23 | 24 | NewSynonymSourceWithDefaults instantiates a new SynonymSource object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetCollection 29 | 30 | `func (o *SynonymSource) GetCollection() string` 31 | 32 | GetCollection returns the Collection field if non-nil, zero value otherwise. 33 | 34 | ### GetCollectionOk 35 | 36 | `func (o *SynonymSource) GetCollectionOk() (*string, bool)` 37 | 38 | GetCollectionOk returns a tuple with the Collection field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetCollection 42 | 43 | `func (o *SynonymSource) SetCollection(v string)` 44 | 45 | SetCollection sets Collection field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/TargetOrg.md: -------------------------------------------------------------------------------- 1 | # TargetOrg 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **LinkToken** | **string** | Link token that contains all the information required to complete the link. | 8 | 9 | ## Methods 10 | 11 | ### NewTargetOrg 12 | 13 | `func NewTargetOrg(linkToken string, ) *TargetOrg` 14 | 15 | NewTargetOrg instantiates a new TargetOrg object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewTargetOrgWithDefaults 21 | 22 | `func NewTargetOrgWithDefaults() *TargetOrg` 23 | 24 | NewTargetOrgWithDefaults instantiates a new TargetOrg object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetLinkToken 29 | 30 | `func (o *TargetOrg) GetLinkToken() string` 31 | 32 | GetLinkToken returns the LinkToken field if non-nil, zero value otherwise. 33 | 34 | ### GetLinkTokenOk 35 | 36 | `func (o *TargetOrg) GetLinkTokenOk() (*string, bool)` 37 | 38 | GetLinkTokenOk returns a tuple with the LinkToken field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetLinkToken 42 | 43 | `func (o *TargetOrg) SetLinkToken(v string)` 44 | 45 | SetLinkToken sets LinkToken field to given value. 46 | 47 | 48 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/docs/TargetOrgRequest.md: -------------------------------------------------------------------------------- 1 | # TargetOrgRequest 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **AccessListIps** | Pointer to **[]string** | IP address access list entries associated with the API key. | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewTargetOrgRequest 12 | 13 | `func NewTargetOrgRequest() *TargetOrgRequest` 14 | 15 | NewTargetOrgRequest instantiates a new TargetOrgRequest object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewTargetOrgRequestWithDefaults 21 | 22 | `func NewTargetOrgRequestWithDefaults() *TargetOrgRequest` 23 | 24 | NewTargetOrgRequestWithDefaults instantiates a new TargetOrgRequest object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetAccessListIps 29 | 30 | `func (o *TargetOrgRequest) GetAccessListIps() []string` 31 | 32 | GetAccessListIps returns the AccessListIps field if non-nil, zero value otherwise. 33 | 34 | ### GetAccessListIpsOk 35 | 36 | `func (o *TargetOrgRequest) GetAccessListIpsOk() (*[]string, bool)` 37 | 38 | GetAccessListIpsOk returns a tuple with the AccessListIps field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetAccessListIps 42 | 43 | `func (o *TargetOrgRequest) SetAccessListIps(v []string)` 44 | 45 | SetAccessListIps sets AccessListIps field to given value. 46 | 47 | ### HasAccessListIps 48 | 49 | `func (o *TargetOrgRequest) HasAccessListIps() bool` 50 | 51 | HasAccessListIps returns a boolean if a field has been set. 52 | 53 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 54 | 55 | 56 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Go SDK examples 2 | 3 | ## Running Examples 4 | 5 | For documentation about obtaining apiKey and apiSecret go to 6 | https://docs.atlas.mongodb.com/configure-api-access. 7 | 8 | ```bash 9 | export MONGODB_ATLAS_PUBLIC_KEY=somekey 10 | export MONGODB_ATLAS_PRIVATE_KEY=some-secret-key-for-gosdkapi 11 | go run ./aws_cluster/aws.go 12 | ``` 13 | 14 | ## Running Examples with Mocked Backend 15 | 16 | SDK provides mocks using Testify and Mockery. 17 | One of the SDK examples covers usage of the mockery within tests. 18 | 19 | ```bash 20 | go test ./mock/cluster_test.go 21 | ``` 22 | 23 | ## Examples Reference 24 | 25 | ### Retry Example 26 | 27 | Example provides automatic retries for all HTTP 500, 429 HTTP status errors. 28 | 29 | ```bash 30 | go run ./retry/retry.go 31 | ``` 32 | -------------------------------------------------------------------------------- /examples/basic/basic.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | 8 | "context" 9 | 10 | "go.mongodb.org/atlas-sdk/v20250312003/admin" 11 | "go.mongodb.org/atlas-sdk/v20250312003/examples" 12 | ) 13 | 14 | /* 15 | * MongoDB Atlas Go SDK Basic Example 16 | */ 17 | func main() { 18 | ctx := context.Background() 19 | // Values provided as part of env variables 20 | // See: https://www.mongodb.com/docs/atlas/app-services/authentication/api-key/ 21 | apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") 22 | apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") 23 | url := os.Getenv("MONGODB_ATLAS_BASE_URL") 24 | 25 | sdk, err := admin.NewClient( 26 | admin.UseDigestAuth(apiKey, apiSecret), 27 | admin.UseBaseURL(url)) 28 | examples.HandleErr(err, nil) 29 | 30 | // -- 1. Get first project 31 | request := sdk.ProjectsApi.ListProjectsWithParams(ctx, 32 | // 2. We are passing a struct with all parameters to the request 33 | &admin.ListProjectsApiParams{ 34 | ItemsPerPage: admin.PtrInt(1), 35 | IncludeCount: admin.PtrBool(true), 36 | PageNum: admin.PtrInt(1), 37 | }) 38 | 39 | // 3. We can also use builder pattern to construct request 40 | projects, response, err := request.IncludeCount(true).PageNum(1).Execute() 41 | examples.HandleErr(err, response) 42 | 43 | if projects.GetTotalCount() == 0 { 44 | log.Fatal("account should have at least single project") 45 | } 46 | 47 | projectId := projects.GetResults()[0].GetId() 48 | fmt.Printf("Project we use %v", projectId) 49 | } 50 | -------------------------------------------------------------------------------- /examples/download/downloadLogs.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "io" 5 | "log" 6 | "os" 7 | 8 | "context" 9 | 10 | "go.mongodb.org/atlas-sdk/v20250312003/admin" 11 | "go.mongodb.org/atlas-sdk/v20250312003/examples" 12 | ) 13 | 14 | /* 15 | * MongoDB Atlas Go SDK Example for fetching cluster logs file content 16 | */ 17 | func main() { 18 | ctx := context.Background() 19 | // Values provided as part of env variables 20 | // See: https://www.mongodb.com/docs/atlas/app-services/authentication/api-key/ 21 | apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") 22 | apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") 23 | url := os.Getenv("MONGODB_ATLAS_BASE_URL") 24 | 25 | sdk, err := admin.NewClient( 26 | admin.UseDigestAuth(apiKey, apiSecret), 27 | admin.UseBaseURL(url), 28 | admin.UseDebug(false)) 29 | examples.HandleErr(err, nil) 30 | 31 | // -- 1. Get first project 32 | projects, response, err := sdk.ProjectsApi.ListProjectsWithParams(ctx, 33 | &admin.ListProjectsApiParams{ 34 | ItemsPerPage: admin.PtrInt(1), 35 | IncludeCount: admin.PtrBool(true), 36 | PageNum: admin.PtrInt(1), 37 | }).Execute() 38 | examples.HandleErr(err, response) 39 | 40 | if projects.GetTotalCount() == 0 { 41 | log.Fatal("account should have at least single project") 42 | } 43 | projectId := projects.GetResults()[0].GetId() 44 | 45 | // -- 2. Get first Process 46 | hosts, response, err := sdk.MonitoringAndLogsApi.ListAtlasProcesses(ctx, projectId).Execute() 47 | examples.HandleErr(err, response) 48 | if len(hosts.GetResults()) == 0 { 49 | log.Fatal("your cluster should have at least single host. Are you running Atlas M0?") 50 | } 51 | host := hosts.GetResults()[0].GetHostname() 52 | params := &admin.GetHostLogsApiParams{ 53 | GroupId: projectId, 54 | HostName: host, 55 | LogName: "mongos", 56 | } 57 | 58 | logs, response, err := sdk.MonitoringAndLogsApi.GetHostLogsWithParams(ctx, params).Execute() 59 | examples.HandleErr(err, response) 60 | defer func() { 61 | _ = logs.Close() 62 | }() 63 | _, err = io.Copy(os.Stdout, logs) 64 | examples.HandleErr(err, nil) 65 | } 66 | -------------------------------------------------------------------------------- /examples/errors.go: -------------------------------------------------------------------------------- 1 | package examples 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "net/http" 7 | 8 | "go.mongodb.org/atlas-sdk/v20250312003/admin" 9 | ) 10 | 11 | func HandleErr(err error, resp *http.Response) { 12 | if err == nil { 13 | return 14 | } 15 | 16 | if resp != nil { 17 | fmt.Println(resp.Body) 18 | } 19 | // Printing generic message 20 | fmt.Println(err.Error()) 21 | apiErr, _ := admin.AsError(err) 22 | log.Fatalf("Error when performing SDK request: %v", apiErr.GetDetail()) 23 | } 24 | -------------------------------------------------------------------------------- /examples/go.mod: -------------------------------------------------------------------------------- 1 | module go.mongodb.org/atlas-sdk/v20250312003/examples 2 | 3 | go 1.23.0 4 | 5 | toolchain go1.24.1 6 | 7 | replace go.mongodb.org/atlas-sdk/v20250312003 => ../ 8 | 9 | require ( 10 | github.com/hashicorp/go-retryablehttp v0.7.7 11 | github.com/mongodb-forks/digest v1.1.0 12 | go.mongodb.org/atlas-sdk/v20250312003 v20250312003.1.0 13 | ) 14 | 15 | require ( 16 | github.com/davecgh/go-spew v1.1.1 // indirect 17 | github.com/hashicorp/go-cleanhttp v0.5.2 // indirect 18 | github.com/pmezard/go-difflib v1.0.0 // indirect 19 | github.com/stretchr/objx v0.5.2 // indirect 20 | github.com/stretchr/testify v1.10.0 21 | golang.org/x/oauth2 v0.30.0 // indirect 22 | gopkg.in/yaml.v3 v3.0.1 // indirect 23 | ) 24 | -------------------------------------------------------------------------------- /examples/invoice/invoice.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | 8 | "context" 9 | 10 | "go.mongodb.org/atlas-sdk/v20250312003/admin" 11 | "go.mongodb.org/atlas-sdk/v20250312003/examples" 12 | ) 13 | 14 | func main() { 15 | ctx := context.Background() 16 | url := os.Getenv("MONGODB_ATLAS_BASE_URL") 17 | if url == "" { 18 | url = "https://cloud.mongodb.com" 19 | } 20 | apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") 21 | apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") 22 | orgID := os.Getenv("MONGODB_ATLAS_ORG_ID") 23 | invoiceID := os.Getenv("MONGODB_ATLAS_INVOICE_ID") 24 | if apiKey == "" || apiSecret == "" || orgID == "" || invoiceID == "" { 25 | log.Fatal("Environment variables MONGODB_ATLAS_PUBLIC_KEY, MONGODB_ATLAS_PRIVATE_KEY, MONGODB_ATLAS_ORG_ID and MONGODB_ATLAS_INVOICE_ID are required") 26 | } 27 | 28 | sdk, err := admin.NewClient( 29 | admin.UseDigestAuth(apiKey, apiSecret), 30 | admin.UseBaseURL(url)) 31 | examples.HandleErr(err, nil) 32 | 33 | invoice, response, err := sdk.InvoicesApi.GetInvoice(ctx, orgID, invoiceID).Execute() 34 | examples.HandleErr(err, response) 35 | 36 | fmt.Printf("Content-Type: %v\n", response.Header.Get("Content-Type")) 37 | fmt.Printf("Invoice object: %v\n", invoice) 38 | fmt.Printf("Org: %s, Created: %v, AmountBilledCents: %d\n", invoice.GetOrgId(), invoice.GetCreated(), invoice.GetAmountBilledCents()) 39 | } 40 | -------------------------------------------------------------------------------- /examples/regions/regions.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | 8 | "context" 9 | 10 | "go.mongodb.org/atlas-sdk/v20250312003/admin" 11 | "go.mongodb.org/atlas-sdk/v20250312003/examples" 12 | ) 13 | 14 | /* 15 | * MongoDB Atlas Go SDK Example for fetching cloud provider regions 16 | */ 17 | func main() { 18 | ctx := context.Background() 19 | // Values provided as part of env variables 20 | // See: https://www.mongodb.com/docs/atlas/app-services/authentication/api-key/ 21 | apiKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY") 22 | apiSecret := os.Getenv("MONGODB_ATLAS_PRIVATE_KEY") 23 | url := os.Getenv("MONGODB_ATLAS_BASE_URL") 24 | 25 | sdk, err := admin.NewClient( 26 | admin.UseDigestAuth(apiKey, apiSecret), 27 | admin.UseBaseURL(url), 28 | admin.UseDebug(false)) 29 | examples.HandleErr(err, nil) 30 | 31 | // -- 1. Get first project 32 | projects, response, err := sdk.ProjectsApi.ListProjectsWithParams(ctx, 33 | &admin.ListProjectsApiParams{ 34 | ItemsPerPage: admin.PtrInt(1), 35 | IncludeCount: admin.PtrBool(true), 36 | PageNum: admin.PtrInt(1), 37 | }).Execute() 38 | examples.HandleErr(err, response) 39 | 40 | if projects.GetTotalCount() == 0 { 41 | log.Fatal("account should have at least single project") 42 | } 43 | 44 | projectId := projects.GetResults()[0].GetId() 45 | providers := []string{"AWS", "GCP", "AZURE"} 46 | regions, response, err := sdk.ClustersApi.ListCloudProviderRegions(ctx, projectId).Providers(providers).Execute() 47 | examples.HandleErr(err, response) 48 | fmt.Println(regions) 49 | } 50 | -------------------------------------------------------------------------------- /githooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | STAGED_GO_FILES=$(git diff --cached --name-only | grep ".go$") 4 | 5 | for FILE in ${STAGED_GO_FILES} 6 | do 7 | goimports -w "${FILE}" 8 | git add "${FILE}" 9 | done 10 | 11 | if [[ -n "${STAGED_GO_FILES}" ]]; then 12 | set -o errexit 13 | go test -race ./... 14 | make lint-fix 15 | set +o errexit 16 | fi 17 | -------------------------------------------------------------------------------- /githooks/pre-push: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # A simple pre-push hook which ensures that the tag being pushed to GitHub 4 | # matches the version defined in code. 5 | # 6 | # Determine if a tag is being pushed 7 | tag= 8 | input=$( Adding copy notice..." 31 | for FILE in $(find_files); do 32 | addlicense -c "MongoDB Inc" "${FILE}" 33 | done 34 | echo "==> Licensing operation finished with success." 35 | -------------------------------------------------------------------------------- /scripts/toc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | 5 | BIN_FOLDER=./bin 6 | DOCS_FOLDER=./docs 7 | 8 | pushd $BIN_FOLDER 9 | 10 | if which "./gh-md-toc" >/dev/null 2>&1; then 11 | echo "Binary gh-md-toc exists." 12 | else 13 | echo Downloading scripts 14 | 15 | curl -O https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc 16 | chmod a+x gh-md-toc 17 | fi 18 | 19 | docsbin=$(readlink -f "./gh-md-toc") 20 | 21 | popd 22 | 23 | echo "generating table of contents" 24 | echo "# Atlas SDK GO documentation" > ./docs/README.md 25 | 26 | pushd $DOCS_FOLDER 27 | 28 | $docsbin --skip-header ./doc_*.md >> ./README.md 29 | 30 | popd 31 | -------------------------------------------------------------------------------- /test/example_client_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "fmt" 5 | 6 | "go.mongodb.org/atlas-sdk/v20250312003/admin" 7 | ) 8 | 9 | func ExampleNewClient() { 10 | apiKey := "test" 11 | apiSecret := "test" 12 | host := "https://cloud.mongodb.com" 13 | 14 | sdk, err := admin.NewClient( 15 | admin.UseDigestAuth(apiKey, apiSecret), 16 | admin.UseBaseURL(host), 17 | admin.UseDebug(false)) 18 | 19 | if err != nil { 20 | fmt.Println(err) 21 | } 22 | 23 | serverURL := sdk.GetConfig().Servers[0].URL 24 | fmt.Println(serverURL) 25 | // Output: 26 | // https://cloud.mongodb.com 27 | } 28 | -------------------------------------------------------------------------------- /test/generated/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/atlas-sdk-go/dfa7c5a72f6d2e72433f8e71e0c413513d70b129/test/generated/.keep -------------------------------------------------------------------------------- /tools/.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /tools/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing OpenAPI Generation Tools 2 | 3 | ## Changes in tools 4 | 5 | We need to regenerate our SDK every time tools are changed as - changes might affect the generated SDK. 6 | PR based checks will verify if changes are up to date. 7 | 8 | ```bash 9 | make clean_and_generate 10 | ``` 11 | 12 | ## OpenAPI generator 13 | 14 | OpenAPI generator version is set in [./openapitools.json](./openapitools.json) file. 15 | 16 | ## Transformer 17 | 18 | Follow [transformer readme](./transformer/README.md) for more information 19 | 20 | ## Modification of the custom templates 21 | 22 | Some of the templates were modified to fit for our general needs. 23 | We use mustache comments to mark templates as modified: 24 | 25 | - `{{! X-XGEN-CUSTOM }}` - usually present at the top of the file - means that the whole file is currently customized. 26 | - `{{! X-XGEN-MODIFIED }}` - is put into existing templates to note areas in the code that were customized. 27 | 28 | ## Generating custom files 29 | 30 | Tools enable us to generate custom files using OpenAPI model. 31 | We can for example generate unit tests or other helpers that are required. 32 | To generate custom file add custom template edit config.yaml: 33 | 34 | ```yaml 35 | files: 36 | myclient.mustache: 37 | templateType: SupportingFiles 38 | destinationFilename: yourresultfilename.go 39 | ``` 40 | 41 | ## Custom templates 42 | 43 | By default `./tools/config/go-templates` folder have all available templates as part of the openapi generator. 44 | This enables us to verify new templates changes. 45 | Templates are sourced from openapi generator: 46 | 47 | https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/go 48 | 49 | ## gorelease 50 | 51 | We use [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease) to detect if there are breaking changes and a new major version release is needed. 52 | In [Generate SDK Github action](../.github/workflows/autoupdate-prod.yaml), the last release is used for comparison. 53 | -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | export OPENAPI_FOLDER=../openapi 2 | export SDK_FOLDER=../admin 3 | export DOC_FOLDER=../docs 4 | 5 | .DEFAULT_GOAL := generate_client 6 | 7 | .PHONY: clean_client 8 | clean_client: 9 | rm -Rf ../admin 10 | 11 | .PHONY: fetch_openapi 12 | fetch_openapi: 13 | ./scripts/fetch.sh 14 | 15 | .PHONY: transform_openapi 16 | transform_openapi: 17 | ./scripts/transform.sh 18 | 19 | .PHONY: generate_client 20 | generate_client: 21 | ./scripts/generate.sh 22 | 23 | .PHONY: clean_and_generate 24 | clean_and_generate: clean_client generate_client 25 | 26 | .PHONY: generate_docs 27 | generate_docs: 28 | rm -Rf ../docs/docs/* 29 | ./scripts/generate_docs.sh 30 | 31 | .PHONY: generate_tests 32 | generate_tests: 33 | rm -Rf ../test/generated/test* 34 | ./scripts/generate_tests.sh 35 | 36 | .PHONY: new-version 37 | new-version: 38 | ./releaser/scripts/new-version.sh 39 | 40 | .PHONY: preview-version 41 | preview-version: 42 | ./releaser/scripts/preview-version.sh 43 | 44 | .PHONY: update-version 45 | update-version: 46 | ## When manually updating major version 47 | ./releaser/scripts/update-major-version.sh 48 | 49 | .PHONY: generate_mocks 50 | generate_mocks: 51 | ./scripts/generate_mocks.sh 52 | -------------------------------------------------------------------------------- /tools/config/.go-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | **/docs/*.md 8 | **/test/* 9 | **FILES 10 | **VERSION 11 | **go.mod 12 | **go.sum 13 | **openapi-generator-ignore 14 | **travis.yml 15 | **git_push.sh 16 | **/README.md 17 | -------------------------------------------------------------------------------- /tools/config/.go-ignore-docs: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | **/*.* 8 | !**/*.md 9 | .openapi-generator 10 | -------------------------------------------------------------------------------- /tools/config/.go-ignore-tests: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | **/*.* 8 | !**/test/*.go 9 | -------------------------------------------------------------------------------- /tools/config/config.yaml: -------------------------------------------------------------------------------- 1 | generatorName: go 2 | gitRepoId: atlas-sdk-go 3 | gitUserId: mongodb 4 | vanityURL: go.mongodb.org/atlas-sdk 5 | templateDir: "./config/go-templates" 6 | generateInterfaces: true 7 | enumClassPrefix: true 8 | structPrefix: true 9 | useOneOfDiscriminatorLookup: true 10 | files: 11 | atlas_client.mustache: 12 | templateType: SupportingFiles 13 | destinationFilename: atlas_client.go 14 | doc.mustache: 15 | templateType: SupportingFiles 16 | destinationFilename: doc.go 17 | -------------------------------------------------------------------------------- /tools/config/go-templates/README.mustache: -------------------------------------------------------------------------------- 1 | {{! X-XGEN-CUSTOM }}# SDK Reference 2 | 3 | ## Reference Documentation for SDK Endpoints 4 | 5 | All URIs are relative to *{{basePath}}* 6 | 7 | Class | Method | HTTP request | Description | 8 | ------------ | ------------- | ------------- | ------------- | 9 | {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [{{operationId}}](./{{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} | 10 | {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} 11 | 12 | ## Documentation For Models 13 | 14 | {{#models}}{{#model}} - [{{{classname}}}](./{{modelDocPath}}{{{classname}}}.md) 15 | {{/model}}{{/models}} 16 | 17 | {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} 18 | {{/-last}}{{/apis}}{{/apiInfo}} 19 | -------------------------------------------------------------------------------- /tools/config/go-templates/api_test.mustache: -------------------------------------------------------------------------------- 1 | /* 2 | {{#appName}} 3 | {{{.}}} 4 | {{/appName}} 5 | 6 | Testing {{classname}}Service 7 | 8 | */ 9 | 10 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); 11 | 12 | package {{packageName}} 13 | 14 | import ( 15 | "context" 16 | "github.com/stretchr/testify/assert" 17 | "github.com/stretchr/testify/require" 18 | "testing" 19 | {{goImportAlias}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}" 20 | ) 21 | 22 | func Test_{{packageName}}_{{classname}}Service(t *testing.T) { 23 | 24 | configuration := {{goImportAlias}}.NewConfiguration() 25 | apiClient := {{goImportAlias}}.NewAPIClient(configuration) 26 | 27 | {{#operations}} 28 | {{#operation}} 29 | t.Run("Test {{classname}}Service {{{nickname}}}", func(t *testing.T) { 30 | // TODO this test is incomplete. You should add your own test code here. 31 | t.Skip("skip test") // remove to run test 32 | 33 | {{#pathParams}} 34 | var {{paramName}} {{{dataType}}} 35 | {{/pathParams}} 36 | {{#queryParams}} 37 | // var {{paramName}} {{{dataType}}} 38 | {{/queryParams}} 39 | {{#bodyParams}} 40 | // TODO: create model 41 | {{#isArray}} 42 | var {{paramName}} []openapiclient.{{{baseType}}} 43 | {{/isArray}} 44 | {{^isArray}} 45 | var {{paramName}} openapiclient.{{{dataType}}} = openapiclient.{{{dataType}}}{} 46 | {{/isArray}} 47 | {{/bodyParams}} 48 | 49 | {{#returnType}}resp, {{/returnType}}httpRes, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}{{#bodyParams}}, &{{paramName}}{{/bodyParams}}).Execute() 50 | 51 | require.Nil(t, err) 52 | {{#returnType}} 53 | require.NotNil(t, resp) 54 | {{/returnType}} 55 | assert.Equal(t, 200, httpRes.StatusCode) 56 | 57 | }) 58 | 59 | {{/operation}} 60 | {{/operations}} 61 | } 62 | -------------------------------------------------------------------------------- /tools/config/go-templates/doc.mustache: -------------------------------------------------------------------------------- 1 | /* 2 | Package admin supports the MongoDB Atlas Admin API. 3 | 4 | See: https://github.com/mongodb/atlas-sdk-go#getting-started for more information 5 | */ 6 | package {{packageName}} 7 | -------------------------------------------------------------------------------- /tools/config/go-templates/gitignore.mustache: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /tools/config/go-templates/model.mustache: -------------------------------------------------------------------------------- 1 | {{>partial_header}} 2 | package {{packageName}} 3 | 4 | {{#models}} 5 | import ( 6 | "encoding/json" 7 | {{#imports}} 8 | "{{import}}" 9 | {{/imports}} 10 | ) 11 | 12 | {{#model}} 13 | {{#isEnum}} 14 | {{>model_enum}} 15 | {{/isEnum}} 16 | {{^isEnum}} 17 | {{#oneOf}}{{#-first}}{{>model_oneof}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>model_anyof}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>model_simple}}{{/anyOf}}{{/oneOf}} 18 | {{/isEnum}} 19 | {{/model}} 20 | {{/models}} 21 | -------------------------------------------------------------------------------- /tools/config/go-templates/nullable_model.mustache: -------------------------------------------------------------------------------- 1 | // THIS TEMPLATE IS NOT BEING TRIGGERED BY THE CURRENT MODEL 2 | 3 | -------------------------------------------------------------------------------- /tools/config/go-templates/openapi.mustache: -------------------------------------------------------------------------------- 1 | {{{openapi-yaml}}} -------------------------------------------------------------------------------- /tools/config/go-templates/partial_header.mustache: -------------------------------------------------------------------------------- 1 | // Code based on the AtlasAPI V2 OpenAPI file 2 | -------------------------------------------------------------------------------- /tools/config/go-templates/response.mustache: -------------------------------------------------------------------------------- 1 | {{>partial_header}} 2 | package {{packageName}} 3 | 4 | import ( 5 | "net/http" 6 | ) 7 | 8 | // APIResponse stores the API response returned by the server. 9 | type APIResponse struct { 10 | *http.Response `json:"-"` 11 | Message string `json:"message,omitempty"` 12 | // Operation is the name of the OpenAPI operation. 13 | Operation string `json:"operation,omitempty"` 14 | // RequestURL is the request URL. This value is always available, even if the 15 | // embedded *http.Response is nil. 16 | RequestURL string `json:"url,omitempty"` 17 | // Method is the HTTP method used for the request. This value is always 18 | // available, even if the embedded *http.Response is nil. 19 | Method string `json:"method,omitempty"` 20 | // Payload holds the contents of the response body (which may be nil or empty). 21 | // This is provided here as the raw response.Body() reader will have already 22 | // been drained. 23 | Payload []byte `json:"-"` 24 | } 25 | 26 | // NewAPIResponse returns a new APIResponse object. 27 | func NewAPIResponse(r *http.Response) *APIResponse { 28 | response := &APIResponse{Response: r} 29 | return response 30 | } 31 | 32 | // NewAPIResponseWithError returns a new APIResponse object with the provided error message. 33 | func NewAPIResponseWithError(errorMessage string) *APIResponse { 34 | response := &APIResponse{Message: errorMessage} 35 | return response 36 | } 37 | -------------------------------------------------------------------------------- /tools/openapitools.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", 3 | "spaces": 2, 4 | "generator-cli": { 5 | "version": "6.4.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tools/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openapi-generation-tools", 3 | "description": "Atlas GO SDK generator tools", 4 | "version": "0.1.0", 5 | "private": "true", 6 | "main": "transformer/src/index.js", 7 | "dependencies": { 8 | "simple-node-logger": "^21.8.12", 9 | "yaml": "2.8.0" 10 | }, 11 | "devDependencies": { 12 | "@openapitools/openapi-generator-cli": "2.20.2", 13 | "jest": "29.7.0", 14 | "replace-in-file": "^8.3.0", 15 | "prettier": "3.5.3" 16 | }, 17 | "scripts": { 18 | "sdk:transform": "node ./transformer/src/transform", 19 | "format": "prettier --write .", 20 | "format:check": "prettier --check .", 21 | "test": "jest **/__tests__/**.test.js", 22 | "ci": "npm run test && npm run format:check" 23 | }, 24 | "engines": { 25 | "node": ">= 16", 26 | "npm": ">= 8" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/atlas-sdk-go/dfa7c5a72f6d2e72433f8e71e0c413513d70b129/tools/releaser/breaking_changes/.keep -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20231115004.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - ListIdentityProvidersApiRequest.Execute: changed from func() ([]FederationIdentityProvider, *net/http.Response, error) to func() (*PaginatedFederationIdentityProvider, \*net/http.Response, error) 9 | - ReturnAllIPAddressesApiRequest.Execute: changed from func() ([]GroupIPAddresses, *net/http.Response, error) to func() (*GroupIPAddresses, \*net/http.Response, error) 10 | 11 | ## API Changelog 12 | 13 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 14 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20231115005.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - DataProcessRegion: changed from DataProcessRegion to DataProcessRegion 9 | - IdentityProviderUpdate: removed 10 | - NewDataProcessRegion: changed from func() *DataProcessRegion to func() *DataProcessRegion 11 | - NewDataProcessRegionWithDefaults: changed from func() *DataProcessRegion to func() *DataProcessRegion 12 | - NewIdentityProviderUpdate: removed 13 | - NewIdentityProviderUpdateWithDefaults: removed 14 | - UpdateIdentityProviderApiParams.IdentityProviderUpdate: removed 15 | 16 | ## API Changelog 17 | 18 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 19 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20231115006.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - GroupMaintenanceWindow.HourOfDay: changed from int to \*int 9 | - NewGroupMaintenanceWindow: changed from func(int, int) *GroupMaintenanceWindow to func(int) *GroupMaintenanceWindow 10 | 11 | ## API Changelog 12 | 13 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 14 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20231115010.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (*PushBasedLogExportApiService).CreatePushBasedLogConfiguration: changed from func(context.Context, string, *PushBasedLogExportProject) CreatePushBasedLogConfigurationApiRequest to func(context.Context, string, \*CreatePushBasedLogExportProjectRequest) CreatePushBasedLogConfigurationApiRequest 9 | - CreatePushBasedLogConfigurationApiParams.PushBasedLogExportProject: removed 10 | - PushBasedLogExportApi.CreatePushBasedLogConfiguration: changed from func(context.Context, string, *PushBasedLogExportProject) CreatePushBasedLogConfigurationApiRequest to func(context.Context, string, *CreatePushBasedLogExportProjectRequest) CreatePushBasedLogConfigurationApiRequest 11 | 12 | ## API Changelog 13 | 14 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 15 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20231115011.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (\*GroupAlertsConfig).GetMatchers: changed from func() []map[string]interface{} to func() []StreamsMatcher 9 | - (_GroupAlertsConfig).GetMatchersOk: changed from func() (_[]map[string]interface{}, bool) to func() (\*[]StreamsMatcher, bool) 10 | - (\*GroupAlertsConfig).SetMatchers: changed from func([]map[string]interface{}) to func([]StreamsMatcher) 11 | - GroupAlertsConfig.Matchers: changed from _[]map[string]interface{} to _[]StreamsMatcher 12 | 13 | ## API Changelog 14 | 15 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 16 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20231115012.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - ConnectedOrgConfig.IdentityProviderId: changed from string to \*string 9 | - NewConnectedOrgConfig: changed from func(bool, string, string) *ConnectedOrgConfig to func(bool, string) *ConnectedOrgConfig 10 | 11 | ## API Changelog 12 | 13 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 14 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20231115013.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (*FederatedAuthenticationApiService).ListConnectedOrgConfigsExecute: changed from func(ListConnectedOrgConfigsApiRequest) ([]ConnectedOrgConfig, *net/http.Response, error) to func(ListConnectedOrgConfigsApiRequest) (*PaginatedConnectedOrgConfigs, *net/http.Response, error) 9 | - FederatedAuthenticationApi.ListConnectedOrgConfigsExecute: changed from func(ListConnectedOrgConfigsApiRequest) ([]ConnectedOrgConfig, *net/http.Response, error) to func(ListConnectedOrgConfigsApiRequest) (*PaginatedConnectedOrgConfigs, \*net/http.Response, error) 10 | - ListConnectedOrgConfigsApiRequest.Execute: changed from func() ([]ConnectedOrgConfig, *net/http.Response, error) to func() (*PaginatedConnectedOrgConfigs, \*net/http.Response, error) 11 | 12 | ## API Changelog 13 | 14 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 15 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20231115014.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (\*BillingPayment).GetUnitPrice: changed from func() float64 to func() string 9 | - (*BillingPayment).GetUnitPriceOk: changed from func() (*float64, bool) to func() (\*string, bool) 10 | - (\*BillingPayment).SetUnitPrice: changed from func(float64) to func(string) 11 | - BillingPayment.UnitPrice: changed from *float64 to *string 12 | 13 | ## API Changelog 14 | 15 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 16 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20240530003.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (\*BillingInvoice).GetGroupId: removed 9 | - (\*BillingInvoice).GetGroupIdOk: removed 10 | - (\*BillingInvoice).HasGroupId: removed 11 | - (\*BillingInvoice).SetGroupId: removed 12 | - (\*BillingInvoiceMetadata).GetGroupId: removed 13 | - (\*BillingInvoiceMetadata).GetGroupIdOk: removed 14 | - (\*BillingInvoiceMetadata).HasGroupId: removed 15 | - (\*BillingInvoiceMetadata).SetGroupId: removed 16 | - BillingInvoice.GroupId: removed 17 | - BillingInvoiceMetadata.GroupId: removed 18 | - DataLakeCloudProviderConfig.Aws: changed from DataLakeAWSCloudProviderConfig to \*DataLakeAWSCloudProviderConfig 19 | - EventsApi.ListEventTypes: added 20 | - EventsApi.ListEventTypesExecute: added 21 | - EventsApi.ListEventTypesWithParams: added 22 | - NewDataLakeCloudProviderConfig: changed from func(DataLakeAWSCloudProviderConfig) *DataLakeCloudProviderConfig to func() *DataLakeCloudProviderConfig 23 | - ProjectsApi.GetProjectLTSVersions: added 24 | - ProjectsApi.GetProjectLTSVersionsExecute: added 25 | - ProjectsApi.GetProjectLTSVersionsWithParams: added 26 | - StreamsApi.CreateStreamProcessor: added 27 | - StreamsApi.CreateStreamProcessorExecute: added 28 | - StreamsApi.CreateStreamProcessorWithParams: added 29 | 30 | ## API Changelog 31 | 32 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 33 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20240530004.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (\*EventTypeDetails).GetLinks: removed 9 | - (\*EventTypeDetails).GetLinksOk: removed 10 | - (\*EventTypeDetails).HasLinks: removed 11 | - (\*EventTypeDetails).SetLinks: removed 12 | - (*EventsApiService).ListEventTypesExecute: changed from func(ListEventTypesApiRequest) ([]EventTypeDetails, *net/http.Response, error) to func(ListEventTypesApiRequest) (*PaginatedEventTypeDetailsResponse, *net/http.Response, error) 13 | - (\*IndexOptions).GetUnique: removed 14 | - (\*IndexOptions).GetUniqueOk: removed 15 | - (\*IndexOptions).HasUnique: removed 16 | - (\*IndexOptions).SetUnique: removed 17 | - EventTypeDetails.Links: removed 18 | - EventsApi.ListEventTypesExecute: changed from func(ListEventTypesApiRequest) ([]EventTypeDetails, *net/http.Response, error) to func(ListEventTypesApiRequest) (*PaginatedEventTypeDetailsResponse, \*net/http.Response, error) 19 | - IndexOptions.Unique: removed 20 | - ListEventTypesApiRequest.Execute: changed from func() ([]EventTypeDetails, *net/http.Response, error) to func() (*PaginatedEventTypeDetailsResponse, \*net/http.Response, error) 21 | - StreamsApi.DeleteStreamProcessor: added 22 | - StreamsApi.DeleteStreamProcessorExecute: added 23 | - StreamsApi.DeleteStreamProcessorWithParams: added 24 | - StreamsApi.StartStreamProcessor: added 25 | - StreamsApi.StartStreamProcessorExecute: added 26 | - StreamsApi.StartStreamProcessorWithParams: added 27 | - StreamsApi.StopStreamProcessor: added 28 | - StreamsApi.StopStreamProcessorExecute: added 29 | - StreamsApi.StopStreamProcessorWithParams: added 30 | 31 | ## API Changelog 32 | 33 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 34 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20240530005.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (\*DiskBackupSnapshotExportBucket).HasBucketName: removed 9 | - (\*DiskBackupSnapshotExportBucket).HasCloudProvider: removed 10 | - DiskBackupSnapshotExportBucket.BucketName: changed from \*string to string 11 | - DiskBackupSnapshotExportBucket.CloudProvider: changed from \*string to string 12 | - NewDiskBackupSnapshotExportBucket: changed from func() *DiskBackupSnapshotExportBucket to func(string, string) *DiskBackupSnapshotExportBucket 13 | 14 | ## API Changelog 15 | 16 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 17 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20240805002.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - InvoicesApi.QueryLineItemsFromSingleInvoice: added 9 | - InvoicesApi.QueryLineItemsFromSingleInvoiceExecute: added 10 | - InvoicesApi.QueryLineItemsFromSingleInvoiceWithParams: added 11 | 12 | ## API Changelog 13 | 14 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 15 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20240805003.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - EncryptionAtRestUsingCustomerKeyManagementApi.CreateEncryptionAtRestPrivateEndpoint: added 9 | - EncryptionAtRestUsingCustomerKeyManagementApi.CreateEncryptionAtRestPrivateEndpointExecute: added 10 | - EncryptionAtRestUsingCustomerKeyManagementApi.CreateEncryptionAtRestPrivateEndpointWithParams: added 11 | - EncryptionAtRestUsingCustomerKeyManagementApi.GetEncryptionAtRestPrivateEndpoint: added 12 | - EncryptionAtRestUsingCustomerKeyManagementApi.GetEncryptionAtRestPrivateEndpointExecute: added 13 | - EncryptionAtRestUsingCustomerKeyManagementApi.GetEncryptionAtRestPrivateEndpointWithParams: added 14 | - EncryptionAtRestUsingCustomerKeyManagementApi.GetEncryptionAtRestPrivateEndpointsForCloudProvider: added 15 | - EncryptionAtRestUsingCustomerKeyManagementApi.GetEncryptionAtRestPrivateEndpointsForCloudProviderExecute: added 16 | - EncryptionAtRestUsingCustomerKeyManagementApi.GetEncryptionAtRestPrivateEndpointsForCloudProviderWithParams: added 17 | - EncryptionAtRestUsingCustomerKeyManagementApi.RequestEncryptionAtRestPrivateEndpointDeletion: added 18 | - EncryptionAtRestUsingCustomerKeyManagementApi.RequestEncryptionAtRestPrivateEndpointDeletionExecute: added 19 | - EncryptionAtRestUsingCustomerKeyManagementApi.RequestEncryptionAtRestPrivateEndpointDeletionWithParams: added 20 | 21 | ## API Changelog 22 | 23 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 24 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20240805005.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (\*ClusterFreeAutoScaling).GetCompute: changed from func() string to func() FreeComputeAutoScalingRules 9 | - (*ClusterFreeAutoScaling).GetComputeOk: changed from func() (*string, bool) to func() (\*FreeComputeAutoScalingRules, bool) 10 | - (\*ClusterFreeAutoScaling).SetCompute: changed from func(string) to func(FreeComputeAutoScalingRules) 11 | - ClusterFreeAutoScaling.Compute: changed from *string to *FreeComputeAutoScalingRules 12 | 13 | ## API Changelog 14 | 15 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 16 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20241023001.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (\*ApiError).HasError: removed 9 | - (\*ApiError).HasErrorCode: removed 10 | - (*CloudBackupsApiService).CreateExportBucket: changed from func(context.Context, string, *DiskBackupSnapshotExportBucket) CreateExportBucketApiRequest to func(context.Context, string, \*DiskBackupSnapshotExportBucketRequest) CreateExportBucketApiRequest 11 | - (\*DiskBackupExportJob).GetDeliveryUrl: removed 12 | - (\*DiskBackupExportJob).GetDeliveryUrlOk: removed 13 | - (\*DiskBackupExportJob).HasDeliveryUrl: removed 14 | - (\*DiskBackupExportJob).SetDeliveryUrl: removed 15 | - (\*DiskBackupSnapshotExportBucket).HasId: removed 16 | - (\*FieldViolation).HasDescription: removed 17 | - (\*FieldViolation).HasField: removed 18 | - ApiError.Error: changed from \*int to int 19 | - ApiError.ErrorCode: changed from \*string to string 20 | - CloudBackupsApi.CreateExportBucket: changed from func(context.Context, string, *DiskBackupSnapshotExportBucket) CreateExportBucketApiRequest to func(context.Context, string, *DiskBackupSnapshotExportBucketRequest) CreateExportBucketApiRequest 21 | - CreateExportBucketApiParams.DiskBackupSnapshotExportBucket: removed 22 | - DiskBackupExportJob.DeliveryUrl: removed 23 | - DiskBackupSnapshotExportBucket.Id: changed from \*string to string 24 | - DiskBackupSnapshotExportBucket: removed 25 | - FieldViolation.Description: changed from \*string to string 26 | - FieldViolation.Field: changed from \*string to string 27 | - NewApiError: changed from func() *ApiError to func(int, string) *ApiError 28 | - NewDiskBackupSnapshotExportBucket: removed 29 | - NewDiskBackupSnapshotExportBucketWithDefaults: removed 30 | - NewFieldViolation: changed from func() *FieldViolation to func(string, string) *FieldViolation 31 | 32 | ## API Changelog 33 | 34 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 35 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20241023002.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | JSON responses take precedence now. As an example GetInvoice returns BillingInvoice instead of a string with CSV content. 6 | 7 | ## API Changelog 8 | 9 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 10 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20241113002.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (*FlexClustersApiService).UpgradeFlexCluster: changed from func(context.Context, string, *FlexClusterDescription20241113) UpgradeFlexClusterApiRequest to func(context.Context, string, \*AtlasTenantClusterUpgradeRequest20240805) UpgradeFlexClusterApiRequest 9 | - FlexClustersApi.UpgradeFlexCluster: changed from func(context.Context, string, *FlexClusterDescription20241113) UpgradeFlexClusterApiRequest to func(context.Context, string, *AtlasTenantClusterUpgradeRequest20240805) UpgradeFlexClusterApiRequest 10 | - UpgradeFlexClusterApiParams.FlexClusterDescription20241113: removed 11 | 12 | ## API Changelog 13 | 14 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 15 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20241113004.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | go.mongodb.org/atlas-sdk/v20250312003/admin 6 | Incompatible changes: 7 | 8 | - (\*PrivateNetworkEndpointIdEntry).GetAzureConnectionName: removed 9 | - (\*PrivateNetworkEndpointIdEntry).GetAzureConnectionNameOk: removed 10 | - (\*PrivateNetworkEndpointIdEntry).HasAzureConnectionName: removed 11 | - (\*PrivateNetworkEndpointIdEntry).SetAzureConnectionName: removed 12 | - CloudBackupsApi.DisableDataProtectionSettings: added 13 | - CloudBackupsApi.DisableDataProtectionSettingsExecute: added 14 | - CloudBackupsApi.DisableDataProtectionSettingsWithParams: added 15 | - PrivateNetworkEndpointIdEntry.AzureConnectionName: removed 16 | 17 | ## API Changelog 18 | 19 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 20 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20241113005.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | ### incompatible changes 6 | 7 | - (*PerformanceAdvisorApiService).GetManagedSlowMsExecute: changed from func(GetManagedSlowMsApiRequest) (*net/http.Response, error) to func(GetManagedSlowMsApiRequest) (bool, \*net/http.Response, error) 8 | - GetManagedSlowMsApiRequest.Execute: changed from func() (*net/http.Response, error) to func() (bool, *net/http.Response, error) 9 | - ListProjectUsersApiParams.OrgMembershipStatus: removed 10 | - ListProjectUsersApiRequest.OrgMembershipStatus: removed 11 | - NewServerlessMetricThreshold: removed 12 | - NewServerlessMetricThresholdWithDefaults: removed 13 | - PerformanceAdvisorApi.GetManagedSlowMsExecute: changed from func(GetManagedSlowMsApiRequest) (*net/http.Response, error) to func(GetManagedSlowMsApiRequest) (bool, *net/http.Response, error) 14 | - ServerlessMetricThreshold: removed 15 | - StreamsApi.GetActiveVpcPeeringConnections: added 16 | - StreamsApi.GetActiveVpcPeeringConnectionsExecute: added 17 | - StreamsApi.GetActiveVpcPeeringConnectionsWithParams: added 18 | 19 | ## API Changelog 20 | 21 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 22 | -------------------------------------------------------------------------------- /tools/releaser/breaking_changes/v20250312001.md: -------------------------------------------------------------------------------- 1 | # Breaking Changes 2 | 3 | ## SDK changes 4 | 5 | ### incompatible changes 6 | 7 | - (\*GreaterThanRawThreshold).GetThreshold: changed from func() int to func() float64 8 | - (*GreaterThanRawThreshold).GetThresholdOk: changed from func() (*int, bool) to func() (\*float64, bool) 9 | - (\*GreaterThanRawThreshold).SetThreshold: changed from func(int) to func(float64) 10 | - ClustersApi.AutoScalingConfiguration: added 11 | - ClustersApi.AutoScalingConfigurationExecute: added 12 | - ClustersApi.AutoScalingConfigurationWithParams: added 13 | - GreaterThanRawThreshold.Threshold: changed from *int to *float64 14 | - GreaterThanRawThreshold: removed 15 | - NewGreaterThanRawThreshold: removed 16 | - NewGreaterThanRawThresholdWithDefaults: removed 17 | 18 | ## API Changelog 19 | 20 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog 21 | -------------------------------------------------------------------------------- /tools/releaser/scripts/extract-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ueo pipefail 3 | 4 | file_path="../internal/core/version.go" 5 | versions_file_path="../openapi/versions.json" 6 | 7 | # Use grep to extract the version string and store it in a variable 8 | SDK_VERSION=$(grep -o 'Version = "[^"]*"' "$file_path" | awk -F'"' '{print $2}') 9 | SDK_RESOURCE_VERSION=$(grep -o 'Resource = "[^"]*"' "$file_path" | awk -F'"' '{print $2}') 10 | 11 | # Extract the minor and major parts of the version 12 | SDK_PATCH_VERSION=$(echo "$SDK_VERSION" | awk -F'.' '{print $3}') 13 | SDK_MINOR_VERSION=$(echo "$SDK_VERSION" | awk -F'.' '{print $2}') 14 | SDK_MAJOR_VERSION=$(echo "$SDK_VERSION" | awk -F'.' '{print $1}') 15 | 16 | # Extract the last version from the versions.json file 17 | HYPEN_RESOURCE_VERSION=$(cat $versions_file_path | jq -r ' .[-1]') 18 | NEW_RESOURCE_VERSION=$(echo "$HYPEN_RESOURCE_VERSION" | tr -d '-') 19 | 20 | echo "Extracted version from version.go file: '$SDK_VERSION'. Resource Version: '$SDK_RESOURCE_VERSION'" 21 | echo "Major: $SDK_MAJOR_VERSION' Minor: $SDK_MINOR_VERSION Patch: $SDK_PATCH_VERSION" 22 | echo "Extracted version versions.json: '$NEW_RESOURCE_VERSION'." 23 | 24 | 25 | -------------------------------------------------------------------------------- /tools/releaser/scripts/new-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ueo pipefail 3 | 4 | ## Target version file 5 | target_file_path="../internal/core/version.go" 6 | 7 | script_path=$(dirname "$0") 8 | # shellcheck source=/dev/null 9 | source "$script_path/extract-version.sh" 10 | # shellcheck source=/dev/null 11 | source "$script_path/version-paths.sh" 12 | 13 | # Update the version.go file with the new version 14 | if [ "$NEW_RESOURCE_VERSION" == "$SDK_RESOURCE_VERSION" ]; then 15 | echo "Resource Version is already up to date. Changing minor version." 16 | # Increment the minor version 17 | new_minor_version=$((SDK_MINOR_VERSION + 1)) 18 | # Update the SDK_VERSION 19 | SDK_VERSION="${SDK_MAJOR_VERSION}.${new_minor_version}.0" 20 | 21 | echo "Print breaking changes" 22 | # shellcheck source=/dev/null 23 | source "$script_path/breaking-changes.sh" 24 | if [ -n "$BREAKING_CHANGES" ]; then 25 | echo "BREAKING CHANGES DETECTED FOR NON MAJOR VERSION BUMP" 26 | # shellcheck source=/dev/null 27 | source "$script_path/update-major-version.sh" 28 | exit 0; 29 | elif [ -n "$NON_BREAKING_CHANGES" ]; then 30 | echo "NON BREAKING CHANGES DETECTED FOR NON MAJOR VERSION BUMP" 31 | # shellcheck source=/dev/null 32 | source "$script_path/update-minor-version.sh" 33 | exit 0; 34 | fi 35 | else 36 | # Update the SDK_VERSION 37 | echo "Resource Version is not up to date. Changing major version." 38 | NEW_MAJOR_VERSION="v${NEW_RESOURCE_VERSION}001" 39 | SDK_VERSION="${NEW_MAJOR_VERSION}.0.0" 40 | echo "generate breaking changes file" 41 | export TARGET_BREAKING_CHANGES_FILE=${NEW_MAJOR_VERSION} 42 | # shellcheck source=/dev/null 43 | source "$script_path/breaking-changes.sh" 44 | 45 | echo "Modifying all instances of version from $SDK_RESOURCE_VERSION to $NEW_RESOURCE_VERSION across the repository." 46 | npm install 47 | npm exec -c "replace-in-file /$SDK_MAJOR_VERSION/g $NEW_MAJOR_VERSION $VERSION_UPDATE_PATHS --isRegex" 48 | fi 49 | 50 | echo "Creating new version.go file with $SDK_VERSION and resource version: $NEW_RESOURCE_VERSION" 51 | 52 | export SDK_VERSION 53 | export NEW_RESOURCE_VERSION 54 | 55 | envsubst < "$script_path/../templates/VERSION.tmpl" > $target_file_path 56 | -------------------------------------------------------------------------------- /tools/releaser/scripts/preview-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ueo pipefail 3 | 4 | script_path=$(dirname "$0") 5 | # shellcheck source=/dev/null 6 | source "$script_path/extract-version.sh" 7 | # shellcheck source=/dev/null 8 | source "$script_path/version-paths.sh" 9 | 10 | OLD_PACKAGE="go.mongodb.org/atlas-sdk/${SDK_MAJOR_VERSION}" 11 | NEW_PACKAGE="github.com/mongodb/atlas-sdk-go" 12 | examples_path="$script_path/../../../examples" 13 | 14 | echo "Delete specific version $SDK_MAJOR_VERSION from examples go.mod" 15 | (cd "$examples_path" && go mod edit -droprequire="$OLD_PACKAGE") 16 | 17 | echo "Modifying all instances from $OLD_PACKAGE to $NEW_PACKAGE across the repository." 18 | npm install 19 | npm exec -c "replace-in-file '/$OLD_PACKAGE/g' '$NEW_PACKAGE' $VERSION_UPDATE_PATHS_PREVIEW --isRegex" 20 | 21 | echo "Add preview version to examples go.mod" 22 | (cd "$examples_path" && go get $NEW_PACKAGE) 23 | -------------------------------------------------------------------------------- /tools/releaser/scripts/setghenv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ueo pipefail 4 | 5 | GITHUB_ENV=${GITHUB_ENV:-.env} 6 | 7 | ## Scripts sets environemnt for github actions 8 | 9 | script_path=$(dirname "$0") 10 | # shellcheck source=/dev/null 11 | source "$script_path/extract-version.sh" 12 | 13 | ## Set the environment variables used 14 | export SDK_VERSION="${SDK_VERSION}" 15 | export HYPEN_RESOURCE_VERSION="${HYPEN_RESOURCE_VERSION}" 16 | { 17 | echo "SDK_VERSION=${SDK_VERSION}" 18 | echo "HYPEN_RESOURCE_VERSION=${HYPEN_RESOURCE_VERSION}" 19 | echo "RELEASE_TAG=${SDK_VERSION}" 20 | } >> "$GITHUB_ENV" 21 | 22 | EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) 23 | 24 | RELEASE_NOTES=$(envsubst < "$script_path/../templates/RELEASE_NOTES.tmpl") 25 | 26 | # Check if this is a major version bump (when MINOR is 0) 27 | if [ "$SDK_MINOR_VERSION" = "0" ] && [ "$SDK_PATCH_VERSION" = "0" ]; then 28 | # For major versions, include breaking changes from the file 29 | breaking_changes_path="$script_path/../breaking_changes/${SDK_MAJOR_VERSION}.md" 30 | if [ -f "$breaking_changes_path" ]; then 31 | echo "Found breaking changes file for $SDK_MAJOR_VERSION" 32 | BREAKING_CHANGES=$(cat "$breaking_changes_path") 33 | RELEASE_NOTES=$(echo -e "${RELEASE_NOTES}\n\n${BREAKING_CHANGES}") 34 | fi 35 | else 36 | # For minor versions, include non-breaking changes directly 37 | if [ -n "$NON_BREAKING_CHANGES" ]; then 38 | echo "Adding non-breaking changes to release notes" 39 | RELEASE_NOTES=$(echo -e "${RELEASE_NOTES}\n\n## Changes\n${NON_BREAKING_CHANGES}") 40 | fi 41 | fi 42 | 43 | ## Multiline string 44 | { 45 | echo "RELEASE_NOTES<<$EOF" 46 | echo "$RELEASE_NOTES" 47 | echo "$EOF" 48 | } >> "$GITHUB_ENV" 49 | -------------------------------------------------------------------------------- /tools/releaser/scripts/update-major-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ueo pipefail 3 | 4 | script_path=$(dirname "$0") 5 | # shellcheck source=/dev/null 6 | source "$script_path/extract-version.sh" 7 | # shellcheck source=/dev/null 8 | source "$script_path/version-paths.sh" 9 | 10 | # # Display the extracted version 11 | echo "Current Resource Version: $NEW_RESOURCE_VERSION" 12 | 13 | major_version_breaking_changes="${SDK_MAJOR_VERSION: -3}" 14 | # Remove leading zeros from the variable 15 | major_version_breaking_changes=$((10#$major_version_breaking_changes)) 16 | echo $major_version_breaking_changes "major_version_breaking_changes" 17 | # Change value 18 | ((major_version_breaking_changes++)) 19 | # Ensure the value stays within the range 1-999 20 | major_version_breaking_changes=$((major_version_breaking_changes % 1000)) 21 | 22 | major_version_bump=$(printf "%03d" "$major_version_breaking_changes") 23 | BUMPED_MAJOR_VERSION="v${SDK_RESOURCE_VERSION}${major_version_bump}" 24 | 25 | mkdir -p "$script_path/../breaking_changes/" 26 | export TARGET_BREAKING_CHANGES_FILE=${BUMPED_MAJOR_VERSION} 27 | echo -e "# Breaking Changes\n## SDK changes\n ${BREAKING_CHANGES:-TODO} \n## API Changelog\n https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog" \ 28 | > "$script_path/../breaking_changes/${TARGET_BREAKING_CHANGES_FILE}.md" 29 | 30 | echo "Modifying $SDK_MAJOR_VERSION to $BUMPED_MAJOR_VERSION Resource Version across the repository." 31 | npm install 32 | npm exec -c "replace-in-file /$SDK_MAJOR_VERSION/g $BUMPED_MAJOR_VERSION $VERSION_UPDATE_PATHS --isRegex" 33 | 34 | ## Explicitly update version.go file 35 | export SDK_VERSION="${BUMPED_MAJOR_VERSION}.0.0" 36 | export NEW_RESOURCE_VERSION="${SDK_RESOURCE_VERSION}" 37 | 38 | echo "Updating version.go file: $SDK_VERSION" 39 | target_file_path="$script_path/../../../internal/core/version.go" 40 | envsubst < "$script_path/../templates/VERSION.tmpl" > "$target_file_path" 41 | 42 | -------------------------------------------------------------------------------- /tools/releaser/scripts/update-minor-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ueo pipefail 3 | 4 | script_path=$(dirname "$0") 5 | # shellcheck source=/dev/null 6 | source "$script_path/extract-version.sh" 7 | # shellcheck source=/dev/null 8 | source "$script_path/version-paths.sh" 9 | 10 | # Display the extracted version 11 | echo "Current Resource Version: $NEW_RESOURCE_VERSION" 12 | 13 | # Increment minor version 14 | new_minor=$((SDK_MINOR_VERSION + 1)) 15 | 16 | # Create new version string 17 | BUMPED_VERSION="${SDK_MAJOR_VERSION}.${new_minor}.0" 18 | 19 | echo "Modifying $SDK_MAJOR_VERSION.$SDK_MINOR_VERSION.0 to $BUMPED_VERSION across the repository." 20 | npm install 21 | npm exec -c "replace-in-file /$SDK_MAJOR_VERSION\.$SDK_MINOR_VERSION\.0/g $BUMPED_VERSION $VERSION_UPDATE_PATHS --isRegex" 22 | 23 | ## Explicitly update version.go file 24 | export SDK_VERSION="${BUMPED_VERSION}" 25 | 26 | echo "Updating version.go file: $SDK_VERSION" 27 | target_file_path="$script_path/../../../internal/core/version.go" 28 | envsubst < "$script_path/../templates/VERSION.tmpl" > "$target_file_path" -------------------------------------------------------------------------------- /tools/releaser/scripts/version-paths.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export VERSION_UPDATE_PATHS="../**/go.mod,../**/*.go,../tools/**/*.mustache,../.mockery.yaml,../**/*.md" 4 | 5 | # don't change doc files to reduce Preview PR noise 6 | export VERSION_UPDATE_PATHS_PREVIEW="../**/go.mod,../**/*.go,../tools/**/*.mustache,../.mockery.yaml" 7 | -------------------------------------------------------------------------------- /tools/releaser/templates/RELEASE_NOTES.tmpl: -------------------------------------------------------------------------------- 1 | 2 | # Release Notes 3 | 4 | ## Notes 5 | 6 | The Atlas Golang SDK official ${SDK_VERSION} release. 7 | 8 | ## SDK documentation 9 | 10 | Please refer to the official documentation 11 | 12 | https://www.mongodb.com/docs/atlas/sdk/ 13 | 14 | ## API documentation 15 | 16 | SDK is based on Atlas Admin v2 API. 17 | Currently supported version: ${HYPEN_RESOURCE_VERSION} 18 | 19 | For API documentation please refer to: 20 | https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/${HYPEN_RESOURCE_VERSION}/ 21 | 22 | -------------------------------------------------------------------------------- /tools/releaser/templates/VERSION.tmpl: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | // Version of the SDK used for the autorelease process. 4 | // When version is bumped in the PR it means that the PR is ready to be merged. 5 | // For more information please see: https://github.com/mongodb/atlas-sdk-go/blob/main/docs/doc_1_concepts.md 6 | const ( 7 | // SDK release tag version. 8 | Version = "${SDK_VERSION}" 9 | // Resource Version. 10 | Resource = "${NEW_RESOURCE_VERSION}" 11 | ) 12 | -------------------------------------------------------------------------------- /tools/scripts/fetch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | 6 | ######################################################### 7 | # Fetch openapi from remote file 8 | # Environment variables: 9 | # CURRENT_REVISION - current revision of the versioned API 10 | # OPENAPI_FILE_NAME - openapi file name to use 11 | # OPENAPI_FOLDER - folder for saving openapi file 12 | # S3_BUCKET - S3 bucket where the spec is hosted 13 | ######################################################### 14 | 15 | ## Input variables with defaults 16 | 17 | ## OpenAPI file (latest) 18 | OPENAPI_FILE_NAME=${OPENAPI_FILE_NAME:-"atlas-api.yaml"} 19 | 20 | ## Folder used for fetching files 21 | OPENAPI_FOLDER=${OPENAPI_FOLDER:-"../openapi"} 22 | 23 | 24 | # Base URL for fetching the openapi file 25 | API_BASE_URL=${API_BASE_URL:-https://raw.githubusercontent.com/mongodb/openapi/refs/heads/main/openapi/v2} 26 | versions_file="versions.json" 27 | 28 | pushd "${OPENAPI_FOLDER}" 29 | versions_url="${API_BASE_URL}/${versions_file}" 30 | echo "Fetching versions from $versions_url" 31 | 32 | curl --show-error --fail --silent -o "${versions_file}" \ 33 | -H "Accept: application/json" "${versions_url}" 34 | 35 | # Remove "preview" and versions with ".upcoming" suffix from versions file and update the file 36 | jq 'map(select(. != "preview" and (endswith(".upcoming") | not)))' < "./${versions_file}" > "./${versions_file}.tmp" 37 | mv "./${versions_file}.tmp" "./${versions_file}" 38 | 39 | ## Dynamic Versioned API Version 40 | CURRENT_API_REVISION=$(jq -r '.[-1]' < "./${versions_file}") 41 | 42 | echo "Fetching OAS file for version $CURRENT_API_REVISION" 43 | openapi_url=${API_BASE_URL}/openapi-${CURRENT_API_REVISION}.yaml 44 | 45 | echo "Fetching api from $openapi_url to $OPENAPI_FILE_NAME" 46 | 47 | curl --show-error --fail --silent -o "$OPENAPI_FILE_NAME" "$openapi_url" 48 | 49 | popd -0 50 | -------------------------------------------------------------------------------- /tools/scripts/generate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | 5 | ###################################################### 6 | # Generate client using OpenAPI generator 7 | # Environment variables: 8 | # OPENAPI_FOLDER - folder containing openapi file 9 | # OPENAPI_FILE_NAME - openapi file name 10 | # SDK_FOLDER - folder location for generated client 11 | ###################################################### 12 | 13 | OPENAPI_FOLDER=${OPENAPI_FOLDER:-./openapi} 14 | OPENAPI_FILE_NAME=${OPENAPI_FILE_NAME:-atlas-api.yaml} 15 | SDK_FOLDER=${SDK_FOLDER:-./} 16 | transformed_file="atlas-api-transformed.yaml" 17 | client_package="admin" 18 | openapiFileLocation="$OPENAPI_FOLDER/$transformed_file" 19 | 20 | echo "# Running generation pipeline" 21 | echo "# Running transformation based on $OPENAPI_FILE_NAME to the $transformed_file" 22 | cp "$OPENAPI_FOLDER/$OPENAPI_FILE_NAME" "$openapiFileLocation" 23 | 24 | npm install 25 | npm run sdk:transform -- "$openapiFileLocation" 26 | 27 | echo "# Running OpenAPI generator validation" 28 | npm exec openapi-generator-cli -- validate -i "$openapiFileLocation" 29 | 30 | echo "# Running Client Generation" 31 | 32 | npm exec openapi-generator-cli -- generate \ 33 | -c "./config/config.yaml" -i "$openapiFileLocation" -o "$SDK_FOLDER" \ 34 | --package-name="$client_package" \ 35 | --type-mappings=integer=int \ 36 | --type-mappings=object=interface{} \ 37 | --type-mappings=interface{}=any \ 38 | --type-mappings=file=io.ReadCloser \ 39 | --ignore-file-override=config/.go-ignore 40 | 41 | # Check if goimports exists and is executable 42 | if ! command -v goimports &> /dev/null; then 43 | echo "Error: goimports command not found. Please install goimports by running 'make install-goimports' before running this script." 44 | exit 1 45 | fi 46 | 47 | goimports -w "$SDK_FOLDER" 48 | -------------------------------------------------------------------------------- /tools/scripts/generate_docs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | 5 | ###################################################### 6 | # Generate client using OpenAPI generator 7 | # Environment variables: 8 | # OPENAPI_FOLDER - folder containing openapi file 9 | # OPENAPI_FILE_NAME - openapi file name 10 | # SDK_FOLDER - folder location for generated client 11 | ###################################################### 12 | 13 | OPENAPI_FOLDER=${OPENAPI_FOLDER:-./openapi} 14 | OPENAPI_FILE_NAME=${OPENAPI_FILE_NAME:-atlas-api.yaml} 15 | DOC_FOLDER=${DOC_FOLDER:-./docs} 16 | 17 | transformed_file="atlas-api-transformed.yaml" 18 | client_package="admin" 19 | openapiFileLocation="$OPENAPI_FOLDER/$transformed_file" 20 | 21 | echo "# Running Client Generation" 22 | 23 | npm exec openapi-generator-cli -- generate \ 24 | -c "./config/config.yaml" -i "$openapiFileLocation" -o "$DOC_FOLDER" \ 25 | --package-name="$client_package" \ 26 | --type-mappings=integer=int \ 27 | --type-mappings=object=interface{} \ 28 | --type-mappings=interface{}=any \ 29 | --type-mappings=file=io.ReadCloser \ 30 | --ignore-file-override=config/.go-ignore-docs 31 | 32 | mv "$DOC_FOLDER"/README.md "$DOC_FOLDER"/doc_last_reference.md 33 | -------------------------------------------------------------------------------- /tools/scripts/generate_mocks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -Rf ../mockadmin 3 | 4 | # install only if not already present 5 | if ! which mockery ; then 6 | docker run --rm -u "$(id -u):$(id -g)" -v "$(dirname "$PWD")":/src --workdir=/src vektra/mockery:v2.53.2 7 | else 8 | mockery --dir ../mockadmin 9 | fi 10 | 11 | # Use any instead of interface{} in genereated mocks 12 | npm install 13 | npm exec -c "replace-in-file /interface{}/g any ../mockadmin/**/*.go --isRegex" 14 | -------------------------------------------------------------------------------- /tools/scripts/generate_tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | 5 | OPENAPI_FOLDER=${OPENAPI_FOLDER:-./openapi} 6 | OPENAPI_FILE_NAME=${OPENAPI_FILE_NAME:-atlas-api.yaml} 7 | FOLDER=${FOLDER:-../test/generated} 8 | 9 | transformed_file="atlas-api-transformed.yaml" 10 | client_package="admin" 11 | openapiFileLocation="$OPENAPI_FOLDER/$transformed_file" 12 | 13 | echo "# Running Test Generation" 14 | 15 | npm exec openapi-generator-cli -- generate \ 16 | -c "./config/config.yaml" -i "$openapiFileLocation" -o "$FOLDER" \ 17 | --package-name="$client_package" \ 18 | --type-mappings=integer=int \ 19 | --type-mappings=object=interface{} \ 20 | --type-mappings=interface{}=any \ 21 | --type-mappings=file=io.ReadCloser \ 22 | --ignore-file-override=config/.go-ignore-tests 23 | 24 | -------------------------------------------------------------------------------- /tools/scripts/transform.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | 5 | ####################################### 6 | # Transform openapi from remote file 7 | # Environment variables: 8 | # OPENAPI_FILE_NAME - openapi file name to use 9 | # OPENAPI_FOLDER - folder for saving openapi file 10 | ####################################### 11 | 12 | OPENAPI_FOLDER=${OPENAPI_FOLDER:-./openapi} 13 | OPENAPI_FILE_NAME=${OPENAPI_FILE_NAME:-atlas-api.yaml} 14 | 15 | transformed_file="atlas-api-transformed.yaml" 16 | openapiFileLocation="$OPENAPI_FOLDER/$transformed_file" 17 | 18 | echo "# Running transformation from $transformed_file OpenAPI from $OPENAPI_FILE_NAME" 19 | cp "$OPENAPI_FOLDER/$OPENAPI_FILE_NAME" "$openapiFileLocation" 20 | 21 | npm install 22 | npm run sdk:transform -- "$openapiFileLocation" 23 | -------------------------------------------------------------------------------- /tools/transformer/src/discriminator.ignore.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignoreModels": [] 3 | } 4 | -------------------------------------------------------------------------------- /tools/transformer/src/duplicate.ignore.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignoredProperties": [ 3 | "units", 4 | "threshold", 5 | "eventTypeName", 6 | "currentValue", 7 | "metricThreshold", 8 | "autoScaling", 9 | "featureId" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tools/transformer/src/engine/apifile.js: -------------------------------------------------------------------------------- 1 | const { parse, stringify } = require("yaml"); 2 | const { readFileSync, writeFileSync } = require("fs"); 3 | 4 | /** 5 | * Read and parse API file as json 6 | * 7 | * @returns {doc, apiFileLocation} 8 | */ 9 | function getAPI(apiFileLocation) { 10 | if (!apiFileLocation && !apiFileLocation[0]) { 11 | throw new Error("Missing positional argument for openapi file"); 12 | } 13 | 14 | apiFileLocation = apiFileLocation[0]; 15 | 16 | let doc; 17 | if (apiFileLocation) { 18 | doc = parse(readFileSync(apiFileLocation, "utf8")); 19 | } else { 20 | throw new Error("Missing location. Please set OPENAPI_FILE env variable"); 21 | } 22 | return { doc, apiFileLocation }; 23 | } 24 | 25 | /** 26 | * Save API to target location 27 | * 28 | * @param {*} doc openapi doc 29 | * @param {*} apiFileLocation location to save 30 | */ 31 | function saveAPI(doc, apiFileLocation) { 32 | writeFileSync(apiFileLocation, stringify(doc, { lineWidth: 9999 })); // default is 80 and would add newlines, we want to stay close to the original that uses long lines. 33 | } 34 | 35 | module.exports = { getAPI, saveAPI }; 36 | -------------------------------------------------------------------------------- /tools/transformer/src/engine/ignoreModel.js: -------------------------------------------------------------------------------- 1 | module.exports = function isModelIgnored(name, ignoredModelNames) { 2 | if (!ignoredModelNames) { 3 | return false; 4 | } 5 | return ignoredModelNames.includes(name); 6 | }; 7 | -------------------------------------------------------------------------------- /tools/transformer/src/engine/removeField.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Removes field from openapi 3 | * @param {*} api 4 | * @param {*} fieldName field to remove 5 | * @returns 6 | */ 7 | module.exports = function removeField(api, fieldName) { 8 | const hasSchemas = api && api.components && api.components.schemas; 9 | if (!hasSchemas) { 10 | throw new Error("Missing schemas in openapi"); 11 | } 12 | // Recursive function to traverse the OpenAPI object 13 | function removePropertyField(obj) { 14 | if (typeof obj !== "object" || obj === null) { 15 | return; 16 | } 17 | 18 | if (Array.isArray(obj)) { 19 | for (let i = 0; i < obj.length; i++) { 20 | removePropertyField(obj[i], fieldName); 21 | } 22 | } else { 23 | // Remove enum field if present 24 | if (obj.hasOwnProperty(fieldName)) { 25 | delete obj[fieldName]; 26 | } 27 | 28 | // Traverse nested properties 29 | for (const prop in obj) { 30 | if (obj.hasOwnProperty(prop)) { 31 | removePropertyField(obj[prop], fieldName); 32 | } 33 | } 34 | } 35 | } 36 | 37 | // Start removing enum fields from the OpenAPI object 38 | removePropertyField(api, fieldName); 39 | return api; 40 | }; 41 | -------------------------------------------------------------------------------- /tools/transformer/src/engine/removeUnused.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Helper function used to traverse the OpenAPI document and remove unused schemas 3 | * @param {*} openapiData 4 | * @returns 5 | */ 6 | function removeUnusedSchemas(openapiData) { 7 | const allRefs = []; 8 | const usedRefs = []; 9 | 10 | // Find all $ref occurrences in the OpenAPI document 11 | findRefs(openapiData, allRefs); 12 | 13 | // Extract unique references used in the OpenAPI document 14 | allRefs.forEach((ref) => { 15 | const refParts = ref.split("/"); 16 | if (refParts[1] === "components" && refParts[2] === "schemas") { 17 | usedRefs.push(refParts[3]); 18 | } 19 | }); 20 | let hasSchemaChanges = false; 21 | // Remove unused schemas from 'components.schemas' 22 | const schemas = openapiData.components && openapiData.components.schemas; 23 | if (schemas) { 24 | Object.keys(schemas).forEach((schemaName) => { 25 | if (!usedRefs.includes(schemaName)) { 26 | delete schemas[schemaName]; 27 | hasSchemaChanges = true; 28 | } 29 | }); 30 | } 31 | // Return the updated OpenAPI document 32 | return hasSchemaChanges; 33 | } 34 | 35 | /** 36 | * Recursive function for finding all $ref occurrences in the OpenAPI document 37 | * @param {*} obj 38 | * @param {*} refs 39 | */ 40 | function findRefs(obj, refs) { 41 | if (typeof obj === "object" && obj !== null) { 42 | if (Array.isArray(obj)) { 43 | obj.forEach((item) => findRefs(item, refs)); 44 | } else { 45 | Object.keys(obj).forEach((key) => { 46 | if (key === "$ref") { 47 | refs.push(obj[key]); 48 | } else { 49 | findRefs(obj[key], refs); 50 | } 51 | }); 52 | } 53 | } 54 | } 55 | 56 | module.exports = removeUnusedSchemas; 57 | -------------------------------------------------------------------------------- /tools/transformer/src/field.transformations.json: -------------------------------------------------------------------------------- 1 | { 2 | "optionalFields": { 3 | "StreamProcessorMetricThreshold": ["metricName"] 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tools/transformer/src/name.ignore.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignoreModels": [] 3 | } 4 | -------------------------------------------------------------------------------- /tools/transformer/src/oneOf.ignore.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignoreModels": [] 3 | } 4 | -------------------------------------------------------------------------------- /tools/transformer/src/transform.js: -------------------------------------------------------------------------------- 1 | const { getAPI, saveAPI } = require("./engine/apifile"); 2 | const log = require("simple-node-logger").createSimpleLogger(); 3 | const runTransformations = require("./atlasTransformations"); 4 | 5 | // Override default logger 6 | global.console = log; 7 | log.setLevel(process.env.XGEN_LOGGING_LEVEL || "warn"); 8 | 9 | let { doc, apiFileLocation } = getAPI(process.argv.slice(2)); 10 | 11 | doc = runTransformations(doc); 12 | saveAPI(doc, apiFileLocation); 13 | -------------------------------------------------------------------------------- /tools/transformer/src/transformations/additionalPropertiesObject.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Remove all AdditionalProperties object section 3 | * That generates an map[string]map[string]string objects for SDK 4 | * but for our API much safer is to rely on the map[string]any 5 | * This is due to the fact that dynamic field can be array which would 6 | * not be possible to represent in map[string]map[string]string structure. 7 | * @param {*} api OpenAPI JSON File 8 | * @param modelNames 9 | * @returns OpenAPI JSON File 10 | */ 11 | function applyRemoveObjectAdditionalProperties(api) { 12 | const hasSchemas = api && api.components && api.components.schemas; 13 | if (!hasSchemas) { 14 | throw new Error("Missing schemas in openapi"); 15 | } 16 | // Recursive function to traverse the OpenAPI object 17 | function removeObjectAdditionalProperties(obj) { 18 | if (typeof obj !== "object" || obj === null) { 19 | return; 20 | } 21 | 22 | if (Array.isArray(obj)) { 23 | for (let i = 0; i < obj.length; i++) { 24 | removeObjectAdditionalProperties(obj[i]); 25 | } 26 | } else { 27 | // Remove enum field if present 28 | if (obj.hasOwnProperty("additionalProperties")) { 29 | if (obj.additionalProperties.type === "object") { 30 | delete obj.additionalProperties; 31 | } 32 | } 33 | 34 | // Traverse nested properties 35 | for (const prop in obj) { 36 | if (obj.hasOwnProperty(prop)) { 37 | removeObjectAdditionalProperties(obj[prop]); 38 | } 39 | } 40 | } 41 | } 42 | 43 | // Start removing enum fields from the OpenAPI object 44 | removeObjectAdditionalProperties(api); 45 | return api; 46 | } 47 | 48 | module.exports = { 49 | applyRemoveObjectAdditionalProperties: applyRemoveObjectAdditionalProperties, 50 | }; 51 | -------------------------------------------------------------------------------- /tools/transformer/src/transformations/fields.js: -------------------------------------------------------------------------------- 1 | const fieldTransformations = require("../field.transformations.json"); 2 | 3 | /** 4 | * Makes specified fields optional in their respective schemas 5 | * @param {*} api OpenAPI JSON File 6 | * @returns OpenAPI JSON File 7 | */ 8 | function applyFieldTransformations(api) { 9 | const { optionalFields } = fieldTransformations; 10 | 11 | // Make specified fields optional in their schemas 12 | for (const [schemaName, fields] of Object.entries(optionalFields)) { 13 | const schema = api.components.schemas[schemaName]; 14 | if (schema && schema.required) { 15 | schema.required = schema.required.filter( 16 | (field) => !fields.includes(field), 17 | ); 18 | if (schema.required.length === 0) { 19 | delete schema.required; 20 | } 21 | } 22 | } 23 | 24 | return api; 25 | } 26 | 27 | module.exports = { 28 | applyFieldTransformations, 29 | }; 30 | -------------------------------------------------------------------------------- /tools/transformer/src/transformations/index.js: -------------------------------------------------------------------------------- 1 | const { applyAllOfTransformations, transformAllOf } = require("./allOf"); 2 | const { applyModelNameTransformations } = require("./name"); 3 | const { 4 | applyOneOfTransformations, 5 | transformOneOf, 6 | transformOneOfProperties, 7 | } = require("./oneOf"); 8 | const { applyDiscriminatorTransformations } = require("./discriminator"); 9 | const { applyArrayTransformations } = require("./swapArray"); 10 | const { applyRemoveEnumsTransformations } = require("./removeEnums"); 11 | const { 12 | applyRemoveObjectAdditionalProperties, 13 | } = require("./additionalPropertiesObject"); 14 | const { applyAnyOfTransformations } = require("./anyOf"); 15 | const { applyRemoveNullableTransformations } = require("./removeNullable"); 16 | const { removeRefsFromParameters } = require("./removeInvalidParams"); 17 | const { reorderResponseBodies } = require("./reorderResponseBodies"); 18 | const { applyFieldTransformations } = require("./fields"); 19 | 20 | module.exports = { 21 | applyModelNameTransformations, 22 | transformAllOf, 23 | transformOneOf, 24 | transformOneOfProperties, 25 | applyAllOfTransformations, 26 | applyOneOfTransformations, 27 | applyDiscriminatorTransformations, 28 | applyArrayTransformations, 29 | applyRemoveEnumsTransformations, 30 | applyRemoveObjectAdditionalProperties, 31 | applyAnyOfTransformations, 32 | applyRemoveNullableTransformations, 33 | removeRefsFromParameters, 34 | reorderResponseBodies, 35 | applyFieldTransformations, 36 | }; 37 | -------------------------------------------------------------------------------- /tools/transformer/src/transformations/name.js: -------------------------------------------------------------------------------- 1 | const isModelIgnored = require("../engine/ignoreModel"); 2 | 3 | /** 4 | * Transforms provided API JSON file by removing prefix and suffix from the 5 | * API models 6 | * 7 | * @param {*} api OpenAPI JSON File 8 | * @param {*} prefix model prefix or empty string if only suffix is needed. 9 | * @param {*} suffix model suffix or empty string if only prefix is needed. 10 | * @param 11 | * @returns OpenAPI JSON File 12 | */ 13 | function applyModelNameTransformations(api, prefix, suffix, ignoreModels) { 14 | const hasSchemas = api && api.components && api.components.schemas; 15 | if (!hasSchemas) { 16 | throw new Error("Missing schemas in openapi"); 17 | } 18 | 19 | for (const schemaKey of Object.keys(api.components.schemas)) { 20 | if (schemaKey.startsWith(prefix) && schemaKey.endsWith(suffix)) { 21 | if (isModelIgnored(schemaKey, ignoreModels)) { 22 | console.warn("Ignored rename for the object: " + schemaKey); 23 | continue; 24 | } 25 | 26 | const schemaTransformedName = schemaKey 27 | .replace(prefix, "") 28 | .replace(suffix, ""); 29 | if (api.components.schemas[schemaTransformedName]) { 30 | throw new Error( 31 | `components.schemas already contain key ${schemaTransformedName}. Please rename ${schemaKey} object to avoid name overlap.`, 32 | ); 33 | } 34 | api.components.schemas[schemaTransformedName] = 35 | api.components.schemas[schemaKey]; 36 | delete api.components.schemas[schemaKey]; 37 | } 38 | } 39 | 40 | let regexp = new RegExp(`"#/components/schemas/${prefix}(.*)${suffix}"`, "g"); 41 | let apiString = JSON.stringify(api, undefined, 2); 42 | let apiToReplace = apiString.replace(regexp, '"#/components/schemas/$1"'); 43 | api = JSON.parse(apiToReplace); 44 | return api; 45 | } 46 | 47 | module.exports = { 48 | applyModelNameTransformations, 49 | }; 50 | -------------------------------------------------------------------------------- /tools/transformer/src/transformations/removeEnums.js: -------------------------------------------------------------------------------- 1 | const removeField = require("../engine/removeField"); 2 | 3 | /** 4 | * Remove all enums from the schema. 5 | * Enums would not allow us to ensure API contract and will introduce breaking changes. 6 | * Enums should be defined as metadata in the schema. 7 | * @param {*} api OpenAPI JSON File 8 | * @param modelNames 9 | * @returns OpenAPI JSON File 10 | */ 11 | function applyRemoveEnumsTransformations(api) { 12 | return removeField(api, "enum"); 13 | } 14 | 15 | module.exports = { 16 | applyRemoveEnumsTransformations, 17 | }; 18 | -------------------------------------------------------------------------------- /tools/transformer/src/transformations/removeInvalidParams.js: -------------------------------------------------------------------------------- 1 | // ** Remove invalid parameters that do not apply for the end user 2 | function removeRefsFromParameters(openapiJson, refsToRemove) { 3 | if (!openapiJson || typeof openapiJson !== "object") { 4 | throw new Error("Invalid input. Expected an OpenAPI JSON object."); 5 | } 6 | 7 | if (!Array.isArray(refsToRemove)) { 8 | throw new Error("Invalid input. Expected an array of $ref strings."); 9 | } 10 | 11 | if (!openapiJson.paths) { 12 | throw new Error('Input JSON does not contain "paths" property.'); 13 | } 14 | 15 | const paths = openapiJson.paths; 16 | 17 | for (const path in paths) { 18 | const pathObject = paths[path]; 19 | 20 | for (const method in pathObject) { 21 | const operation = pathObject[method]; 22 | 23 | if (operation.parameters && Array.isArray(operation.parameters)) { 24 | operation.parameters = operation.parameters.filter((parameter) => { 25 | if (!refsToRemove.includes(parameter.$ref)) { 26 | return true; 27 | } 28 | return false; 29 | }); 30 | } 31 | } 32 | } 33 | 34 | return openapiJson; 35 | } 36 | 37 | module.exports = { removeRefsFromParameters }; 38 | -------------------------------------------------------------------------------- /tools/transformer/src/transformations/removeNullable.js: -------------------------------------------------------------------------------- 1 | const removeField = require("../engine/removeField"); 2 | 3 | /** 4 | * Remove nullable from the schema. 5 | * @param {*} api OpenAPI JSON File 6 | * @param modelNames 7 | * @returns OpenAPI JSON File 8 | */ 9 | function applyRemoveNullableTransformations(api) { 10 | return removeField(api, "nullable"); 11 | } 12 | 13 | module.exports = { 14 | applyRemoveNullableTransformations, 15 | }; 16 | -------------------------------------------------------------------------------- /tools/transformer/src/transformations/reorderResponseBodies.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Reorder responses by using application/vnd.*json with the most recent date as the first valid response. 3 | * @param {*} api OpenAPI JSON File 4 | * @returns OpenAPI JSON File 5 | */ 6 | function reorderResponseBodies(api) { 7 | Object.values(api.paths).forEach((methods) => { 8 | Object.values(methods).forEach((operation) => { 9 | traverse(operation.responses); 10 | }); 11 | }); 12 | return api; 13 | 14 | function traverse(responses) { 15 | if (typeof responses !== "object") { 16 | return; 17 | } 18 | 19 | for (const prop in responses) { 20 | traverse(responses[prop]); 21 | } 22 | 23 | if (responses.content) { 24 | responses.content = sortByMediaType(responses.content); 25 | } 26 | } 27 | 28 | function sortByMediaType(content) { 29 | const ret = {}; 30 | Object.keys(content) 31 | .sort((a, b) => compareMediaType(a, b)) 32 | .forEach((key) => (ret[key] = content[key])); 33 | return ret; 34 | } 35 | 36 | function compareMediaType(a, b) { 37 | const matcher = /application\/vnd\.atlas\.(\d{4}-\d{2}-\d{2})\+json/; 38 | const atlasA = a.match(matcher); 39 | const atlasB = b.match(matcher); 40 | 41 | if (atlasA && atlasB) { 42 | return new Date(atlasB[1]) - new Date(atlasA[1]); // Newer date first 43 | } else if (atlasA) { 44 | return -1; // vnd.atlas json first 45 | } else if (atlasB) { 46 | return 1; 47 | } else { 48 | return a - b; // Default ordering if not vnd.atlas json 49 | } 50 | } 51 | } 52 | 53 | module.exports = { 54 | reorderResponseBodies, 55 | }; 56 | -------------------------------------------------------------------------------- /tools/transformer/src/transformations/swapArray.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Transforms the model name into array of that model name for situations when schema needs to be an array of that model. 3 | * Transformation acts inline - model object becomes array of that model object and items are organized inline. 4 | * 5 | * Temporary workaround for https://jira.mongodb.org/browse/CLOUDP-173481 6 | * 7 | * @param {*} api OpenAPI JSON File 8 | * @param 9 | * @returns OpenAPI JSON File 10 | */ 11 | function applyArrayTransformations(api, modelNames) { 12 | const hasSchemas = api && api.components && api.components.schemas; 13 | if (!hasSchemas) { 14 | throw new Error("Missing schemas in openapi"); 15 | } 16 | for (const modelName of modelNames) { 17 | if (!api.components.schemas[modelName]) { 18 | // For cases when openapi is already fixed 19 | console.info(`Missing schema ${modelName} in openapi`); 20 | } else if (api.components.schemas[modelName].type !== "array") { 21 | model = api.components.schemas[modelName]; 22 | api.components.schemas[modelName] = { 23 | type: "array", 24 | items: { 25 | ...model, 26 | }, 27 | }; 28 | } 29 | } 30 | return api; 31 | } 32 | 33 | module.exports = { 34 | applyArrayTransformations, 35 | }; 36 | --------------------------------------------------------------------------------