From 11b7d8b86455ecf848a98f5007094c099a36f9ca Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Tue, 17 Jun 2025 15:37:07 +0100 Subject: [PATCH 01/14] Introduce stability levels structs --- ...i-atlasSearch-getAtlasSearchDeployment.txt | 2 +- ...-api-streams-createTransitGatewayRoute.txt | 93 + ...-api-streams-deleteTransitGatewayRoute.txt | 102 + ...las-api-streams-getTransitGatewayRoute.txt | 102 + ...s-api-streams-listTransitGatewayRoutes.txt | 106 + docs/command/atlas-api-streams.txt | 8 + internal/api/commands.go | 2202 +++++++++-------- internal/api/executor_test.go | 12 +- internal/api/httprequest.go | 14 +- internal/api/httprequest_test.go | 24 +- internal/api/interface.go | 2 +- internal/cli/api/api.go | 31 +- internal/cli/api/command_request.go | 2 +- tools/cmd/api-generator/commands.go.tmpl | 6 +- tools/cmd/api-generator/convert_commands.go | 72 +- .../api-generator/convert_commands_test.go | 23 +- tools/cmd/api-generator/convert_metadata.go | 8 +- tools/cmd/api-generator/main.go | 13 + .../.snapshots/00-spec.yaml-commands.snapshot | 18 +- .../01-missing-tag.yaml-commands.snapshot | 18 +- ...tiple-content-types.yaml-commands.snapshot | 18 +- ...ted-parameter-types.yaml-commands.snapshot | 4 +- ...spec-with-overrides.yaml-commands.snapshot | 10 +- .../05-examples.yaml-commands.snapshot | 18 +- ...specific-extensions.yaml-commands.snapshot | 10 +- .../07-sunset.yaml-commands.snapshot | 8 +- .../08-watchers.yaml-commands.snapshot | 20 +- tools/cmd/api-generator/watcher.go | 13 +- tools/cmd/api-generator/watcher_test.go | 42 +- tools/shared/api/api.go | 8 +- tools/shared/api/stability_levels.go | 252 ++ 31 files changed, 2124 insertions(+), 1137 deletions(-) create mode 100644 docs/command/atlas-api-streams-createTransitGatewayRoute.txt create mode 100644 docs/command/atlas-api-streams-deleteTransitGatewayRoute.txt create mode 100644 docs/command/atlas-api-streams-getTransitGatewayRoute.txt create mode 100644 docs/command/atlas-api-streams-listTransitGatewayRoutes.txt create mode 100644 tools/shared/api/stability_levels.go diff --git a/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt b/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt index 6525be7883..cfa3d2648a 100644 --- a/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt +++ b/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt @@ -77,7 +77,7 @@ Options * - --version - string - false - - api version to use when calling the api call [options: "2023-01-01", "2024-05-30", "2025-03-12"], defaults to the latest version or the profiles api_version config value if set This value defaults to "2025-03-12". + - api version to use when calling the api call [options: "2023-01-01", "2024-05-30", "2025-03-12"], defaults to the latest version or the profiles api_version config value if set This value defaults to "2024-05-30". Inherited Options ----------------- diff --git a/docs/command/atlas-api-streams-createTransitGatewayRoute.txt b/docs/command/atlas-api-streams-createTransitGatewayRoute.txt new file mode 100644 index 0000000000..ecbf32009d --- /dev/null +++ b/docs/command/atlas-api-streams-createTransitGatewayRoute.txt @@ -0,0 +1,93 @@ +.. _atlas-api-streams-createTransitGatewayRoute: + +=========================================== +atlas api streams createTransitGatewayRoute +=========================================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +`Public Preview: please provide feedback `_: Creates a route in the default route table associated with Atlas VPC to route all traffic destined for provided CIDR to the provided Transit Gateway. + +Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). +Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link. + + + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createTransitGatewayRoute. + +For more information and examples, see the referenced API documentation linked above. + +Syntax +------ + +.. code-block:: + :caption: Command Syntax + + atlas api streams createTransitGatewayRoute [options] + +.. Code end marker, please don't delete this comment + +Options +------- + +.. list-table:: + :header-rows: 1 + :widths: 20 10 10 60 + + * - Name + - Type + - Required + - Description + * - --envelope + - envelope + - false + - Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. + * - --file + - string + - false + - path to your API request file. Leave empty to use standard input instead - you must provide one or the other, but not both. + * - --groupId + - string + - true + - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + * - -h, --help + - + - false + - help for createTransitGatewayRoute + * - -o, --output + - string + - false + - preferred api format, can be ["json", go-template] This value defaults to "json". + * - --outputFile + - string + - false + - file to write the api output to. This flag is required when the output of an endpoint is binary (ex: gzip) and the command is not piped (ex: atlas command > out.zip) + * - --version + - string + - false + - api version to use when calling the api call [options: "preview"], defaults to the latest version or the profiles api_version config value if set This value defaults to "preview". + +Inherited Options +----------------- + +.. list-table:: + :header-rows: 1 + :widths: 20 10 10 60 + + * - Name + - Type + - Required + - Description + * - -P, --profile + - string + - false + - Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. + diff --git a/docs/command/atlas-api-streams-deleteTransitGatewayRoute.txt b/docs/command/atlas-api-streams-deleteTransitGatewayRoute.txt new file mode 100644 index 0000000000..a30f9c36ee --- /dev/null +++ b/docs/command/atlas-api-streams-deleteTransitGatewayRoute.txt @@ -0,0 +1,102 @@ +.. _atlas-api-streams-deleteTransitGatewayRoute: + +=========================================== +atlas api streams deleteTransitGatewayRoute +=========================================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +`Public Preview: please provide feedback `_: Deletes a transit gateway route in the default route table associated with Atlas VPC. + +Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). +Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link. + + + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/deleteTransitGatewayRoute. + +For more information and examples, see the referenced API documentation linked above. + +Syntax +------ + +.. code-block:: + :caption: Command Syntax + + atlas api streams deleteTransitGatewayRoute [options] + +.. Code end marker, please don't delete this comment + +Options +------- + +.. list-table:: + :header-rows: 1 + :widths: 20 10 10 60 + + * - Name + - Type + - Required + - Description + * - --envelope + - envelope + - false + - Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. + * - --groupId + - string + - true + - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + * - -h, --help + - + - false + - help for deleteTransitGatewayRoute + * - -o, --output + - string + - false + - preferred api format, can be ["json", go-template] This value defaults to "json". + * - --outputFile + - string + - false + - file to write the api output to. This flag is required when the output of an endpoint is binary (ex: gzip) and the command is not piped (ex: atlas command > out.zip) + * - --routeId + - string + - true + - The Object ID that uniquely identifies a transit gateway route. + * - --version + - string + - false + - api version to use when calling the api call [options: "preview"], defaults to the latest version or the profiles api_version config value if set This value defaults to "preview". + +Inherited Options +----------------- + +.. list-table:: + :header-rows: 1 + :widths: 20 10 10 60 + + * - Name + - Type + - Required + - Description + * - -P, --profile + - string + - false + - Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. + +Examples +-------- + +.. code-block:: + + atlas api streams deleteTransitGatewayRoute --version preview --groupId 32b6e34b3d91647abb20e7b8 --routeId 32b6e34b3d91647abb20e7b8 + +.. Code end marker, please don't delete this comment + diff --git a/docs/command/atlas-api-streams-getTransitGatewayRoute.txt b/docs/command/atlas-api-streams-getTransitGatewayRoute.txt new file mode 100644 index 0000000000..639dae66fb --- /dev/null +++ b/docs/command/atlas-api-streams-getTransitGatewayRoute.txt @@ -0,0 +1,102 @@ +.. _atlas-api-streams-getTransitGatewayRoute: + +======================================== +atlas api streams getTransitGatewayRoute +======================================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +`Public Preview: please provide feedback `_: Retrieves a transit gateway route in the default route table associated with Atlas VPC. + +Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). +Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link. + + + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getTransitGatewayRoute. + +For more information and examples, see the referenced API documentation linked above. + +Syntax +------ + +.. code-block:: + :caption: Command Syntax + + atlas api streams getTransitGatewayRoute [options] + +.. Code end marker, please don't delete this comment + +Options +------- + +.. list-table:: + :header-rows: 1 + :widths: 20 10 10 60 + + * - Name + - Type + - Required + - Description + * - --envelope + - envelope + - false + - Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. + * - --groupId + - string + - true + - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + * - -h, --help + - + - false + - help for getTransitGatewayRoute + * - -o, --output + - string + - false + - preferred api format, can be ["json", go-template] This value defaults to "json". + * - --outputFile + - string + - false + - file to write the api output to. This flag is required when the output of an endpoint is binary (ex: gzip) and the command is not piped (ex: atlas command > out.zip) + * - --routeId + - string + - true + - The Object ID that uniquely identifies a transit gateway route. + * - --version + - string + - false + - api version to use when calling the api call [options: "preview"], defaults to the latest version or the profiles api_version config value if set This value defaults to "preview". + +Inherited Options +----------------- + +.. list-table:: + :header-rows: 1 + :widths: 20 10 10 60 + + * - Name + - Type + - Required + - Description + * - -P, --profile + - string + - false + - Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. + +Examples +-------- + +.. code-block:: + + atlas api streams getTransitGatewayRoute --version preview --groupId 32b6e34b3d91647abb20e7b8 --routeId 32b6e34b3d91647abb20e7b8 + +.. Code end marker, please don't delete this comment + diff --git a/docs/command/atlas-api-streams-listTransitGatewayRoutes.txt b/docs/command/atlas-api-streams-listTransitGatewayRoutes.txt new file mode 100644 index 0000000000..1a3d0cb1f9 --- /dev/null +++ b/docs/command/atlas-api-streams-listTransitGatewayRoutes.txt @@ -0,0 +1,106 @@ +.. _atlas-api-streams-listTransitGatewayRoutes: + +========================================== +atlas api streams listTransitGatewayRoutes +========================================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +`Public Preview: please provide feedback `_: List Transit Gateway routes in the default route table associated with Atlas VPC. + +Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). +Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link. + + + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/listTransitGatewayRoutes. + +For more information and examples, see the referenced API documentation linked above. + +Syntax +------ + +.. code-block:: + :caption: Command Syntax + + atlas api streams listTransitGatewayRoutes [options] + +.. Code end marker, please don't delete this comment + +Options +------- + +.. list-table:: + :header-rows: 1 + :widths: 20 10 10 60 + + * - Name + - Type + - Required + - Description + * - --envelope + - envelope + - false + - Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. + * - --groupId + - string + - true + - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + * - -h, --help + - + - false + - help for listTransitGatewayRoutes + * - --itemsPerPage + - int + - false + - Number of items that the response returns per page. + * - -o, --output + - string + - false + - preferred api format, can be ["json", go-template] This value defaults to "json". + * - --outputFile + - string + - false + - file to write the api output to. This flag is required when the output of an endpoint is binary (ex: gzip) and the command is not piped (ex: atlas command > out.zip) + * - --pageNum + - int + - false + - Number of the page that displays the current set of the total objects that the response returns. + * - --version + - string + - false + - api version to use when calling the api call [options: "preview"], defaults to the latest version or the profiles api_version config value if set This value defaults to "preview". + +Inherited Options +----------------- + +.. list-table:: + :header-rows: 1 + :widths: 20 10 10 60 + + * - Name + - Type + - Required + - Description + * - -P, --profile + - string + - false + - Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. + +Examples +-------- + +.. code-block:: + + atlas api streams listTransitGatewayRoutes --version preview --groupId 32b6e34b3d91647abb20e7b8 + +.. Code end marker, please don't delete this comment + diff --git a/docs/command/atlas-api-streams.txt b/docs/command/atlas-api-streams.txt index 34375e7407..6c960a44dc 100644 --- a/docs/command/atlas-api-streams.txt +++ b/docs/command/atlas-api-streams.txt @@ -62,10 +62,12 @@ Related Commands * :ref:`atlas-api-streams-createStreamInstance` - `Public Preview: please provide feedback `_: Creates one stream instance in the specified project. * :ref:`atlas-api-streams-createStreamInstanceWithSampleConnections` - `Public Preview: please provide feedback `_: Creates one stream instance in the specified project with sample connections. * :ref:`atlas-api-streams-createStreamProcessor` - `Public Preview: please provide feedback `_: Create one Stream Processor within the specified stream instance. +* :ref:`atlas-api-streams-createTransitGatewayRoute` - `Public Preview: please provide feedback `_: Creates a route in the default route table associated with Atlas VPC to route all traffic destined for provided CIDR to the provided Transit Gateway. * :ref:`atlas-api-streams-deletePrivateLinkConnection` - `Public Preview: please provide feedback `_: Deletes one Private Link in the specified project. * :ref:`atlas-api-streams-deleteStreamConnection` - `Public Preview: please provide feedback `_: Delete one connection of the specified stream instance. * :ref:`atlas-api-streams-deleteStreamInstance` - `Public Preview: please provide feedback `_: Delete one stream instance in the specified project. * :ref:`atlas-api-streams-deleteStreamProcessor` - `Public Preview: please provide feedback `_: Delete a Stream Processor within the specified stream instance. +* :ref:`atlas-api-streams-deleteTransitGatewayRoute` - `Public Preview: please provide feedback `_: Deletes a transit gateway route in the default route table associated with Atlas VPC. * :ref:`atlas-api-streams-deleteVpcPeeringConnection` - `Public Preview: please provide feedback `_: Deletes an incoming VPC Peering connection. * :ref:`atlas-api-streams-downloadStreamTenantAuditLogs` - `Public Preview: please provide feedback `_: Downloads the audit logs for the specified Atlas Streams Processing instance. * :ref:`atlas-api-streams-getAccountDetails` - `Public Preview: please provide feedback `_: Returns the Account ID, and the VPC ID for the group and region specified. @@ -74,11 +76,13 @@ Related Commands * :ref:`atlas-api-streams-getStreamConnection` - `Public Preview: please provide feedback `_: Returns the details of one stream connection within the specified stream instance. * :ref:`atlas-api-streams-getStreamInstance` - `Public Preview: please provide feedback `_: Returns the details of one stream instance within the specified project. * :ref:`atlas-api-streams-getStreamProcessor` - `Public Preview: please provide feedback `_: Get one Stream Processor within the specified stream instance. +* :ref:`atlas-api-streams-getTransitGatewayRoute` - `Public Preview: please provide feedback `_: Retrieves a transit gateway route in the default route table associated with Atlas VPC. * :ref:`atlas-api-streams-getVpcPeeringConnections` - `Public Preview: please provide feedback `_: Returns a list of incoming VPC Peering Connections. * :ref:`atlas-api-streams-listPrivateLinkConnections` - `Public Preview: please provide feedback `_: Returns all Private Link connections for the specified project. * :ref:`atlas-api-streams-listStreamConnections` - `Public Preview: please provide feedback `_: Returns all connections of the stream instance for the specified project. * :ref:`atlas-api-streams-listStreamInstances` - `Public Preview: please provide feedback `_: Returns all stream instances for the specified project. * :ref:`atlas-api-streams-listStreamProcessors` - `Public Preview: please provide feedback `_: Returns all Stream Processors within the specified stream instance. +* :ref:`atlas-api-streams-listTransitGatewayRoutes` - `Public Preview: please provide feedback `_: List Transit Gateway routes in the default route table associated with Atlas VPC. * :ref:`atlas-api-streams-modifyStreamProcessor` - `Public Preview: please provide feedback `_: Modify one existing Stream Processor within the specified stream instance. * :ref:`atlas-api-streams-rejectVpcPeeringConnection` - `Public Preview: please provide feedback `_: Requests the rejection of an incoming VPC Peering connection. * :ref:`atlas-api-streams-startStreamProcessor` - `Public Preview: please provide feedback `_: Start a Stream Processor within the specified stream instance. @@ -97,10 +101,12 @@ Related Commands createStreamInstance createStreamInstanceWithSampleConnections createStreamProcessor + createTransitGatewayRoute deletePrivateLinkConnection deleteStreamConnection deleteStreamInstance deleteStreamProcessor + deleteTransitGatewayRoute deleteVpcPeeringConnection downloadStreamTenantAuditLogs getAccountDetails @@ -109,11 +115,13 @@ Related Commands getStreamConnection getStreamInstance getStreamProcessor + getTransitGatewayRoute getVpcPeeringConnections listPrivateLinkConnections listStreamConnections listStreamInstances listStreamProcessors + listTransitGatewayRoutes modifyStreamProcessor rejectVpcPeeringConnection startStreamProcessor diff --git a/internal/api/commands.go b/internal/api/commands.go index a41339a9d2..beea29b273 100644 --- a/internal/api/commands.go +++ b/internal/api/commands.go @@ -78,9 +78,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -138,9 +138,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -264,9 +264,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -384,9 +384,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -453,9 +453,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -526,9 +526,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -599,9 +599,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -644,9 +644,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -737,9 +737,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -840,9 +840,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -916,9 +916,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -992,9 +992,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPut, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -1071,16 +1071,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -1151,9 +1151,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -1254,9 +1254,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -1357,9 +1357,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -1433,16 +1433,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -1452,7 +1452,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getAtlasSearchDeployment`, - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -1528,9 +1528,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -1598,9 +1598,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -1668,16 +1668,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -1687,7 +1687,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getAtlasSearchDeployment`, - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -1769,9 +1769,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -1869,9 +1869,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -1949,9 +1949,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -2019,23 +2019,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2025, 3, 12), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2025-03-12`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -2113,9 +2113,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -2213,9 +2213,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -2293,9 +2293,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -2383,9 +2383,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -2453,9 +2453,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -2543,9 +2543,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -2613,16 +2613,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -2632,7 +2632,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getAtlasSearchDeployment`, - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -2718,9 +2718,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -2818,9 +2818,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -2898,9 +2898,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -2964,9 +2964,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -3024,9 +3024,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -3110,9 +3110,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -3170,9 +3170,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -3182,7 +3182,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getBackupExportJob`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `clusterName`: `input:clusterName`, `exportId`: `body:$.id`, @@ -3264,9 +3264,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -3324,16 +3324,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -3404,9 +3404,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -3464,16 +3464,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -3531,9 +3531,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -3611,9 +3611,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -3623,7 +3623,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getReplicaSetBackup`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -3706,9 +3706,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -3766,9 +3766,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -3778,7 +3778,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getDataProtectionSettings`, - Version: `2023-10-01`, + Version: shared_api.NewStableVersion(2023, 10, 1), Params: map[string]string{ `groupId`: `input:groupId`, }, @@ -3853,9 +3853,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -3933,9 +3933,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4003,16 +4003,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4070,16 +4070,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-10-01`, + Version: shared_api.NewStableVersion(2023, 10, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4137,16 +4137,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4224,9 +4224,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4297,9 +4297,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4380,9 +4380,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4460,9 +4460,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4560,9 +4560,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4660,9 +4660,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4750,16 +4750,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4857,9 +4857,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -4960,9 +4960,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -5063,9 +5063,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -5133,9 +5133,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -5206,9 +5206,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -5218,7 +5218,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getReplicaSetBackup`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -5296,16 +5296,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -5373,16 +5373,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPut, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-10-01`, + Version: shared_api.NewStableVersion(2023, 10, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -5392,7 +5392,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getDataProtectionSettings`, - Version: `2023-10-01`, + Version: shared_api.NewStableVersion(2023, 10, 1), Params: map[string]string{ `groupId`: `input:groupId`, }, @@ -5477,9 +5477,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -5489,7 +5489,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getReplicaSetBackup`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -5559,9 +5559,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -5628,16 +5628,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -5705,9 +5705,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPut, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -5751,9 +5751,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -5821,9 +5821,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -5881,9 +5881,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -5937,9 +5937,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -5997,16 +5997,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -6080,9 +6080,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -6140,9 +6140,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -6220,9 +6220,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -6290,9 +6290,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -6350,9 +6350,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -6426,9 +6426,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -6438,7 +6438,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getOutageSimulation`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -6510,9 +6510,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -6580,9 +6580,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -6592,7 +6592,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getOutageSimulation`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -6674,9 +6674,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -6737,30 +6737,30 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -6770,7 +6770,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getCluster`, - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), Params: map[string]string{ `clusterName`: `body:$.name`, `groupId`: `body:$.groupId`, @@ -6859,16 +6859,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -6878,7 +6878,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getCluster`, - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -6953,23 +6953,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7037,16 +7037,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7114,9 +7114,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7174,9 +7174,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7244,9 +7244,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -7354,9 +7354,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7457,23 +7457,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7546,9 +7546,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7606,9 +7606,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7618,7 +7618,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getSampleDatasetLoadStatus`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `groupId`: `input:groupId`, `sampleDatasetId`: `body:$.id`, @@ -7695,9 +7695,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -7765,9 +7765,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7835,16 +7835,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7912,9 +7912,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -7982,30 +7982,30 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -8015,7 +8015,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getCluster`, - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), Params: map[string]string{ `clusterName`: `input:clusterName`, `groupId`: `input:groupId`, @@ -8091,16 +8091,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -8161,9 +8161,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -8297,9 +8297,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -8417,9 +8417,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -8467,9 +8467,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -8567,9 +8567,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -8657,9 +8657,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -8717,9 +8717,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -8777,9 +8777,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -8838,9 +8838,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPut, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -8899,9 +8899,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -8965,9 +8965,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -9035,9 +9035,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -9105,9 +9105,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -9165,9 +9165,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -9235,9 +9235,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -9328,9 +9328,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -9398,9 +9398,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -9476,9 +9476,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -9546,9 +9546,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -9616,9 +9616,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -9694,9 +9694,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -9764,9 +9764,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `gzip`, @@ -9834,9 +9834,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -9894,9 +9894,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -9984,9 +9984,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10054,9 +10054,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10142,9 +10142,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10212,9 +10212,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10292,9 +10292,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -10348,9 +10348,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -10360,7 +10360,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getPipeline`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `groupId`: `input:groupId`, `pipelineName`: `body:$.name`, @@ -10426,9 +10426,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10438,7 +10438,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getPipeline`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `groupId`: `input:groupId`, `pipelineName`: `input:pipelineName`, @@ -10520,9 +10520,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10590,9 +10590,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10670,9 +10670,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10780,9 +10780,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10850,9 +10850,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -10960,9 +10960,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -11010,9 +11010,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -11080,9 +11080,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -11150,9 +11150,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -11220,9 +11220,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -11280,9 +11280,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -11292,7 +11292,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getPipeline`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `groupId`: `input:groupId`, `pipelineName`: `input:pipelineName`, @@ -11364,9 +11364,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -11457,9 +11457,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -11550,9 +11550,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -11640,9 +11640,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -11733,9 +11733,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -11809,9 +11809,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -11872,9 +11872,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -11952,9 +11952,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -12052,9 +12052,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -12132,9 +12132,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -12195,9 +12195,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -12280,9 +12280,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -12363,9 +12363,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -12438,9 +12438,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -12570,9 +12570,9 @@ IMPORTANT: The complete list of event type values changes frequently.`, }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -12729,9 +12729,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -12784,9 +12784,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -12840,9 +12840,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -12875,9 +12875,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -12934,9 +12934,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13000,9 +13000,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13056,9 +13056,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13112,9 +13112,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13168,9 +13168,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13213,9 +13213,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13279,9 +13279,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13345,9 +13345,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13431,9 +13431,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13487,9 +13487,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13543,9 +13543,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13602,9 +13602,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13670,9 +13670,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -13729,9 +13729,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -13795,9 +13795,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPut, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -13861,9 +13861,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -13873,7 +13873,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getFlexCluster`, - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), Params: map[string]string{ `groupId`: `input:groupId`, `name`: `body:$.name`, @@ -13950,9 +13950,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -13962,7 +13962,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getFlexCluster`, - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), Params: map[string]string{ `groupId`: `input:groupId`, `name`: `input:name`, @@ -14034,9 +14034,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -14124,9 +14124,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -14194,9 +14194,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -14206,7 +14206,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getFlexCluster`, - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), Params: map[string]string{ `groupId`: `input:groupId`, `name`: `input:name`, @@ -14272,9 +14272,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -14348,9 +14348,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -14360,7 +14360,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getFlexBackupRestoreJob`, - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), Params: map[string]string{ `groupId`: `input:groupId`, `name`: `input:name`, @@ -14448,9 +14448,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -14548,9 +14548,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -14624,9 +14624,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -14694,9 +14694,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -14794,9 +14794,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -14871,23 +14871,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -14955,23 +14955,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -15039,23 +15039,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -15143,23 +15143,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -15227,23 +15227,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -15293,9 +15293,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -15360,9 +15360,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `csv`, @@ -15416,9 +15416,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `csv`, @@ -15484,9 +15484,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `csv`, @@ -15632,9 +15632,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -15688,9 +15688,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -15764,9 +15764,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -15830,9 +15830,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -15890,9 +15890,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -15960,9 +15960,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -16023,9 +16023,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -16083,9 +16083,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -16095,7 +16095,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getLdapConfigurationStatus`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `groupId`: `input:groupId`, `requestId`: `body:$.requestId`, @@ -16178,9 +16178,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -16258,9 +16258,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -16338,9 +16338,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -16421,9 +16421,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -16501,9 +16501,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -16574,9 +16574,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -16674,9 +16674,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -16787,9 +16787,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -16897,9 +16897,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -16977,9 +16977,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -17050,9 +17050,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -17106,9 +17106,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -17166,9 +17166,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -17216,9 +17216,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -17266,9 +17266,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -17316,9 +17316,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -17394,9 +17394,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -17467,9 +17467,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -17537,9 +17537,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -17606,9 +17606,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -17665,9 +17665,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -17716,9 +17716,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -17788,9 +17788,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -17864,9 +17864,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -17920,9 +17920,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -17976,9 +17976,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -18088,16 +18088,16 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -18231,16 +18231,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -18350,16 +18350,16 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -18429,9 +18429,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -18501,16 +18501,16 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -18581,9 +18581,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -18657,16 +18657,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -18733,9 +18733,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -18805,9 +18805,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-02-19`, + Version: shared_api.NewStableVersion(2025, 2, 19), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -18881,9 +18881,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -18961,9 +18961,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -19091,9 +19091,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -19238,9 +19238,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -19328,16 +19328,16 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `gzip`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `gzip`, @@ -19475,9 +19475,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -19615,9 +19615,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -19725,9 +19725,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -19815,9 +19815,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -19915,9 +19915,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -19985,9 +19985,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -20085,9 +20085,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -20215,9 +20215,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -20275,9 +20275,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -20342,9 +20342,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -20402,9 +20402,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -20472,9 +20472,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -20542,9 +20542,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -20602,9 +20602,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -20672,9 +20672,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -20742,9 +20742,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -20842,9 +20842,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -20942,9 +20942,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -21032,9 +21032,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -21102,9 +21102,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -21172,9 +21172,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -21232,9 +21232,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -21308,9 +21308,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -21320,7 +21320,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getOnlineArchive`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `archiveId`: `body:$.id`, `clusterName`: `input:clusterName`, @@ -21411,9 +21411,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -21423,7 +21423,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getOnlineArchive`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `archiveId`: `input:archiveId`, `clusterName`: `input:clusterName`, @@ -21516,9 +21516,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `gzip`, @@ -21596,9 +21596,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -21696,9 +21696,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -21776,9 +21776,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -21788,7 +21788,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getOnlineArchive`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `archiveId`: `input:archiveId`, `clusterName`: `input:clusterName`, @@ -21850,9 +21850,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -21909,9 +21909,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -21963,9 +21963,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22032,9 +22032,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22088,9 +22088,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22147,9 +22147,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22203,9 +22203,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22272,9 +22272,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22385,9 +22385,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22470,9 +22470,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22526,9 +22526,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -22582,9 +22582,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -22648,9 +22648,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -22714,9 +22714,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPut, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -22770,9 +22770,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -22836,9 +22836,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22896,9 +22896,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -22956,9 +22956,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -23026,9 +23026,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -23130,9 +23130,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -23179,9 +23179,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -23228,9 +23228,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -23382,9 +23382,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -23486,9 +23486,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -23650,9 +23650,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -23720,9 +23720,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -23806,9 +23806,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -23866,9 +23866,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -23878,7 +23878,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getPrivateEndpointService`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `cloudProvider`: `body:$.cloudProvider`, `endpointServiceId`: `body:$.id`, @@ -23976,9 +23976,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -24056,9 +24056,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -24068,7 +24068,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getPrivateEndpointService`, - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), Params: map[string]string{ `cloudProvider`: `body:$.cloudProvider`, `endpointServiceId`: `body:$.id`, @@ -24161,9 +24161,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -24241,9 +24241,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -24301,9 +24301,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -24371,9 +24371,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -24431,9 +24431,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -24507,9 +24507,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -24563,9 +24563,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -24659,9 +24659,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -24719,9 +24719,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -24785,9 +24785,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -24861,9 +24861,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -24927,9 +24927,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25003,9 +25003,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25099,9 +25099,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25185,9 +25185,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25275,9 +25275,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25345,9 +25345,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25411,9 +25411,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -25511,9 +25511,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -25607,9 +25607,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -25687,9 +25687,9 @@ which protocol (like TCP or UDP) the connection uses.`, }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25757,9 +25757,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25827,9 +25827,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25917,9 +25917,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -25983,9 +25983,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -26039,9 +26039,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -26099,9 +26099,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -26159,9 +26159,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26219,9 +26219,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26306,9 +26306,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26366,9 +26366,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26422,9 +26422,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26492,9 +26492,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26579,9 +26579,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26689,9 +26689,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26749,9 +26749,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26819,9 +26819,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26879,9 +26879,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -26954,9 +26954,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -27004,9 +27004,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27064,9 +27064,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -27154,9 +27154,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27214,9 +27214,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27274,9 +27274,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27334,9 +27334,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27404,9 +27404,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPut, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27464,9 +27464,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27530,9 +27530,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27590,9 +27590,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -27650,9 +27650,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -27710,9 +27710,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27772,9 +27772,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -27838,9 +27838,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -27894,9 +27894,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -27960,9 +27960,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -28016,9 +28016,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -28082,9 +28082,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -28138,9 +28138,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -28214,9 +28214,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -28265,9 +28265,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -28300,9 +28300,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c URLParameters: []shared_api.Parameter{}, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -28369,9 +28369,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -28381,7 +28381,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getFlexCluster`, - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), Params: map[string]string{ `groupId`: `input:groupId`, `name`: `body:$.name`, @@ -28460,9 +28460,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -28472,7 +28472,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getFlexCluster`, - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), Params: map[string]string{ `groupId`: `input:groupId`, `name`: `input:name`, @@ -28547,9 +28547,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -28640,9 +28640,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -28713,9 +28713,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -28725,7 +28725,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getFlexCluster`, - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), Params: map[string]string{ `groupId`: `input:groupId`, `name`: `input:name`, @@ -28803,9 +28803,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -28876,9 +28876,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -28949,9 +28949,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -29012,9 +29012,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -29085,9 +29085,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -29161,9 +29161,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -29221,9 +29221,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -29321,9 +29321,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -29391,9 +29391,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -29447,9 +29447,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -29543,9 +29543,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -29609,9 +29609,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -29679,9 +29679,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -29759,9 +29759,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -29839,9 +29839,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -29905,9 +29905,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -29981,9 +29981,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -30057,9 +30057,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -30127,9 +30127,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -30193,9 +30193,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -30293,9 +30293,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -30373,9 +30373,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -30469,9 +30469,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -30555,9 +30555,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -30631,9 +30631,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -30701,9 +30701,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -30767,9 +30767,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -30846,9 +30846,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -30929,9 +30929,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -31002,9 +31002,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -31081,9 +31081,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -31164,9 +31164,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -31237,9 +31237,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -31303,9 +31303,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -31363,9 +31363,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -31433,9 +31433,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -31493,9 +31493,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -31553,9 +31553,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -31623,9 +31623,59 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), + RequestContentType: `json`, + ResponseContentTypes: []string{ + `json`, + }, + }, + }, + }, + { + OperationID: `createTransitGatewayRoute`, + Aliases: nil, + Description: `Creates a route in the default route table associated with Atlas VPC to route all traffic destined for provided CIDR to the provided Transit Gateway. + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createTransitGatewayRoute. + +For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-streams-createTransitGatewayRoute/`, + RequestParameters: shared_api.RequestParameters{ + URL: `/api/atlas/v2/groups/{groupId}/streamsTgwRoutes`, + QueryParameters: []shared_api.Parameter{ + { + Name: `envelope`, + Description: `Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + Short: ``, + Required: false, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `bool`, + }, + }, + }, + URLParameters: []shared_api.Parameter{ + { + Name: `groupId`, + Description: `Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. + + +NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + Aliases: []string{`projectId`}, + }, + }, + Verb: http.MethodPost, + }, + Versions: []shared_api.CommandVersion{ + { + Version: shared_api.NewPreviewVersion("unknown"), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -31693,9 +31743,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -31773,9 +31823,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -31843,9 +31893,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -31923,9 +31973,69 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ + { + Version: shared_api.NewStableVersion(2024, 5, 30), + RequestContentType: ``, + ResponseContentTypes: []string{ + `json`, + }, + }, + }, + }, + { + OperationID: `deleteTransitGatewayRoute`, + Aliases: nil, + Description: `Deletes a transit gateway route in the default route table associated with Atlas VPC. + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/deleteTransitGatewayRoute. + +For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-streams-deleteTransitGatewayRoute/`, + RequestParameters: shared_api.RequestParameters{ + URL: `/api/atlas/v2/groups/{groupId}/streamsTgwRoutes/{routeId}`, + QueryParameters: []shared_api.Parameter{ + { + Name: `envelope`, + Description: `Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + Short: ``, + Required: false, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `bool`, + }, + }, + }, + URLParameters: []shared_api.Parameter{ + { + Name: `groupId`, + Description: `Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. + + +NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + Aliases: []string{`projectId`}, + }, + { + Name: `routeId`, + Description: `The Object ID that uniquely identifies a transit gateway route.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + }, + }, + Verb: http.MethodDelete, + }, + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewPreviewVersion("unknown"), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -31983,9 +32093,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32063,9 +32173,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `gzip`, @@ -32133,9 +32243,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32213,9 +32323,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-11-13`, + Version: shared_api.NewStableVersion(2024, 11, 13), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32273,9 +32383,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32343,9 +32453,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32413,9 +32523,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32493,9 +32603,69 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ + { + Version: shared_api.NewStableVersion(2024, 5, 30), + RequestContentType: ``, + ResponseContentTypes: []string{ + `json`, + }, + }, + }, + }, + { + OperationID: `getTransitGatewayRoute`, + Aliases: nil, + Description: `Retrieves a transit gateway route in the default route table associated with Atlas VPC. + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getTransitGatewayRoute. + +For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-streams-getTransitGatewayRoute/`, + RequestParameters: shared_api.RequestParameters{ + URL: `/api/atlas/v2/groups/{groupId}/streamsTgwRoutes/{routeId}`, + QueryParameters: []shared_api.Parameter{ + { + Name: `envelope`, + Description: `Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + Short: ``, + Required: false, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `bool`, + }, + }, + }, + URLParameters: []shared_api.Parameter{ + { + Name: `groupId`, + Description: `Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. + + +NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + Aliases: []string{`projectId`}, + }, + { + Name: `routeId`, + Description: `The Object ID that uniquely identifies a transit gateway route.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + }, + }, + Verb: http.MethodGet, + }, + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewPreviewVersion("unknown"), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32583,9 +32753,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32663,9 +32833,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32753,9 +32923,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32833,9 +33003,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32933,9 +33103,79 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ + { + Version: shared_api.NewStableVersion(2024, 5, 30), + RequestContentType: ``, + ResponseContentTypes: []string{ + `json`, + }, + }, + }, + }, + { + OperationID: `listTransitGatewayRoutes`, + Aliases: nil, + Description: `List Transit Gateway routes in the default route table associated with Atlas VPC. + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/listTransitGatewayRoutes. + +For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-streams-listTransitGatewayRoutes/`, + RequestParameters: shared_api.RequestParameters{ + URL: `/api/atlas/v2/groups/{groupId}/streamsTgwRoutes`, + QueryParameters: []shared_api.Parameter{ + { + Name: `envelope`, + Description: `Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + Short: ``, + Required: false, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `bool`, + }, + }, + { + Name: `itemsPerPage`, + Description: `Number of items that the response returns per page.`, + Short: ``, + Required: false, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `int`, + }, + }, + { + Name: `pageNum`, + Description: `Number of the page that displays the current set of the total objects that the response returns.`, + Short: ``, + Required: false, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `int`, + }, + }, + }, + URLParameters: []shared_api.Parameter{ + { + Name: `groupId`, + Description: `Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. + + +NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + Aliases: []string{`projectId`}, + }, + }, + Verb: http.MethodGet, + }, + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewPreviewVersion("unknown"), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -33013,9 +33253,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -33073,9 +33313,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -33153,9 +33393,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -33233,9 +33473,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2025-03-12`, + Version: shared_api.NewStableVersion(2025, 3, 12), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -33313,9 +33553,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2024-05-30`, + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -33393,9 +33633,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -33463,9 +33703,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -33529,9 +33769,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -33598,9 +33838,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -33654,9 +33894,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -33720,9 +33960,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -33786,9 +34026,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -33852,9 +34092,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -33938,9 +34178,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -34028,9 +34268,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -34088,9 +34328,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -34167,9 +34407,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -34233,9 +34473,9 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -34303,9 +34543,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPatch, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -34412,9 +34652,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -34482,9 +34722,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -34552,9 +34792,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -34642,9 +34882,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -34742,9 +34982,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPut, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -34824,9 +35064,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -34877,9 +35117,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodDelete, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -34977,9 +35217,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/internal/api/executor_test.go b/internal/api/executor_test.go index 804a3d79ea..acef1c57fe 100644 --- a/internal/api/executor_test.go +++ b/internal/api/executor_test.go @@ -58,8 +58,8 @@ func TestExecutorHappyPathNoLogging(t *testing.T) { RequestParameters: api.RequestParameters{ URL: "/test/url", }, - Versions: []api.Version{{ - Version: "1991-05-17", + Versions: []api.CommandVersion{{ + Version: api.NewStableVersion(1991, 5, 17), RequestContentType: "json", ResponseContentTypes: []string{"json"}, }}, @@ -67,7 +67,7 @@ func TestExecutorHappyPathNoLogging(t *testing.T) { ContentType: "json", Format: "json", Parameters: nil, - Version: "1991-05-17", + Version: api.NewStableVersion(1991, 5, 17), } response, err := executor.ExecuteCommand(t.Context(), commandRequest) @@ -120,8 +120,8 @@ func TestExecutorHappyPathDebugLogging(t *testing.T) { RequestParameters: api.RequestParameters{ URL: "/test/url", }, - Versions: []api.Version{{ - Version: "1991-05-17", + Versions: []api.CommandVersion{{ + Version: api.NewStableVersion(1991, 5, 17), RequestContentType: "json", ResponseContentTypes: []string{"json"}, }}, @@ -129,7 +129,7 @@ func TestExecutorHappyPathDebugLogging(t *testing.T) { ContentType: "json", Format: "json", Parameters: nil, - Version: "1991-05-17", + Version: api.NewStableVersion(1991, 5, 17), } response, err := executor.ExecuteCommand(t.Context(), commandRequest) diff --git a/internal/api/httprequest.go b/internal/api/httprequest.go index 4bff6f9a4a..a4bb2e5ec9 100644 --- a/internal/api/httprequest.go +++ b/internal/api/httprequest.go @@ -145,19 +145,19 @@ func buildQueryParameters(commandQueryParameters []shared_api.Parameter, paramet } // select a version from a list of versions, throws an error if no match is found. -func selectVersion(versionString string, versions []shared_api.Version) (*shared_api.Version, error) { +func selectVersion(selectedVersion shared_api.Version, versions []shared_api.CommandVersion) (*shared_api.CommandVersion, error) { for _, version := range versions { - if version.Version == versionString { + if version.Version.Equal(selectedVersion) { return &version, nil } } - return nil, fmt.Errorf("version '%s' not found", versionString) + return nil, fmt.Errorf("version '%s' not found", selectedVersion.ToString()) } // generate the accept header using the given format string // try to find the content type in the list of response content types, if not found set the type to json. -func acceptHeader(version *shared_api.Version, requestedContentType string) (string, error) { +func acceptHeader(version *shared_api.CommandVersion, requestedContentType string) (string, error) { contentType := "" supportedTypes := make([]string, 0) @@ -173,12 +173,12 @@ func acceptHeader(version *shared_api.Version, requestedContentType string) (str return "", fmt.Errorf("expected one of the following values: [%s], but got '%s' instead", strings.Join(supportedTypes, ","), requestedContentType) } - return fmt.Sprintf("application/vnd.atlas.%s+%s", version.Version, contentType), nil + return fmt.Sprintf("application/vnd.atlas.%s+%s", version.Version.ToString(), contentType), nil } -func contentType(version *shared_api.Version) *string { +func contentType(version *shared_api.CommandVersion) *string { if version.RequestContentType != "" { - contentType := fmt.Sprintf("application/vnd.atlas.%s+%s", version.Version, version.RequestContentType) + contentType := fmt.Sprintf("application/vnd.atlas.%s+%s", version.Version.ToString(), version.RequestContentType) return &contentType } diff --git a/internal/api/httprequest_test.go b/internal/api/httprequest_test.go index 1afd92125f..314da84b48 100644 --- a/internal/api/httprequest_test.go +++ b/internal/api/httprequest_test.go @@ -212,7 +212,7 @@ func TestConvertToHttpRequest(t *testing.T) { "envelope": {"true"}, "metrics": {"metric1", "metric2"}, }, - Version: "2023-11-15", + Version: shared_api.NewStableVersion(2023, 11, 15), }, shouldFail: false, expectedURL: "https://base_url/api/atlas/v2/groups/abcdef1234/clusters/cluster-01/view-42/metrics/pageviews/collStats/measurements?envelope=true&metrics=metric1&metrics=metric2", @@ -232,7 +232,7 @@ func TestConvertToHttpRequest(t *testing.T) { "groupId": {"0ff00ff00ff0"}, "pretty": {"true"}, }, - Version: "2024-08-05", + Version: shared_api.NewStableVersion(2024, 8, 5), }, shouldFail: false, expectedURL: "http://another_base/api/atlas/v2/groups/0ff00ff00ff0/clusters?pretty=true", @@ -252,7 +252,7 @@ func TestConvertToHttpRequest(t *testing.T) { "groupId": {"0ff00ff00ff0"}, "pretty": {"true"}, }, - Version: "2024-08-05", + Version: shared_api.NewStableVersion(2024, 8, 5), }, shouldFail: true, expectedURL: "http://another_base/api/atlas/v2/groups/0ff00ff00ff0/clusters?pretty=true", @@ -271,7 +271,7 @@ func TestConvertToHttpRequest(t *testing.T) { Parameters: map[string][]string{ "pretty": {"true"}, }, - Version: "2024-08-05", + Version: shared_api.NewStableVersion(2024, 8, 5), }, shouldFail: true, }, @@ -286,7 +286,7 @@ func TestConvertToHttpRequest(t *testing.T) { "groupId": {"0ff00ff00ff0"}, "pretty": {"true"}, }, - Version: "1991-05-17", + Version: shared_api.NewStableVersion(1991, 5, 17), }, shouldFail: true, }, @@ -421,9 +421,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -473,30 +473,30 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, diff --git a/internal/api/interface.go b/internal/api/interface.go index 9d2316f66d..da0ca56fd5 100644 --- a/internal/api/interface.go +++ b/internal/api/interface.go @@ -51,7 +51,7 @@ type CommandRequest struct { ContentType string Format string Parameters map[string][]string - Version string + Version api.Version } type CommandResponse struct { diff --git a/internal/cli/api/api.go b/internal/cli/api/api.go index 374b048e10..a9a09fe003 100644 --- a/internal/cli/api/api.go +++ b/internal/cli/api/api.go @@ -173,8 +173,15 @@ func convertAPIToCobraCommand(command shared_api.Command) (*cobra.Command, error return err } + // Convert the version string into an api version + apiVersion, err := shared_api.ParseVersion(version) + if err != nil { + // This should never happen, the version is already validated in the prerun function + return err + } + // Convert the api command + cobra command into a api command request - commandRequest, err := NewCommandRequestFromCobraCommand(cmd, command, content, format, version) + commandRequest, err := NewCommandRequestFromCobraCommand(cmd, command, content, format, apiVersion) if err != nil { return err } @@ -414,7 +421,7 @@ func defaultAPIVersion(command shared_api.Command) (string, error) { } lastVersion := command.Versions[nVersions-1] - return lastVersion.Version, nil + return lastVersion.Version.ToString(), nil } func remindUserToPinVersion(cmd *cobra.Command) { @@ -433,11 +440,17 @@ func remindUserToPinVersion(cmd *cobra.Command) { } } -func ensureVersionIsSupported(apiCommand shared_api.Command, version *string) { - for _, commandVersion := range apiCommand.Versions { - if commandVersion.Version == *version { - return +func ensureVersionIsSupported(apiCommand shared_api.Command, versionString *string) { + version, err := shared_api.ParseVersion(*versionString) + + // If the version is valid, check if it's supported + if err == nil { + for _, commandVersion := range apiCommand.Versions { + if commandVersion.Version.Equal(version) { + return + } } + return } // if we get here it means that the picked version is not supported @@ -447,8 +460,8 @@ func ensureVersionIsSupported(apiCommand shared_api.Command, version *string) { return } - fmt.Fprintf(os.Stderr, "warning: version '%s' is not supported for this endpoint, using default API version '%s'; consider pinning a version to ensure consisentcy when updating the CLI\n", *version, defaultVersion) - *version = defaultVersion + fmt.Fprintf(os.Stderr, "warning: version '%s' is not supported for this endpoint, using default API version '%s'; consider pinning a version to ensure consisentcy when updating the CLI\n", *versionString, defaultVersion) + *versionString = defaultVersion } func needsFileFlag(apiCommand shared_api.Command) bool { @@ -474,7 +487,7 @@ func addVersionFlag(cmd *cobra.Command, apiCommand shared_api.Command, version * // Create a unique list of all supported versions versions := make(map[string]struct{}, 0) for _, version := range apiCommand.Versions { - versions[version.Version] = struct{}{} + versions[version.Version.ToString()] = struct{}{} } // Convert the keys of the map into a list diff --git a/internal/cli/api/command_request.go b/internal/cli/api/command_request.go index 5b0ebdd25e..1e501ce51d 100644 --- a/internal/cli/api/command_request.go +++ b/internal/cli/api/command_request.go @@ -23,7 +23,7 @@ import ( "github.com/spf13/pflag" ) -func NewCommandRequestFromCobraCommand(cobraCommand *cobra.Command, apiCommand shared_api.Command, content io.Reader, format string, version string) (*api.CommandRequest, error) { +func NewCommandRequestFromCobraCommand(cobraCommand *cobra.Command, apiCommand shared_api.Command, content io.Reader, format string, version shared_api.Version) (*api.CommandRequest, error) { return &api.CommandRequest{ Command: apiCommand, Content: content, diff --git a/tools/cmd/api-generator/commands.go.tmpl b/tools/cmd/api-generator/commands.go.tmpl index 92c752d838..3df43d593a 100644 --- a/tools/cmd/api-generator/commands.go.tmpl +++ b/tools/cmd/api-generator/commands.go.tmpl @@ -70,10 +70,10 @@ var Commands = shared_api.GroupedAndSortedCommands{ }, Verb: {{ .RequestParameters.Verb }}, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ {{- range .Versions }} { - Version: `{{ .Version }}`, + Version: {{ createVersion .Version }}, RequestContentType: `{{ .RequestContentType }}`, ResponseContentTypes: []string{ {{- range .ResponseContentTypes }} @@ -86,7 +86,7 @@ var Commands = shared_api.GroupedAndSortedCommands{ Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `{{ .Watcher.Get.OperationID }}`, - Version: `{{ .Watcher.Get.Version }}`, + Version: {{ createVersion .Watcher.Get.Version }}, Params: map[string]string{ {{- range $k, $v := .Watcher.Get.Params }} `{{ $k }}`: `{{ $v }}`, diff --git a/tools/cmd/api-generator/convert_commands.go b/tools/cmd/api-generator/convert_commands.go index 6b47e305d0..698ad12700 100644 --- a/tools/cmd/api-generator/convert_commands.go +++ b/tools/cmd/api-generator/convert_commands.go @@ -20,7 +20,6 @@ import ( "regexp" "sort" "strconv" - "strings" "time" "github.com/getkin/kin-openapi/openapi3" @@ -29,7 +28,7 @@ import ( ) var ( - versionRegex = regexp.MustCompile(`^application/vnd\.atlas\.(?P\d{4}-\d{2}-\d{2}|preview|upcoming)\+(?P[\w]+)$`) + contentTypeHeaderRegex = regexp.MustCompile(`^application/vnd\.atlas\.(?[^+]+)\+(?P[\w]+)$`) ) func specToCommands(now time.Time, spec *openapi3.T) (api.GroupedAndSortedCommands, error) { @@ -366,8 +365,8 @@ func extractParameters(parameters openapi3.Parameters) (parameterSet, error) { } // Build versions from responses and request body. -func buildVersions(now time.Time, operation *openapi3.Operation) ([]api.Version, error) { - versionsMap := make(map[string]*api.Version) +func buildVersions(now time.Time, operation *openapi3.Operation) ([]api.CommandVersion, error) { + versionsMap := make(map[string]*api.CommandVersion) if err := processResponses(operation.Responses, versionsMap); err != nil { return nil, err @@ -388,7 +387,7 @@ func buildVersions(now time.Time, operation *openapi3.Operation) ([]api.Version, } // Process response content types. -func processResponses(responses *openapi3.Responses, versionsMap map[string]*api.Version) error { +func processResponses(responses *openapi3.Responses, versionsMap map[string]*api.CommandVersion) error { for statusString, responses := range responses.Map() { statusCode, err := strconv.Atoi(statusString) if err != nil { @@ -409,7 +408,7 @@ func processResponses(responses *openapi3.Responses, versionsMap map[string]*api } // Process request body content types. -func processRequestBody(requestBody *openapi3.RequestBodyRef, versionsMap map[string]*api.Version) error { +func processRequestBody(requestBody *openapi3.RequestBodyRef, versionsMap map[string]*api.CommandVersion) error { if requestBody == nil { return nil } @@ -427,18 +426,16 @@ func processRequestBody(requestBody *openapi3.RequestBodyRef, versionsMap map[st } // Helper function to add content type to version map. -func addContentTypeToVersion(versionedContentType string, versionsMap map[string]*api.Version, isRequest bool, sunset *time.Time) error { +func addContentTypeToVersion(versionedContentType string, versionsMap map[string]*api.CommandVersion, isRequest bool, sunset *time.Time) error { version, contentType, err := extractVersionAndContentType(versionedContentType) if err != nil { return fmt.Errorf("unsupported version %q error: %w", versionedContentType, err) } - if shouldIgnoreVersion(version) { - return nil - } + versionString := version.ToString() - if _, ok := versionsMap[version]; !ok { - versionsMap[version] = &api.Version{ + if _, ok := versionsMap[versionString]; !ok { + versionsMap[versionString] = &api.CommandVersion{ Version: version, Sunset: sunset, ResponseContentTypes: []string{}, @@ -446,27 +443,27 @@ func addContentTypeToVersion(versionedContentType string, versionsMap map[string } if sunset != nil { - if versionsMap[version].Sunset == nil || sunset.Before(*versionsMap[version].Sunset) { - versionsMap[version].Sunset = sunset + if versionsMap[versionString].Sunset == nil || sunset.Before(*versionsMap[versionString].Sunset) { + versionsMap[versionString].Sunset = sunset } } if isRequest { - if versionsMap[version].RequestContentType != "" { + if versionsMap[versionString].RequestContentType != "" { return errors.New("multiple request content types is not supported") } - versionsMap[version].RequestContentType = contentType + versionsMap[versionString].RequestContentType = contentType } else { - versionsMap[version].ResponseContentTypes = append(versionsMap[version].ResponseContentTypes, contentType) + versionsMap[versionString].ResponseContentTypes = append(versionsMap[versionString].ResponseContentTypes, contentType) } return nil } // Sort versions and their content types. -func sortVersions(versionsMap map[string]*api.Version) []api.Version { - versions := make([]api.Version, 0) +func sortVersions(versionsMap map[string]*api.CommandVersion) []api.CommandVersion { + versions := make([]api.CommandVersion, 0) for _, version := range versionsMap { sort.Slice(version.ResponseContentTypes, func(i, j int) bool { @@ -477,7 +474,7 @@ func sortVersions(versionsMap map[string]*api.Version) []api.Version { } sort.Slice(versions, func(i, j int) bool { - return versions[i].Version < versions[j].Version + return versions[i].Version.Less(versions[j].Version) }) return versions @@ -501,22 +498,33 @@ func groupForTag(spec *openapi3.T, tag string) (*api.Group, error) { }, nil } -func extractVersionAndContentType(input string) (version string, contentType string, err error) { - matches := versionRegex.FindStringSubmatch(input) - if matches == nil { - return "", "", errors.New("invalid format") +func extractVersionAndContentType(input string) (api.Version, string, error) { + matches := contentTypeHeaderRegex.FindStringSubmatch(input) + if len(matches) == 0 { + return nil, "", fmt.Errorf("invalid content type header: %s", input) } - // Get the named group indices - versionIndex := versionRegex.SubexpIndex("version") - contentTypeIndex := versionRegex.SubexpIndex("contentType") + versionIndex := contentTypeHeaderRegex.SubexpIndex("version") + contentTypeIndex := contentTypeHeaderRegex.SubexpIndex("contentType") - return matches[versionIndex], matches[contentTypeIndex], nil -} + versionString := matches[versionIndex] + contentType := matches[contentTypeIndex] + + if versionString == "" { + return nil, "", errors.New("version is required") + } + + if contentType == "" { + return nil, "", errors.New("content type is required") + } + + version, err := api.ParseVersion(versionString) + + if err != nil { + return nil, "", fmt.Errorf("invalid version: %w", err) + } -func shouldIgnoreVersion(version string) bool { - // Ignore 'preview' versions - return strings.EqualFold(version, "preview") + return version, contentType, nil } func getParameterType(parameter *openapi3.Parameter) (*api.ParameterType, error) { diff --git a/tools/cmd/api-generator/convert_commands_test.go b/tools/cmd/api-generator/convert_commands_test.go index ce8f31aec0..b93c56f42b 100644 --- a/tools/cmd/api-generator/convert_commands_test.go +++ b/tools/cmd/api-generator/convert_commands_test.go @@ -16,42 +16,49 @@ package main import ( "testing" + + "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/shared/api" ) func TestExtractVersionAndContentType(t *testing.T) { tests := []struct { input string - wantVersion string + wantVersion api.Version wantContentType string }{ { "application/vnd.atlas.2025-01-01+json", - "2025-01-01", + api.NewStableVersion(2025, 1, 1), "json", }, { "application/vnd.atlas.2024-08-05+json", - "2024-08-05", + api.NewStableVersion(2024, 8, 5), "json", }, { "application/vnd.atlas.2023-01-01+csv", - "2023-01-01", + api.NewStableVersion(2023, 1, 1), "csv", }, { "application/vnd.atlas.preview+json", - "preview", + api.NewPreviewVersion(api.PreviewTypeUnknown), "json", }, { "application/vnd.atlas.preview+csv", - "preview", + api.NewPreviewVersion(api.PreviewTypeUnknown), "csv", }, { - "application/vnd.atlas.upcoming+csv", - "upcoming", + "application/vnd.atlas.2024-08-05.upcoming+json", + api.NewUpcomingVersion(2024, 8, 5), + "json", + }, + { + "application/vnd.atlas.2023-01-01.upcoming+csv", + api.NewUpcomingVersion(2023, 1, 1), "csv", }, } diff --git a/tools/cmd/api-generator/convert_metadata.go b/tools/cmd/api-generator/convert_metadata.go index 81dd3c536f..df488b4be9 100644 --- a/tools/cmd/api-generator/convert_metadata.go +++ b/tools/cmd/api-generator/convert_metadata.go @@ -153,11 +153,7 @@ func extractRequestBodyExamples(requestBody *openapi3.RequestBodyRef) (map[strin return nil, fmt.Errorf("unsupported version %q error: %w", versionedContentType, err) } - if shouldIgnoreVersion(version) { - continue - } - - results[version] = extractedExamples{ + results[version.ToString()] = extractedExamples{ Example: mediaType.Example, Examples: mediaType.Examples, } @@ -185,7 +181,7 @@ func extractDefaultVersion(operation *openapi3.Operation) (string, error) { if err != nil { return "", fmt.Errorf("unsupported version %q error: %w", mime, err) } - versions = append(versions, version) + versions = append(versions, version.ToString()) } if len(versions) == 0 { diff --git a/tools/cmd/api-generator/main.go b/tools/cmd/api-generator/main.go index 344ebc39a7..e9107f589b 100644 --- a/tools/cmd/api-generator/main.go +++ b/tools/cmd/api-generator/main.go @@ -30,6 +30,7 @@ import ( "github.com/getkin/kin-openapi/openapi3" "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/internal/metadatatypes" + "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/shared/api" "github.com/spf13/cobra" ) @@ -167,6 +168,18 @@ func writeCommands[T any](w io.Writer, templateContent string, data T) error { return strings.ReplaceAll(s, o, n) }, "sortedKeys": sortedKeys, + "createVersion": func(version api.Version) string { + switch v := version.(type) { + case api.PreviewVersion: + return fmt.Sprintf("shared_api.NewPreviewVersion(\"%s\")", v.Type) + case api.UpcomingVersion: + return fmt.Sprintf("shared_api.NewUpcomingVersion(%d, %d, %d)", v.Date.Year, v.Date.Month, v.Date.Day) + case api.StableVersion: + return fmt.Sprintf("shared_api.NewStableVersion(%d, %d, %d)", v.Date.Year, v.Date.Month, v.Date.Day) + } + + panic("unreachable") + }, }).Parse(templateContent) if err != nil { return err diff --git a/tools/cmd/api-generator/testdata/.snapshots/00-spec.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/00-spec.yaml-commands.snapshot index f3ee442165..402efbae6d 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/00-spec.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/00-spec.yaml-commands.snapshot @@ -77,30 +77,30 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -197,23 +197,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/testdata/.snapshots/01-missing-tag.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/01-missing-tag.yaml-commands.snapshot index 2c9fc44944..172d83f727 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/01-missing-tag.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/01-missing-tag.yaml-commands.snapshot @@ -77,30 +77,30 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -197,23 +197,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/testdata/.snapshots/02-multiple-content-types.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/02-multiple-content-types.yaml-commands.snapshot index 79357aae54..20a002eab3 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/02-multiple-content-types.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/02-multiple-content-types.yaml-commands.snapshot @@ -77,30 +77,30 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -197,23 +197,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `csv`, diff --git a/tools/cmd/api-generator/testdata/.snapshots/03-nested-parameter-types.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/03-nested-parameter-types.yaml-commands.snapshot index 9a6ff924e1..13e79d084e 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/03-nested-parameter-types.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/03-nested-parameter-types.yaml-commands.snapshot @@ -147,9 +147,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-11-15`, + Version: shared_api.NewStableVersion(2023, 11, 15), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/testdata/.snapshots/04-spec-with-overrides.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/04-spec-with-overrides.yaml-commands.snapshot index 9ba7d20715..e733007bba 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/04-spec-with-overrides.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/04-spec-with-overrides.yaml-commands.snapshot @@ -74,30 +74,30 @@ For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/c }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/testdata/.snapshots/05-examples.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/05-examples.yaml-commands.snapshot index f3ee442165..402efbae6d 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/05-examples.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/05-examples.yaml-commands.snapshot @@ -77,30 +77,30 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -197,23 +197,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/testdata/.snapshots/06-spec-with-cli-specific-extensions.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/06-spec-with-cli-specific-extensions.yaml-commands.snapshot index 6afc71a152..c906cc9629 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/06-spec-with-cli-specific-extensions.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/06-spec-with-cli-specific-extensions.yaml-commands.snapshot @@ -79,30 +79,30 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/testdata/.snapshots/07-sunset.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/07-sunset.yaml-commands.snapshot index c6aef52389..9575816b3f 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/07-sunset.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/07-sunset.yaml-commands.snapshot @@ -117,23 +117,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/testdata/.snapshots/08-watchers.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/08-watchers.yaml-commands.snapshot index a12deaf421..db32650e7e 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/08-watchers.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/08-watchers.yaml-commands.snapshot @@ -77,30 +77,30 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodPost, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-10-23`, + Version: shared_api.NewStableVersion(2024, 10, 23), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -110,7 +110,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Watcher: &shared_api.WatcherProperties{ Get: shared_api.WatcherGetProperties{ OperationID: `getCluster`, - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), Params: map[string]string{ `clusterName`: `body:$.name`, `groupId`: `input:groupId`, @@ -189,23 +189,23 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Verb: http.MethodGet, }, - Versions: []shared_api.Version{ + Versions: []shared_api.CommandVersion{ { - Version: `2023-01-01`, + Version: shared_api.NewStableVersion(2023, 1, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2023-02-01`, + Version: shared_api.NewStableVersion(2023, 2, 1), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: `2024-08-05`, + Version: shared_api.NewStableVersion(2024, 8, 5), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/watcher.go b/tools/cmd/api-generator/watcher.go index b67c0201b9..9d5d0a49d5 100644 --- a/tools/cmd/api-generator/watcher.go +++ b/tools/cmd/api-generator/watcher.go @@ -88,7 +88,16 @@ func newWatcherGetProperties(ext map[string]any) (*api.WatcherGetProperties, err return nil, ErrWatcherGetPropertiesInvalidOperationID } - version, _ := ext["version"].(string) + versionString, _ := ext["version"].(string) + var version api.Version + if versionString != "" { + parsedVersion, err := api.ParseVersion(versionString) + if err != nil { + return nil, err + } + + version = parsedVersion + } params := make(map[string]string) for key, value := range extractObject(ext, "params") { @@ -258,7 +267,7 @@ func validateWatchersForCommand(allCommands map[string]*api.Group, command api.C // ensure the version exists versionFound := false for _, apiVersion := range getWatcherCommand.Versions { - if apiVersion.Version == watcher.Get.Version { + if apiVersion.Version.Equal(watcher.Get.Version) { versionFound = true } } diff --git a/tools/cmd/api-generator/watcher_test.go b/tools/cmd/api-generator/watcher_test.go index 478754eae3..6219d81d3c 100644 --- a/tools/cmd/api-generator/watcher_test.go +++ b/tools/cmd/api-generator/watcher_test.go @@ -73,7 +73,7 @@ func TestNewWatcherGetProperties(t *testing.T) { }, expectedOutput: &api.WatcherGetProperties{ OperationID: "getCluster", - Version: "1991-05-17", + Version: api.StableVersion{Date: api.VersionDate{Year: 1991, Month: 5, Day: 17}}, Params: map[string]string{}, }, expectedErr: nil, @@ -89,7 +89,45 @@ func TestNewWatcherGetProperties(t *testing.T) { }, expectedOutput: &api.WatcherGetProperties{ OperationID: "getCluster", - Version: "1991-05-17", + Version: api.StableVersion{Date: api.VersionDate{Year: 1991, Month: 5, Day: 17}}, + Params: map[string]string{ + "groupId": "input:groupId", + "clusterName": "body:$.name", + }, + }, + expectedErr: nil, + }, + { + input: map[string]any{ + "operation-id": "getCluster", + "version": "1991-05-17.upcoming", + "params": map[string]any{ + "groupId": "input:groupId", + "clusterName": "body:$.name", + }, + }, + expectedOutput: &api.WatcherGetProperties{ + OperationID: "getCluster", + Version: api.UpcomingVersion{Date: api.VersionDate{Year: 1991, Month: 5, Day: 17}}, + Params: map[string]string{ + "groupId": "input:groupId", + "clusterName": "body:$.name", + }, + }, + expectedErr: nil, + }, + { + input: map[string]any{ + "operation-id": "getCluster", + "version": "preview", + "params": map[string]any{ + "groupId": "input:groupId", + "clusterName": "body:$.name", + }, + }, + expectedOutput: &api.WatcherGetProperties{ + OperationID: "getCluster", + Version: api.PreviewVersion{Type: api.PreviewTypeUnknown}, Params: map[string]string{ "groupId": "input:groupId", "clusterName": "body:$.name", diff --git a/tools/shared/api/api.go b/tools/shared/api/api.go index 1d4e8eeebe..feb1cd9dbc 100644 --- a/tools/shared/api/api.go +++ b/tools/shared/api/api.go @@ -34,7 +34,7 @@ type Command struct { Aliases []string Description string RequestParameters RequestParameters - Versions []Version + Versions []CommandVersion Watcher *WatcherProperties } @@ -45,8 +45,8 @@ type RequestParameters struct { Verb string } -type Version struct { - Version string +type CommandVersion struct { + Version Version Sunset *time.Time RequestContentType string ResponseContentTypes []string @@ -102,7 +102,7 @@ type WatcherProperties struct { type WatcherGetProperties struct { OperationID string - Version string + Version Version Params map[string]string } diff --git a/tools/shared/api/stability_levels.go b/tools/shared/api/stability_levels.go new file mode 100644 index 0000000000..4e72242dd0 --- /dev/null +++ b/tools/shared/api/stability_levels.go @@ -0,0 +1,252 @@ +package api + +import ( + "errors" + "fmt" + "regexp" + "strconv" + "time" +) + +var ( + versionRegex = regexp.MustCompile(`^((?P\d{4})-(?P\d{2})-(?P\d{2})(?P\.upcoming)?|(?Ppreview))$`) +) + +type StabilityLevel string + +const ( + StabilityLevelPreview StabilityLevel = "preview" + StabilityLevelUpcoming StabilityLevel = "upcoming" + StabilityLevelStable StabilityLevel = "stable" +) + +type VersionDate struct { + Year int + Month time.Month + Day int +} + +// Returns true if v(this) is less than other +func (v VersionDate) Less(other *VersionDate) bool { + return v.Year < other.Year || v.Month < other.Month || v.Day < other.Day +} + +// Returns true if v(this) is equal to other +func (v VersionDate) Equal(other *VersionDate) bool { + return v.Year == other.Year && v.Month == other.Month && v.Day == other.Day +} + +type Version interface { + StabilityLevel() StabilityLevel + // Returns true if v(this) is less than other + Less(other Version) bool + Equal(other Version) bool + ToString() string +} + +func ParseVersion(version string) (Version, error) { + matches := versionRegex.FindStringSubmatch(version) + if len(matches) == 0 { + return nil, fmt.Errorf("invalid version: %s", version) + } + + // Get the named group indexes + yearIndex := versionRegex.SubexpIndex("year") + monthIndex := versionRegex.SubexpIndex("month") + dayIndex := versionRegex.SubexpIndex("day") + upcomingIndex := versionRegex.SubexpIndex("upcoming") + previewIndex := versionRegex.SubexpIndex("preview") + + // Get the named group values + year := matches[yearIndex] + month := matches[monthIndex] + day := matches[dayIndex] + upcoming := matches[upcomingIndex] + preview := matches[previewIndex] + + // If the version is a preview, return a PreviewVersion + if preview != "" { + if year != "" || month != "" || day != "" { + return nil, errors.New("preview version cannot have a year, month, or day") + } + + return NewPreviewVersion(PreviewTypeUnknown), nil + } + + // For upcoming and stable versions, year, month, and day are required + if year == "" || month == "" || day == "" { + return nil, errors.New("upcoming and stable versions must have a year, month, and day") + } + + // Convert the year, month, and day to ints + // We know that they're in the correct format (because the regex matched), so we can ignore the error + yearInt, _ := strconv.Atoi(year) + monthInt, _ := strconv.Atoi(month) + dayInt, _ := strconv.Atoi(day) + + // If the version is an upcoming version, return an UpcomingVersion + if upcoming != "" { + return NewUpcomingVersion(yearInt, time.Month(monthInt), dayInt), nil + } + + // If the version is a stable version, return a StableVersion + return NewStableVersion(yearInt, time.Month(monthInt), dayInt), nil +} + +type PreviewVersion struct { + Type PreviewType +} + +func NewPreviewVersion(previewType PreviewType) PreviewVersion { + return PreviewVersion{Type: previewType} +} + +type PreviewType string + +const ( + PreviewTypeUnknown PreviewType = "unknown" + PreviewTypePrivate PreviewType = "private" + PreviewTypePublic PreviewType = "public" +) + +func (PreviewVersion) StabilityLevel() StabilityLevel { + return StabilityLevelPreview +} + +func (PreviewVersion) Less(other Version) bool { + // switch cast other Version to preview/upcoming/stable + switch other.(type) { + case PreviewVersion: + // other preview versions are always equal + return false + case UpcomingVersion: + // upcoming versions are always greater than preview versions + return true + case StableVersion: + // stable versions are always greater than preview versions + return true + } + + panic("unreachable") +} + +func (PreviewVersion) Equal(other Version) bool { + // switch cast other Version to preview/upcoming/stable + switch other.(type) { + case PreviewVersion: + // other preview versions are always equal + return true + case UpcomingVersion: + // upcoming versions are never equal to preview versions + return false + case StableVersion: + // stable versions are never equal to preview versions + return false + } + + panic("unreachable") +} + +func (PreviewVersion) ToString() string { + return "preview" +} + +type UpcomingVersion struct { + Date VersionDate +} + +func NewUpcomingVersion(year int, month time.Month, day int) UpcomingVersion { + return UpcomingVersion{Date: VersionDate{Year: year, Month: month, Day: day}} +} + +func (UpcomingVersion) StabilityLevel() StabilityLevel { + return StabilityLevelUpcoming +} + +func (v UpcomingVersion) Less(other Version) bool { + // switch cast other Version to preview/upcoming/stable + switch o := other.(type) { + case PreviewVersion: + // preview versions are always less than upcoming versions + return true + case UpcomingVersion: + // for other upcoming versions, compare dates + return v.Date.Less(&o.Date) + case StableVersion: + // stable versions are always less than upcoming versions + return true + } + + panic("unreachable") +} + +func (v UpcomingVersion) Equal(other Version) bool { + // switch cast other Version to preview/upcoming/stable + switch o := other.(type) { + case PreviewVersion: + // preview versions are never equal to upcoming versions + return false + case UpcomingVersion: + // for other upcoming versions, compare dates + return v.Date.Equal(&o.Date) + case StableVersion: + // stable versions are never equal to upcoming versions + return false + } + + panic("unreachable") +} + +func (v UpcomingVersion) ToString() string { + return fmt.Sprintf("%04d-%02d-%02d.upcoming", v.Date.Year, v.Date.Month, v.Date.Day) +} + +type StableVersion struct { + Date VersionDate +} + +func NewStableVersion(year int, month time.Month, day int) StableVersion { + return StableVersion{Date: VersionDate{Year: year, Month: month, Day: day}} +} + +func (StableVersion) StabilityLevel() StabilityLevel { + return StabilityLevelStable +} + +func (v StableVersion) Less(other Version) bool { + // switch cast other Version to preview/upcoming/stable + switch o := other.(type) { + case PreviewVersion: + // preview versions are always less than stable versions + return true + case UpcomingVersion: + // upcoming versions are always less than stable versions + return true + case StableVersion: + // for other stable versions, compare dates + return v.Date.Less(&o.Date) + } + + panic("unreachable") +} + +func (v StableVersion) Equal(other Version) bool { + // switch cast other Version to preview/upcoming/stable + switch o := other.(type) { + case PreviewVersion: + // preview versions are never equal to stable versions + return false + case UpcomingVersion: + // upcoming versions are never equal to stable versions + return false + case StableVersion: + // for other stable versions, compare dates + return v.Date.Equal(&o.Date) + } + + panic("unreachable") +} + +func (v StableVersion) ToString() string { + return fmt.Sprintf("%04d-%02d-%02d", v.Date.Year, v.Date.Month, v.Date.Day) +} From 2201deb7cb401cd1dfedd5a4b3a7b3a2f8d89e2c Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Tue, 17 Jun 2025 15:47:41 +0100 Subject: [PATCH 02/14] Improved TestConvertToHttpRequest test to cover preview and upcoming --- internal/api/httprequest_test.go | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/internal/api/httprequest_test.go b/internal/api/httprequest_test.go index 314da84b48..d02936f465 100644 --- a/internal/api/httprequest_test.go +++ b/internal/api/httprequest_test.go @@ -290,6 +290,46 @@ func TestConvertToHttpRequest(t *testing.T) { }, shouldFail: true, }, + { + name: "valid preview post request (createClusterCommand - Preview)", + baseURL: "http://another_base", + request: CommandRequest{ + Command: createClusterCommand, + Content: strings.NewReader(`{"very_pretty_json":true}`), + ContentType: "json", + Parameters: map[string][]string{ + "groupId": {"0ff00ff00ff0"}, + "pretty": {"true"}, + }, + Version: shared_api.NewPreviewVersion(shared_api.PreviewTypeUnknown), + }, + shouldFail: false, + expectedURL: "http://another_base/api/atlas/v2/groups/0ff00ff00ff0/clusters?pretty=true", + expectedHTTPVerb: http.MethodPost, + expectedHTTPAcceptHeader: "application/vnd.atlas.preview+json", + expectedHTTPContentTypeHeader: "application/vnd.atlas.preview+json", + expectedHTTPBody: `{"very_pretty_json":true}`, + }, + { + name: "valid upcoming post request (createClusterCommand - Upcoming)", + baseURL: "http://another_base", + request: CommandRequest{ + Command: createClusterCommand, + Content: strings.NewReader(`{"very_pretty_json":true}`), + ContentType: "json", + Parameters: map[string][]string{ + "groupId": {"0ff00ff00ff0"}, + "pretty": {"true"}, + }, + Version: shared_api.NewUpcomingVersion(2025, 1, 1), + }, + shouldFail: false, + expectedURL: "http://another_base/api/atlas/v2/groups/0ff00ff00ff0/clusters?pretty=true", + expectedHTTPVerb: http.MethodPost, + expectedHTTPAcceptHeader: "application/vnd.atlas.2025-01-01.upcoming+json", + expectedHTTPContentTypeHeader: "application/vnd.atlas.2025-01-01.upcoming+json", + expectedHTTPBody: `{"very_pretty_json":true}`, + }, } for _, tt := range tests { @@ -502,5 +542,19 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you `json`, }, }, + { + Version: shared_api.NewPreviewVersion(shared_api.PreviewTypePublic), + RequestContentType: `json`, + ResponseContentTypes: []string{ + `json`, + }, + }, + { + Version: shared_api.NewUpcomingVersion(2025, 1, 1), + RequestContentType: `json`, + ResponseContentTypes: []string{ + `json`, + }, + }, }, } From 60e3cca108c5931f7662e228ab843a5fd66996f5 Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Wed, 18 Jun 2025 12:25:34 +0100 Subject: [PATCH 03/14] Moved privatepreview to CommandVersion, Added snapshot tests for upcoming and preview --- internal/api/commands.go | 8 +- internal/api/httprequest_test.go | 4 +- tools/cmd/api-generator/commands.go.tmpl | 3 + tools/cmd/api-generator/convert_commands.go | 45 ++++++++- .../api-generator/convert_commands_test.go | 4 +- tools/cmd/api-generator/main.go | 2 +- ...vel-private-preview.yaml-commands.snapshot | 94 +++++++++++++++++++ ...vel-private-preview.yaml-metadata.snapshot | 50 ++++++++++ ...evel-public-preview.yaml-commands.snapshot | 93 ++++++++++++++++++ ...evel-public-preview.yaml-metadata.snapshot | 50 ++++++++++ ...lity-level-upcoming.yaml-commands.snapshot | 93 ++++++++++++++++++ ...lity-level-upcoming.yaml-metadata.snapshot | 50 ++++++++++ .../09-stability-level-private-preview.yaml | 87 +++++++++++++++++ .../10-stability-level-public-preview.yaml | 87 +++++++++++++++++ .../fixtures/11-stability-level-upcoming.yaml | 83 ++++++++++++++++ tools/cmd/api-generator/watcher_test.go | 2 +- tools/shared/api/api.go | 1 + tools/shared/api/stability_levels.go | 15 +-- 18 files changed, 745 insertions(+), 26 deletions(-) create mode 100644 tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-commands.snapshot create mode 100644 tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-metadata.snapshot create mode 100644 tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-commands.snapshot create mode 100644 tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-metadata.snapshot create mode 100644 tools/cmd/api-generator/testdata/.snapshots/11-stability-level-upcoming.yaml-commands.snapshot create mode 100644 tools/cmd/api-generator/testdata/.snapshots/11-stability-level-upcoming.yaml-metadata.snapshot create mode 100644 tools/cmd/api-generator/testdata/fixtures/09-stability-level-private-preview.yaml create mode 100644 tools/cmd/api-generator/testdata/fixtures/10-stability-level-public-preview.yaml create mode 100644 tools/cmd/api-generator/testdata/fixtures/11-stability-level-upcoming.yaml diff --git a/internal/api/commands.go b/internal/api/commands.go index beea29b273..def94e3dcd 100644 --- a/internal/api/commands.go +++ b/internal/api/commands.go @@ -31675,7 +31675,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Versions: []shared_api.CommandVersion{ { - Version: shared_api.NewPreviewVersion("unknown"), + Version: shared_api.NewPreviewVersion(), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, @@ -32035,7 +32035,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Versions: []shared_api.CommandVersion{ { - Version: shared_api.NewPreviewVersion("unknown"), + Version: shared_api.NewPreviewVersion(), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -32665,7 +32665,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Versions: []shared_api.CommandVersion{ { - Version: shared_api.NewPreviewVersion("unknown"), + Version: shared_api.NewPreviewVersion(), RequestContentType: ``, ResponseContentTypes: []string{ `json`, @@ -33175,7 +33175,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, Versions: []shared_api.CommandVersion{ { - Version: shared_api.NewPreviewVersion("unknown"), + Version: shared_api.NewPreviewVersion(), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/internal/api/httprequest_test.go b/internal/api/httprequest_test.go index d02936f465..65dbdd8540 100644 --- a/internal/api/httprequest_test.go +++ b/internal/api/httprequest_test.go @@ -301,7 +301,7 @@ func TestConvertToHttpRequest(t *testing.T) { "groupId": {"0ff00ff00ff0"}, "pretty": {"true"}, }, - Version: shared_api.NewPreviewVersion(shared_api.PreviewTypeUnknown), + Version: shared_api.NewPreviewVersion(), }, shouldFail: false, expectedURL: "http://another_base/api/atlas/v2/groups/0ff00ff00ff0/clusters?pretty=true", @@ -543,7 +543,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, }, { - Version: shared_api.NewPreviewVersion(shared_api.PreviewTypePublic), + Version: shared_api.NewPreviewVersion(), RequestContentType: `json`, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/commands.go.tmpl b/tools/cmd/api-generator/commands.go.tmpl index 3df43d593a..22a4a817d2 100644 --- a/tools/cmd/api-generator/commands.go.tmpl +++ b/tools/cmd/api-generator/commands.go.tmpl @@ -74,6 +74,9 @@ var Commands = shared_api.GroupedAndSortedCommands{ {{- range .Versions }} { Version: {{ createVersion .Version }}, + {{- if .PrivatePreview }} + PrivatePreview: true, + {{- end}} RequestContentType: `{{ .RequestContentType }}`, ResponseContentTypes: []string{ {{- range .ResponseContentTypes }} diff --git a/tools/cmd/api-generator/convert_commands.go b/tools/cmd/api-generator/convert_commands.go index 698ad12700..946302995a 100644 --- a/tools/cmd/api-generator/convert_commands.go +++ b/tools/cmd/api-generator/convert_commands.go @@ -399,7 +399,7 @@ func processResponses(responses *openapi3.Responses, versionsMap map[string]*api } for versionedContentType, mediaType := range responses.Value.Content { - if err := addContentTypeToVersion(versionedContentType, versionsMap, false, extractSunsetDate(mediaType.Extensions)); err != nil { + if err := addContentTypeToVersion(versionedContentType, versionsMap, mediaType.Extensions, false); err != nil { return err } } @@ -418,7 +418,7 @@ func processRequestBody(requestBody *openapi3.RequestBodyRef, versionsMap map[st continue } - if err := addContentTypeToVersion(versionedContentType, versionsMap, true, extractSunsetDate(mediaType.Extensions)); err != nil { + if err := addContentTypeToVersion(versionedContentType, versionsMap, mediaType.Extensions, true); err != nil { return err } } @@ -426,14 +426,19 @@ func processRequestBody(requestBody *openapi3.RequestBodyRef, versionsMap map[st } // Helper function to add content type to version map. -func addContentTypeToVersion(versionedContentType string, versionsMap map[string]*api.CommandVersion, isRequest bool, sunset *time.Time) error { +func addContentTypeToVersion(versionedContentType string, versionsMap map[string]*api.CommandVersion, extensions map[string]any, isRequest bool) error { + // Extract the version and content type from the versioned content type. version, contentType, err := extractVersionAndContentType(versionedContentType) if err != nil { return fmt.Errorf("unsupported version %q error: %w", versionedContentType, err) } - versionString := version.ToString() + // Extract the sunset date and private preview from the extensions. + sunset := extractSunsetDate(extensions) + privatePreview := extractPrivatePreview(extensions) + // Add the version to the versions map if it doesn't exist. + versionString := version.ToString() if _, ok := versionsMap[versionString]; !ok { versionsMap[versionString] = &api.CommandVersion{ Version: version, @@ -442,12 +447,21 @@ func addContentTypeToVersion(versionedContentType string, versionsMap map[string } } + // If the sunset date is set, update the sunset date if it's before the current sunset date. if sunset != nil { if versionsMap[versionString].Sunset == nil || sunset.Before(*versionsMap[versionString].Sunset) { versionsMap[versionString].Sunset = sunset } } + // The default for private preview is false and there can only be one private preview version. + // This makes is safe to set the private preview flag to true if the extension says we're in a private preview. + if privatePreview != nil && *privatePreview { + versionsMap[versionString].PrivatePreview = true + } + + // If the versioned content type is a request, set the request content type. + // If the versioned content type is a response, add the content type to the response content types. if isRequest { if versionsMap[versionString].RequestContentType != "" { return errors.New("multiple request content types is not supported") @@ -461,6 +475,29 @@ func addContentTypeToVersion(versionedContentType string, versionsMap map[string return nil } +// Extract private preview from extensions. +// Example yaml: +// ```yaml +// x-xgen-preview: +// +// name: charts-dashboards +// public: 'false' +// +// ``` +// +// If the extension is present, return a pointer to a bool. +// If the extension is not present, return nil. +func extractPrivatePreview(extensions map[string]any) *bool { + if extensions, ok := extensions["x-xgen-preview"].(map[string]any); ok && extensions != nil { + if public, ok := extensions["public"].(string); ok { + privatePreview := public == "false" + return &privatePreview + } + } + + return nil +} + // Sort versions and their content types. func sortVersions(versionsMap map[string]*api.CommandVersion) []api.CommandVersion { versions := make([]api.CommandVersion, 0) diff --git a/tools/cmd/api-generator/convert_commands_test.go b/tools/cmd/api-generator/convert_commands_test.go index b93c56f42b..ad86cce04c 100644 --- a/tools/cmd/api-generator/convert_commands_test.go +++ b/tools/cmd/api-generator/convert_commands_test.go @@ -43,12 +43,12 @@ func TestExtractVersionAndContentType(t *testing.T) { }, { "application/vnd.atlas.preview+json", - api.NewPreviewVersion(api.PreviewTypeUnknown), + api.NewPreviewVersion(), "json", }, { "application/vnd.atlas.preview+csv", - api.NewPreviewVersion(api.PreviewTypeUnknown), + api.NewPreviewVersion(), "csv", }, { diff --git a/tools/cmd/api-generator/main.go b/tools/cmd/api-generator/main.go index e9107f589b..074b20b5d0 100644 --- a/tools/cmd/api-generator/main.go +++ b/tools/cmd/api-generator/main.go @@ -171,7 +171,7 @@ func writeCommands[T any](w io.Writer, templateContent string, data T) error { "createVersion": func(version api.Version) string { switch v := version.(type) { case api.PreviewVersion: - return fmt.Sprintf("shared_api.NewPreviewVersion(\"%s\")", v.Type) + return "shared_api.NewPreviewVersion()" case api.UpcomingVersion: return fmt.Sprintf("shared_api.NewUpcomingVersion(%d, %d, %d)", v.Date.Year, v.Date.Month, v.Date.Day) case api.StableVersion: diff --git a/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-commands.snapshot new file mode 100644 index 0000000000..48608c5b55 --- /dev/null +++ b/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-commands.snapshot @@ -0,0 +1,94 @@ +// Copyright 2025 MongoDB Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated using `make gen-api-commands`. DO NOT EDIT. +// Don't make any manual changes to this file. + +package api + +import ( + "net/http" + + shared_api "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/shared/api" +) + +var Commands = shared_api.GroupedAndSortedCommands{ + { + Name: `Charts Dashboards`, + Description: `Returns, adds, and edits Charts Dashboard instances. This resource applies only to projects with a Charts tenant, and requires your Project ID.`, + Commands: []shared_api.Command{ + { + OperationID: `exportChartsDashboard`, + Aliases: nil, + Description: `Exports the specified Charts dashboard. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Charts-Dashboards/operation/exportChartsDashboard. + +For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-chartsDashboards-exportChartsDashboard/`, + RequestParameters: shared_api.RequestParameters{ + URL: `/api/atlas/v2/groups/{groupId}/chartsDashboards/{dashboardId}:export`, + QueryParameters: []shared_api.Parameter{ + { + Name: `envelope`, + Description: `Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + Short: ``, + Required: false, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `bool`, + }, + }, + }, + URLParameters: []shared_api.Parameter{ + { + Name: `groupId`, + Description: `Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. + + +NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + }, + { + Name: `dashboardId`, + Description: `ID of the dashboard to export.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + }, + }, + Verb: http.MethodGet, + }, + Versions: []shared_api.CommandVersion{ + { + Version: shared_api.NewPreviewVersion(), + PrivatePreview: true, + RequestContentType: ``, + ResponseContentTypes: []string{ + `json`, + }, + }, + }, + }, + }, + }, +} + diff --git a/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-metadata.snapshot b/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-metadata.snapshot new file mode 100644 index 0000000000..ef703bfb67 --- /dev/null +++ b/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-metadata.snapshot @@ -0,0 +1,50 @@ +// Copyright 2025 MongoDB Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated using `make gen-api-commands`. DO NOT EDIT. +// Don't make any manual changes to this file. + +package main + +import "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/internal/metadatatypes" + +var metadata = metadatatypes.Metadata{ + `exportChartsDashboard`: { + Parameters: map[string]metadatatypes.ParameterMetadata{ + `dashboardId`: { + Usage: `ID of the dashboard to export.`, + }, + `envelope`: { + Usage: `Flag that indicates whether Application wraps the response in an ` + "`" + `envelope` + "`" + ` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + }, + `groupId`: { + Usage: `Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + +**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + }, + }, + Examples: map[string][]metadatatypes.Example{ + `preview`: {{ + Source: `-`, + + Flags: map[string]string{ + `dashboardId`: `[dashboardId]`, + `groupId`: `32b6e34b3d91647abb20e7b8`, + }, + }, + }, + }, + }, +} + diff --git a/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-commands.snapshot new file mode 100644 index 0000000000..a155cd1e67 --- /dev/null +++ b/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-commands.snapshot @@ -0,0 +1,93 @@ +// Copyright 2025 MongoDB Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated using `make gen-api-commands`. DO NOT EDIT. +// Don't make any manual changes to this file. + +package api + +import ( + "net/http" + + shared_api "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/shared/api" +) + +var Commands = shared_api.GroupedAndSortedCommands{ + { + Name: `Charts Dashboards`, + Description: `Returns, adds, and edits Charts Dashboard instances. This resource applies only to projects with a Charts tenant, and requires your Project ID.`, + Commands: []shared_api.Command{ + { + OperationID: `exportChartsDashboard`, + Aliases: nil, + Description: `Exports the specified Charts dashboard. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Charts-Dashboards/operation/exportChartsDashboard. + +For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-chartsDashboards-exportChartsDashboard/`, + RequestParameters: shared_api.RequestParameters{ + URL: `/api/atlas/v2/groups/{groupId}/chartsDashboards/{dashboardId}:export`, + QueryParameters: []shared_api.Parameter{ + { + Name: `envelope`, + Description: `Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + Short: ``, + Required: false, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `bool`, + }, + }, + }, + URLParameters: []shared_api.Parameter{ + { + Name: `groupId`, + Description: `Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. + + +NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + }, + { + Name: `dashboardId`, + Description: `ID of the dashboard to export.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + }, + }, + Verb: http.MethodGet, + }, + Versions: []shared_api.CommandVersion{ + { + Version: shared_api.NewPreviewVersion(), + RequestContentType: ``, + ResponseContentTypes: []string{ + `json`, + }, + }, + }, + }, + }, + }, +} + diff --git a/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-metadata.snapshot b/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-metadata.snapshot new file mode 100644 index 0000000000..ef703bfb67 --- /dev/null +++ b/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-metadata.snapshot @@ -0,0 +1,50 @@ +// Copyright 2025 MongoDB Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated using `make gen-api-commands`. DO NOT EDIT. +// Don't make any manual changes to this file. + +package main + +import "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/internal/metadatatypes" + +var metadata = metadatatypes.Metadata{ + `exportChartsDashboard`: { + Parameters: map[string]metadatatypes.ParameterMetadata{ + `dashboardId`: { + Usage: `ID of the dashboard to export.`, + }, + `envelope`: { + Usage: `Flag that indicates whether Application wraps the response in an ` + "`" + `envelope` + "`" + ` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + }, + `groupId`: { + Usage: `Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + +**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + }, + }, + Examples: map[string][]metadatatypes.Example{ + `preview`: {{ + Source: `-`, + + Flags: map[string]string{ + `dashboardId`: `[dashboardId]`, + `groupId`: `32b6e34b3d91647abb20e7b8`, + }, + }, + }, + }, + }, +} + diff --git a/tools/cmd/api-generator/testdata/.snapshots/11-stability-level-upcoming.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/11-stability-level-upcoming.yaml-commands.snapshot new file mode 100644 index 0000000000..e8cc8b78d8 --- /dev/null +++ b/tools/cmd/api-generator/testdata/.snapshots/11-stability-level-upcoming.yaml-commands.snapshot @@ -0,0 +1,93 @@ +// Copyright 2025 MongoDB Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated using `make gen-api-commands`. DO NOT EDIT. +// Don't make any manual changes to this file. + +package api + +import ( + "net/http" + + shared_api "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/shared/api" +) + +var Commands = shared_api.GroupedAndSortedCommands{ + { + Name: `Charts Dashboards`, + Description: `Returns, adds, and edits Charts Dashboard instances. This resource applies only to projects with a Charts tenant, and requires your Project ID.`, + Commands: []shared_api.Command{ + { + OperationID: `exportChartsDashboard`, + Aliases: nil, + Description: `Exports the specified Charts dashboard. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + +This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Charts-Dashboards/operation/exportChartsDashboard. + +For more information and examples, see: https://www.mongodb.com/docs/atlas/cli/current/command/atlas-api-chartsDashboards-exportChartsDashboard/`, + RequestParameters: shared_api.RequestParameters{ + URL: `/api/atlas/v2/groups/{groupId}/chartsDashboards/{dashboardId}:export`, + QueryParameters: []shared_api.Parameter{ + { + Name: `envelope`, + Description: `Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + Short: ``, + Required: false, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `bool`, + }, + }, + }, + URLParameters: []shared_api.Parameter{ + { + Name: `groupId`, + Description: `Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access. + + +NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + }, + { + Name: `dashboardId`, + Description: `ID of the dashboard to export.`, + Short: ``, + Required: true, + Type: shared_api.ParameterType{ + IsArray: false, + Type: `string`, + }, + }, + }, + Verb: http.MethodGet, + }, + Versions: []shared_api.CommandVersion{ + { + Version: shared_api.NewUpcomingVersion(2025, 1, 1), + RequestContentType: ``, + ResponseContentTypes: []string{ + `json`, + }, + }, + }, + }, + }, + }, +} + diff --git a/tools/cmd/api-generator/testdata/.snapshots/11-stability-level-upcoming.yaml-metadata.snapshot b/tools/cmd/api-generator/testdata/.snapshots/11-stability-level-upcoming.yaml-metadata.snapshot new file mode 100644 index 0000000000..6c8339c9c7 --- /dev/null +++ b/tools/cmd/api-generator/testdata/.snapshots/11-stability-level-upcoming.yaml-metadata.snapshot @@ -0,0 +1,50 @@ +// Copyright 2025 MongoDB Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated using `make gen-api-commands`. DO NOT EDIT. +// Don't make any manual changes to this file. + +package main + +import "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/internal/metadatatypes" + +var metadata = metadatatypes.Metadata{ + `exportChartsDashboard`: { + Parameters: map[string]metadatatypes.ParameterMetadata{ + `dashboardId`: { + Usage: `ID of the dashboard to export.`, + }, + `envelope`: { + Usage: `Flag that indicates whether Application wraps the response in an ` + "`" + `envelope` + "`" + ` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, + }, + `groupId`: { + Usage: `Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + +**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.`, + }, + }, + Examples: map[string][]metadatatypes.Example{ + `2025-01-01.upcoming`: {{ + Source: `-`, + + Flags: map[string]string{ + `dashboardId`: `[dashboardId]`, + `groupId`: `32b6e34b3d91647abb20e7b8`, + }, + }, + }, + }, + }, +} + diff --git a/tools/cmd/api-generator/testdata/fixtures/09-stability-level-private-preview.yaml b/tools/cmd/api-generator/testdata/fixtures/09-stability-level-private-preview.yaml new file mode 100644 index 0000000000..0511589293 --- /dev/null +++ b/tools/cmd/api-generator/testdata/fixtures/09-stability-level-private-preview.yaml @@ -0,0 +1,87 @@ +openapi: 3.0.1 +info: + license: + name: CC BY-NC-SA 3.0 US + url: https://creativecommons.org/licenses/by-nc-sa/3.0/us/ + termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions + title: MongoDB Atlas Administration API + version: '2.0' + x-xgen-sha: 8e91ba6065df0ad2af146ae235e968386798b544 +servers: + - url: https://cloud.mongodb.com +security: + - ServiceAccounts: [] + - DigestAuth: [] +tags: + - description: Returns, adds, and edits Charts Dashboard instances. This resource applies only to projects with a Charts tenant, and requires your Project ID. + name: Charts Dashboards +externalDocs: + description: Back to Atlas Docs + url: https://www.mongodb.com/docs/atlas/ +paths: + /api/atlas/v2/groups/{groupId}/chartsDashboards/{dashboardId}:export: + get: + description: Exports the specified Charts dashboard. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: exportChartsDashboard + parameters: + - $ref: '#/components/parameters/envelope' + - $ref: '#/components/parameters/groupId' + - description: ID of the dashboard to export. + in: path + name: dashboardId + required: true + schema: + type: string + responses: + '200': + content: + application/vnd.atlas.preview+json: + schema: + description: This resource returns an exported Charts dashboard. You can use this response to import to the Charts Dashboard Import endpoint. + type: string + x-xgen-preview: + name: charts-dashboards + public: 'false' + x-xgen-version: preview + description: OK + summary: Export One Charts Dashboard + tags: + - Charts Dashboards + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Charts-Dashboards/operation/exportChartsDashboard + x-xgen-hidden-env: + envs: qa,stage,prod + x-xgen-owner-team: Sydney Cloud Integration +components: + parameters: + envelope: + description: Flag that indicates whether Application wraps the response in an `envelope` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. + in: query + name: envelope + schema: + default: false + type: boolean + groupId: + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + in: path + name: groupId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + securitySchemes: + DigestAuth: + scheme: digest + type: http + ServiceAccounts: + description: Learn more about [Service Accounts](https://www.mongodb.com/docs/atlas/api/service-accounts-overview). + flows: + clientCredentials: + scopes: {} + tokenUrl: https://cloud.mongodb.com/api/oauth/token + type: oauth2 diff --git a/tools/cmd/api-generator/testdata/fixtures/10-stability-level-public-preview.yaml b/tools/cmd/api-generator/testdata/fixtures/10-stability-level-public-preview.yaml new file mode 100644 index 0000000000..399257eaea --- /dev/null +++ b/tools/cmd/api-generator/testdata/fixtures/10-stability-level-public-preview.yaml @@ -0,0 +1,87 @@ +openapi: 3.0.1 +info: + license: + name: CC BY-NC-SA 3.0 US + url: https://creativecommons.org/licenses/by-nc-sa/3.0/us/ + termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions + title: MongoDB Atlas Administration API + version: '2.0' + x-xgen-sha: 8e91ba6065df0ad2af146ae235e968386798b544 +servers: + - url: https://cloud.mongodb.com +security: + - ServiceAccounts: [] + - DigestAuth: [] +tags: + - description: Returns, adds, and edits Charts Dashboard instances. This resource applies only to projects with a Charts tenant, and requires your Project ID. + name: Charts Dashboards +externalDocs: + description: Back to Atlas Docs + url: https://www.mongodb.com/docs/atlas/ +paths: + /api/atlas/v2/groups/{groupId}/chartsDashboards/{dashboardId}:export: + get: + description: Exports the specified Charts dashboard. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: exportChartsDashboard + parameters: + - $ref: '#/components/parameters/envelope' + - $ref: '#/components/parameters/groupId' + - description: ID of the dashboard to export. + in: path + name: dashboardId + required: true + schema: + type: string + responses: + '200': + content: + application/vnd.atlas.preview+json: + schema: + description: This resource returns an exported Charts dashboard. You can use this response to import to the Charts Dashboard Import endpoint. + type: string + x-xgen-preview: + name: charts-dashboards + public: 'true' + x-xgen-version: preview + description: OK + summary: Export One Charts Dashboard + tags: + - Charts Dashboards + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Charts-Dashboards/operation/exportChartsDashboard + x-xgen-hidden-env: + envs: qa,stage,prod + x-xgen-owner-team: Sydney Cloud Integration +components: + parameters: + envelope: + description: Flag that indicates whether Application wraps the response in an `envelope` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. + in: query + name: envelope + schema: + default: false + type: boolean + groupId: + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + in: path + name: groupId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + securitySchemes: + DigestAuth: + scheme: digest + type: http + ServiceAccounts: + description: Learn more about [Service Accounts](https://www.mongodb.com/docs/atlas/api/service-accounts-overview). + flows: + clientCredentials: + scopes: {} + tokenUrl: https://cloud.mongodb.com/api/oauth/token + type: oauth2 diff --git a/tools/cmd/api-generator/testdata/fixtures/11-stability-level-upcoming.yaml b/tools/cmd/api-generator/testdata/fixtures/11-stability-level-upcoming.yaml new file mode 100644 index 0000000000..ff59669c99 --- /dev/null +++ b/tools/cmd/api-generator/testdata/fixtures/11-stability-level-upcoming.yaml @@ -0,0 +1,83 @@ +openapi: 3.0.1 +info: + license: + name: CC BY-NC-SA 3.0 US + url: https://creativecommons.org/licenses/by-nc-sa/3.0/us/ + termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions + title: MongoDB Atlas Administration API + version: '2.0' + x-xgen-sha: 8e91ba6065df0ad2af146ae235e968386798b544 +servers: + - url: https://cloud.mongodb.com +security: + - ServiceAccounts: [] + - DigestAuth: [] +tags: + - description: Returns, adds, and edits Charts Dashboard instances. This resource applies only to projects with a Charts tenant, and requires your Project ID. + name: Charts Dashboards +externalDocs: + description: Back to Atlas Docs + url: https://www.mongodb.com/docs/atlas/ +paths: + /api/atlas/v2/groups/{groupId}/chartsDashboards/{dashboardId}:export: + get: + description: Exports the specified Charts dashboard. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: exportChartsDashboard + parameters: + - $ref: '#/components/parameters/envelope' + - $ref: '#/components/parameters/groupId' + - description: ID of the dashboard to export. + in: path + name: dashboardId + required: true + schema: + type: string + responses: + '200': + content: + application/vnd.atlas.2025-01-01.upcoming+json: + schema: + description: This resource returns an exported Charts dashboard. You can use this response to import to the Charts Dashboard Import endpoint. + type: string + description: OK + summary: Export One Charts Dashboard + tags: + - Charts Dashboards + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Charts-Dashboards/operation/exportChartsDashboard + x-xgen-hidden-env: + envs: qa,stage,prod + x-xgen-owner-team: Sydney Cloud Integration +components: + parameters: + envelope: + description: Flag that indicates whether Application wraps the response in an `envelope` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. + in: query + name: envelope + schema: + default: false + type: boolean + groupId: + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + in: path + name: groupId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + securitySchemes: + DigestAuth: + scheme: digest + type: http + ServiceAccounts: + description: Learn more about [Service Accounts](https://www.mongodb.com/docs/atlas/api/service-accounts-overview). + flows: + clientCredentials: + scopes: {} + tokenUrl: https://cloud.mongodb.com/api/oauth/token + type: oauth2 diff --git a/tools/cmd/api-generator/watcher_test.go b/tools/cmd/api-generator/watcher_test.go index 6219d81d3c..9b1bc9cb3f 100644 --- a/tools/cmd/api-generator/watcher_test.go +++ b/tools/cmd/api-generator/watcher_test.go @@ -127,7 +127,7 @@ func TestNewWatcherGetProperties(t *testing.T) { }, expectedOutput: &api.WatcherGetProperties{ OperationID: "getCluster", - Version: api.PreviewVersion{Type: api.PreviewTypeUnknown}, + Version: api.PreviewVersion{}, Params: map[string]string{ "groupId": "input:groupId", "clusterName": "body:$.name", diff --git a/tools/shared/api/api.go b/tools/shared/api/api.go index feb1cd9dbc..764ebf37d7 100644 --- a/tools/shared/api/api.go +++ b/tools/shared/api/api.go @@ -48,6 +48,7 @@ type RequestParameters struct { type CommandVersion struct { Version Version Sunset *time.Time + PrivatePreview bool RequestContentType string ResponseContentTypes []string } diff --git a/tools/shared/api/stability_levels.go b/tools/shared/api/stability_levels.go index 4e72242dd0..1aa3c8c281 100644 --- a/tools/shared/api/stability_levels.go +++ b/tools/shared/api/stability_levels.go @@ -70,7 +70,7 @@ func ParseVersion(version string) (Version, error) { return nil, errors.New("preview version cannot have a year, month, or day") } - return NewPreviewVersion(PreviewTypeUnknown), nil + return NewPreviewVersion(), nil } // For upcoming and stable versions, year, month, and day are required @@ -94,21 +94,12 @@ func ParseVersion(version string) (Version, error) { } type PreviewVersion struct { - Type PreviewType } -func NewPreviewVersion(previewType PreviewType) PreviewVersion { - return PreviewVersion{Type: previewType} +func NewPreviewVersion() PreviewVersion { + return PreviewVersion{} } -type PreviewType string - -const ( - PreviewTypeUnknown PreviewType = "unknown" - PreviewTypePrivate PreviewType = "private" - PreviewTypePublic PreviewType = "public" -) - func (PreviewVersion) StabilityLevel() StabilityLevel { return StabilityLevelPreview } From e77e74e083a2076a8eaae5ebe07095b58f8e1cd6 Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Wed, 18 Jun 2025 13:17:31 +0100 Subject: [PATCH 04/14] Fixed public preview logic, private by default. Also print warning when executing a preview version --- ...i-atlasSearch-getAtlasSearchDeployment.txt | 2 +- internal/api/commands.go | 4 +- internal/cli/api/api.go | 37 +++++++++++++++++++ tools/cmd/api-generator/commands.go.tmpl | 4 +- tools/cmd/api-generator/convert_commands.go | 21 +++++------ ...vel-private-preview.yaml-commands.snapshot | 1 - ...evel-public-preview.yaml-commands.snapshot | 1 + tools/shared/api/api.go | 2 +- 8 files changed, 54 insertions(+), 18 deletions(-) diff --git a/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt b/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt index cfa3d2648a..6525be7883 100644 --- a/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt +++ b/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt @@ -77,7 +77,7 @@ Options * - --version - string - false - - api version to use when calling the api call [options: "2023-01-01", "2024-05-30", "2025-03-12"], defaults to the latest version or the profiles api_version config value if set This value defaults to "2024-05-30". + - api version to use when calling the api call [options: "2023-01-01", "2024-05-30", "2025-03-12"], defaults to the latest version or the profiles api_version config value if set This value defaults to "2025-03-12". Inherited Options ----------------- diff --git a/internal/api/commands.go b/internal/api/commands.go index def94e3dcd..b6a5d2d84b 100644 --- a/internal/api/commands.go +++ b/internal/api/commands.go @@ -2028,14 +2028,14 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, }, { - Version: shared_api.NewStableVersion(2025, 3, 12), + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: shared_api.NewStableVersion(2024, 5, 30), + Version: shared_api.NewStableVersion(2025, 3, 12), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/internal/cli/api/api.go b/internal/cli/api/api.go index a9a09fe003..d1c49ccd02 100644 --- a/internal/cli/api/api.go +++ b/internal/cli/api/api.go @@ -137,6 +137,9 @@ func convertAPIToCobraCommand(command shared_api.Command) (*cobra.Command, error // This can happen when the profile contains a default version which is not supported for a specific endpoint ensureVersionIsSupported(command, &version) + // Print a warning if the version is a preview version + printPreviewWarning(command, &version) + // Detect if stdout is being piped (atlas api myTag myOperationId > output.json) isPiped, err := IsStdOutPiped() if err != nil { @@ -464,6 +467,40 @@ func ensureVersionIsSupported(apiCommand shared_api.Command, versionString *stri *versionString = defaultVersion } +func printPreviewWarning(apiCommand shared_api.Command, versionString *string) { + version, err := shared_api.ParseVersion(*versionString) + + // If the version is invalid return, this should never happen + if err != nil { + return + } + + // If the version is not a preview version, return + if version.StabilityLevel() != shared_api.StabilityLevelPreview { + return + } + + // Find the version in the command versions + var commandVersion *shared_api.CommandVersion + for _, cv := range apiCommand.Versions { + if cv.Version.Equal(version) { + commandVersion = &cv + break + } + } + + // If the version is not found, return (should also never happen) + if commandVersion == nil { + return + } + + if commandVersion.PublicPreview { + fmt.Fprintf(os.Stderr, "warning: you've selected a public preview version of the endpoint, this version is subject to breaking changes.\n") + } else { + fmt.Fprintf(os.Stderr, "warning: you've selected a private preview version of the endpoint, this version might not be available for your account and is subject to breaking changes.\n") + } +} + func needsFileFlag(apiCommand shared_api.Command) bool { for _, version := range apiCommand.Versions { if version.RequestContentType != "" { diff --git a/tools/cmd/api-generator/commands.go.tmpl b/tools/cmd/api-generator/commands.go.tmpl index 22a4a817d2..aa6470d14d 100644 --- a/tools/cmd/api-generator/commands.go.tmpl +++ b/tools/cmd/api-generator/commands.go.tmpl @@ -74,8 +74,8 @@ var Commands = shared_api.GroupedAndSortedCommands{ {{- range .Versions }} { Version: {{ createVersion .Version }}, - {{- if .PrivatePreview }} - PrivatePreview: true, + {{- if .PublicPreview }} + PublicPreview: true, {{- end}} RequestContentType: `{{ .RequestContentType }}`, ResponseContentTypes: []string{ diff --git a/tools/cmd/api-generator/convert_commands.go b/tools/cmd/api-generator/convert_commands.go index 946302995a..ece33e87a0 100644 --- a/tools/cmd/api-generator/convert_commands.go +++ b/tools/cmd/api-generator/convert_commands.go @@ -435,7 +435,7 @@ func addContentTypeToVersion(versionedContentType string, versionsMap map[string // Extract the sunset date and private preview from the extensions. sunset := extractSunsetDate(extensions) - privatePreview := extractPrivatePreview(extensions) + publicPreview := extractPublicPreview(extensions) // Add the version to the versions map if it doesn't exist. versionString := version.ToString() @@ -454,10 +454,9 @@ func addContentTypeToVersion(versionedContentType string, versionsMap map[string } } - // The default for private preview is false and there can only be one private preview version. - // This makes is safe to set the private preview flag to true if the extension says we're in a private preview. - if privatePreview != nil && *privatePreview { - versionsMap[versionString].PrivatePreview = true + // The default for public preview is false, override it if the extension says we're in a public preview. + if publicPreview != nil && *publicPreview { + versionsMap[versionString].PublicPreview = true } // If the versioned content type is a request, set the request content type. @@ -475,23 +474,23 @@ func addContentTypeToVersion(versionedContentType string, versionsMap map[string return nil } -// Extract private preview from extensions. +// Extract public preview from extensions. // Example yaml: // ```yaml // x-xgen-preview: // // name: charts-dashboards -// public: 'false' +// public: 'true' // // ``` // -// If the extension is present, return a pointer to a bool. +// If the extension is present, return true if the preview is public, false if it's private. // If the extension is not present, return nil. -func extractPrivatePreview(extensions map[string]any) *bool { +func extractPublicPreview(extensions map[string]any) *bool { if extensions, ok := extensions["x-xgen-preview"].(map[string]any); ok && extensions != nil { if public, ok := extensions["public"].(string); ok { - privatePreview := public == "false" - return &privatePreview + publicPreview := public == "true" + return &publicPreview } } diff --git a/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-commands.snapshot index 48608c5b55..a155cd1e67 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-commands.snapshot @@ -80,7 +80,6 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Versions: []shared_api.CommandVersion{ { Version: shared_api.NewPreviewVersion(), - PrivatePreview: true, RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-commands.snapshot b/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-commands.snapshot index a155cd1e67..a828010d3d 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-commands.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/10-stability-level-public-preview.yaml-commands.snapshot @@ -80,6 +80,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you Versions: []shared_api.CommandVersion{ { Version: shared_api.NewPreviewVersion(), + PublicPreview: true, RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/tools/shared/api/api.go b/tools/shared/api/api.go index 764ebf37d7..4fae9962f1 100644 --- a/tools/shared/api/api.go +++ b/tools/shared/api/api.go @@ -48,7 +48,7 @@ type RequestParameters struct { type CommandVersion struct { Version Version Sunset *time.Time - PrivatePreview bool + PublicPreview bool RequestContentType string ResponseContentTypes []string } From 85ff603efb4fab9500f63add2358882921ef855e Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Wed, 18 Jun 2025 14:12:25 +0100 Subject: [PATCH 05/14] Don't create docs for commands with only private preview versions --- ...-api-streams-createTransitGatewayRoute.txt | 93 --------------- ...-api-streams-deleteTransitGatewayRoute.txt | 102 ----------------- ...las-api-streams-getTransitGatewayRoute.txt | 102 ----------------- ...s-api-streams-listTransitGatewayRoutes.txt | 106 ------------------ docs/command/atlas-api-streams.txt | 8 -- tools/cmd/api-generator/convert_metadata.go | 34 +++++- tools/cmd/api-generator/metadata.go.tmpl | 3 + tools/cmd/docs/metadata.go | 4 + tools/cmd/docs/transformations.go | 13 +++ tools/internal/metadatatypes/metadatatypes.go | 5 +- 10 files changed, 55 insertions(+), 415 deletions(-) delete mode 100644 docs/command/atlas-api-streams-createTransitGatewayRoute.txt delete mode 100644 docs/command/atlas-api-streams-deleteTransitGatewayRoute.txt delete mode 100644 docs/command/atlas-api-streams-getTransitGatewayRoute.txt delete mode 100644 docs/command/atlas-api-streams-listTransitGatewayRoutes.txt diff --git a/docs/command/atlas-api-streams-createTransitGatewayRoute.txt b/docs/command/atlas-api-streams-createTransitGatewayRoute.txt deleted file mode 100644 index ecbf32009d..0000000000 --- a/docs/command/atlas-api-streams-createTransitGatewayRoute.txt +++ /dev/null @@ -1,93 +0,0 @@ -.. _atlas-api-streams-createTransitGatewayRoute: - -=========================================== -atlas api streams createTransitGatewayRoute -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -`Public Preview: please provide feedback `_: Creates a route in the default route table associated with Atlas VPC to route all traffic destined for provided CIDR to the provided Transit Gateway. - -Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). -Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link. - - - -This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createTransitGatewayRoute. - -For more information and examples, see the referenced API documentation linked above. - -Syntax ------- - -.. code-block:: - :caption: Command Syntax - - atlas api streams createTransitGatewayRoute [options] - -.. Code end marker, please don't delete this comment - -Options -------- - -.. list-table:: - :header-rows: 1 - :widths: 20 10 10 60 - - * - Name - - Type - - Required - - Description - * - --envelope - - envelope - - false - - Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. - * - --file - - string - - false - - path to your API request file. Leave empty to use standard input instead - you must provide one or the other, but not both. - * - --groupId - - string - - true - - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - * - -h, --help - - - - false - - help for createTransitGatewayRoute - * - -o, --output - - string - - false - - preferred api format, can be ["json", go-template] This value defaults to "json". - * - --outputFile - - string - - false - - file to write the api output to. This flag is required when the output of an endpoint is binary (ex: gzip) and the command is not piped (ex: atlas command > out.zip) - * - --version - - string - - false - - api version to use when calling the api call [options: "preview"], defaults to the latest version or the profiles api_version config value if set This value defaults to "preview". - -Inherited Options ------------------ - -.. list-table:: - :header-rows: 1 - :widths: 20 10 10 60 - - * - Name - - Type - - Required - - Description - * - -P, --profile - - string - - false - - Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. - diff --git a/docs/command/atlas-api-streams-deleteTransitGatewayRoute.txt b/docs/command/atlas-api-streams-deleteTransitGatewayRoute.txt deleted file mode 100644 index a30f9c36ee..0000000000 --- a/docs/command/atlas-api-streams-deleteTransitGatewayRoute.txt +++ /dev/null @@ -1,102 +0,0 @@ -.. _atlas-api-streams-deleteTransitGatewayRoute: - -=========================================== -atlas api streams deleteTransitGatewayRoute -=========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -`Public Preview: please provide feedback `_: Deletes a transit gateway route in the default route table associated with Atlas VPC. - -Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). -Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link. - - - -This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/deleteTransitGatewayRoute. - -For more information and examples, see the referenced API documentation linked above. - -Syntax ------- - -.. code-block:: - :caption: Command Syntax - - atlas api streams deleteTransitGatewayRoute [options] - -.. Code end marker, please don't delete this comment - -Options -------- - -.. list-table:: - :header-rows: 1 - :widths: 20 10 10 60 - - * - Name - - Type - - Required - - Description - * - --envelope - - envelope - - false - - Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. - * - --groupId - - string - - true - - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - * - -h, --help - - - - false - - help for deleteTransitGatewayRoute - * - -o, --output - - string - - false - - preferred api format, can be ["json", go-template] This value defaults to "json". - * - --outputFile - - string - - false - - file to write the api output to. This flag is required when the output of an endpoint is binary (ex: gzip) and the command is not piped (ex: atlas command > out.zip) - * - --routeId - - string - - true - - The Object ID that uniquely identifies a transit gateway route. - * - --version - - string - - false - - api version to use when calling the api call [options: "preview"], defaults to the latest version or the profiles api_version config value if set This value defaults to "preview". - -Inherited Options ------------------ - -.. list-table:: - :header-rows: 1 - :widths: 20 10 10 60 - - * - Name - - Type - - Required - - Description - * - -P, --profile - - string - - false - - Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. - -Examples --------- - -.. code-block:: - - atlas api streams deleteTransitGatewayRoute --version preview --groupId 32b6e34b3d91647abb20e7b8 --routeId 32b6e34b3d91647abb20e7b8 - -.. Code end marker, please don't delete this comment - diff --git a/docs/command/atlas-api-streams-getTransitGatewayRoute.txt b/docs/command/atlas-api-streams-getTransitGatewayRoute.txt deleted file mode 100644 index 639dae66fb..0000000000 --- a/docs/command/atlas-api-streams-getTransitGatewayRoute.txt +++ /dev/null @@ -1,102 +0,0 @@ -.. _atlas-api-streams-getTransitGatewayRoute: - -======================================== -atlas api streams getTransitGatewayRoute -======================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -`Public Preview: please provide feedback `_: Retrieves a transit gateway route in the default route table associated with Atlas VPC. - -Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). -Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link. - - - -This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getTransitGatewayRoute. - -For more information and examples, see the referenced API documentation linked above. - -Syntax ------- - -.. code-block:: - :caption: Command Syntax - - atlas api streams getTransitGatewayRoute [options] - -.. Code end marker, please don't delete this comment - -Options -------- - -.. list-table:: - :header-rows: 1 - :widths: 20 10 10 60 - - * - Name - - Type - - Required - - Description - * - --envelope - - envelope - - false - - Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. - * - --groupId - - string - - true - - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - * - -h, --help - - - - false - - help for getTransitGatewayRoute - * - -o, --output - - string - - false - - preferred api format, can be ["json", go-template] This value defaults to "json". - * - --outputFile - - string - - false - - file to write the api output to. This flag is required when the output of an endpoint is binary (ex: gzip) and the command is not piped (ex: atlas command > out.zip) - * - --routeId - - string - - true - - The Object ID that uniquely identifies a transit gateway route. - * - --version - - string - - false - - api version to use when calling the api call [options: "preview"], defaults to the latest version or the profiles api_version config value if set This value defaults to "preview". - -Inherited Options ------------------ - -.. list-table:: - :header-rows: 1 - :widths: 20 10 10 60 - - * - Name - - Type - - Required - - Description - * - -P, --profile - - string - - false - - Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. - -Examples --------- - -.. code-block:: - - atlas api streams getTransitGatewayRoute --version preview --groupId 32b6e34b3d91647abb20e7b8 --routeId 32b6e34b3d91647abb20e7b8 - -.. Code end marker, please don't delete this comment - diff --git a/docs/command/atlas-api-streams-listTransitGatewayRoutes.txt b/docs/command/atlas-api-streams-listTransitGatewayRoutes.txt deleted file mode 100644 index 1a3d0cb1f9..0000000000 --- a/docs/command/atlas-api-streams-listTransitGatewayRoutes.txt +++ /dev/null @@ -1,106 +0,0 @@ -.. _atlas-api-streams-listTransitGatewayRoutes: - -========================================== -atlas api streams listTransitGatewayRoutes -========================================== - -.. default-domain:: mongodb - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -`Public Preview: please provide feedback `_: List Transit Gateway routes in the default route table associated with Atlas VPC. - -Public Preview: The atlas api sub-command, automatically generated from the MongoDB Atlas Admin API, offers full coverage of the Admin API and is currently in Public Preview (please provide feedback at https://feedback.mongodb.com/forums/930808-atlas-cli). -Admin API capabilities have their own release lifecycle, which you can check via the provided API endpoint documentation link. - - - -This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/listTransitGatewayRoutes. - -For more information and examples, see the referenced API documentation linked above. - -Syntax ------- - -.. code-block:: - :caption: Command Syntax - - atlas api streams listTransitGatewayRoutes [options] - -.. Code end marker, please don't delete this comment - -Options -------- - -.. list-table:: - :header-rows: 1 - :widths: 20 10 10 60 - - * - Name - - Type - - Required - - Description - * - --envelope - - envelope - - false - - Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. - * - --groupId - - string - - true - - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - * - -h, --help - - - - false - - help for listTransitGatewayRoutes - * - --itemsPerPage - - int - - false - - Number of items that the response returns per page. - * - -o, --output - - string - - false - - preferred api format, can be ["json", go-template] This value defaults to "json". - * - --outputFile - - string - - false - - file to write the api output to. This flag is required when the output of an endpoint is binary (ex: gzip) and the command is not piped (ex: atlas command > out.zip) - * - --pageNum - - int - - false - - Number of the page that displays the current set of the total objects that the response returns. - * - --version - - string - - false - - api version to use when calling the api call [options: "preview"], defaults to the latest version or the profiles api_version config value if set This value defaults to "preview". - -Inherited Options ------------------ - -.. list-table:: - :header-rows: 1 - :widths: 20 10 10 60 - - * - Name - - Type - - Required - - Description - * - -P, --profile - - string - - false - - Name of the profile to use from your configuration file. To learn about profiles for the Atlas CLI, see https://dochub.mongodb.org/core/atlas-cli-save-connection-settings. - -Examples --------- - -.. code-block:: - - atlas api streams listTransitGatewayRoutes --version preview --groupId 32b6e34b3d91647abb20e7b8 - -.. Code end marker, please don't delete this comment - diff --git a/docs/command/atlas-api-streams.txt b/docs/command/atlas-api-streams.txt index 6c960a44dc..34375e7407 100644 --- a/docs/command/atlas-api-streams.txt +++ b/docs/command/atlas-api-streams.txt @@ -62,12 +62,10 @@ Related Commands * :ref:`atlas-api-streams-createStreamInstance` - `Public Preview: please provide feedback `_: Creates one stream instance in the specified project. * :ref:`atlas-api-streams-createStreamInstanceWithSampleConnections` - `Public Preview: please provide feedback `_: Creates one stream instance in the specified project with sample connections. * :ref:`atlas-api-streams-createStreamProcessor` - `Public Preview: please provide feedback `_: Create one Stream Processor within the specified stream instance. -* :ref:`atlas-api-streams-createTransitGatewayRoute` - `Public Preview: please provide feedback `_: Creates a route in the default route table associated with Atlas VPC to route all traffic destined for provided CIDR to the provided Transit Gateway. * :ref:`atlas-api-streams-deletePrivateLinkConnection` - `Public Preview: please provide feedback `_: Deletes one Private Link in the specified project. * :ref:`atlas-api-streams-deleteStreamConnection` - `Public Preview: please provide feedback `_: Delete one connection of the specified stream instance. * :ref:`atlas-api-streams-deleteStreamInstance` - `Public Preview: please provide feedback `_: Delete one stream instance in the specified project. * :ref:`atlas-api-streams-deleteStreamProcessor` - `Public Preview: please provide feedback `_: Delete a Stream Processor within the specified stream instance. -* :ref:`atlas-api-streams-deleteTransitGatewayRoute` - `Public Preview: please provide feedback `_: Deletes a transit gateway route in the default route table associated with Atlas VPC. * :ref:`atlas-api-streams-deleteVpcPeeringConnection` - `Public Preview: please provide feedback `_: Deletes an incoming VPC Peering connection. * :ref:`atlas-api-streams-downloadStreamTenantAuditLogs` - `Public Preview: please provide feedback `_: Downloads the audit logs for the specified Atlas Streams Processing instance. * :ref:`atlas-api-streams-getAccountDetails` - `Public Preview: please provide feedback `_: Returns the Account ID, and the VPC ID for the group and region specified. @@ -76,13 +74,11 @@ Related Commands * :ref:`atlas-api-streams-getStreamConnection` - `Public Preview: please provide feedback `_: Returns the details of one stream connection within the specified stream instance. * :ref:`atlas-api-streams-getStreamInstance` - `Public Preview: please provide feedback `_: Returns the details of one stream instance within the specified project. * :ref:`atlas-api-streams-getStreamProcessor` - `Public Preview: please provide feedback `_: Get one Stream Processor within the specified stream instance. -* :ref:`atlas-api-streams-getTransitGatewayRoute` - `Public Preview: please provide feedback `_: Retrieves a transit gateway route in the default route table associated with Atlas VPC. * :ref:`atlas-api-streams-getVpcPeeringConnections` - `Public Preview: please provide feedback `_: Returns a list of incoming VPC Peering Connections. * :ref:`atlas-api-streams-listPrivateLinkConnections` - `Public Preview: please provide feedback `_: Returns all Private Link connections for the specified project. * :ref:`atlas-api-streams-listStreamConnections` - `Public Preview: please provide feedback `_: Returns all connections of the stream instance for the specified project. * :ref:`atlas-api-streams-listStreamInstances` - `Public Preview: please provide feedback `_: Returns all stream instances for the specified project. * :ref:`atlas-api-streams-listStreamProcessors` - `Public Preview: please provide feedback `_: Returns all Stream Processors within the specified stream instance. -* :ref:`atlas-api-streams-listTransitGatewayRoutes` - `Public Preview: please provide feedback `_: List Transit Gateway routes in the default route table associated with Atlas VPC. * :ref:`atlas-api-streams-modifyStreamProcessor` - `Public Preview: please provide feedback `_: Modify one existing Stream Processor within the specified stream instance. * :ref:`atlas-api-streams-rejectVpcPeeringConnection` - `Public Preview: please provide feedback `_: Requests the rejection of an incoming VPC Peering connection. * :ref:`atlas-api-streams-startStreamProcessor` - `Public Preview: please provide feedback `_: Start a Stream Processor within the specified stream instance. @@ -101,12 +97,10 @@ Related Commands createStreamInstance createStreamInstanceWithSampleConnections createStreamProcessor - createTransitGatewayRoute deletePrivateLinkConnection deleteStreamConnection deleteStreamInstance deleteStreamProcessor - deleteTransitGatewayRoute deleteVpcPeeringConnection downloadStreamTenantAuditLogs getAccountDetails @@ -115,13 +109,11 @@ Related Commands getStreamConnection getStreamInstance getStreamProcessor - getTransitGatewayRoute getVpcPeeringConnections listPrivateLinkConnections listStreamConnections listStreamInstances listStreamProcessors - listTransitGatewayRoutes modifyStreamProcessor rejectVpcPeeringConnection startStreamProcessor diff --git a/tools/cmd/api-generator/convert_metadata.go b/tools/cmd/api-generator/convert_metadata.go index df488b4be9..b3f6d7a28a 100644 --- a/tools/cmd/api-generator/convert_metadata.go +++ b/tools/cmd/api-generator/convert_metadata.go @@ -25,6 +25,7 @@ import ( "github.com/getkin/kin-openapi/openapi3" "github.com/mongodb/mongodb-atlas-cli/atlascli/internal/log" "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/internal/metadatatypes" + "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/shared/api" "gopkg.in/yaml.v3" ) @@ -51,6 +52,11 @@ func extractMetadata(operation *openapi3.Operation) (*metadatatypes.OperationMet return nil, nil } + onlyPrivatePreview, err := onlyContainsPrivatePreview(operation) + if err != nil { + return nil, err + } + paramMetadata := extractParameterMetadata(operation.Parameters) requestBodyExamples, err := extractRequestBodyExamples(operation.RequestBody) @@ -66,11 +72,35 @@ func extractMetadata(operation *openapi3.Operation) (*metadatatypes.OperationMet } return &metadatatypes.OperationMetadata{ - Parameters: paramMetadata, - Examples: examples, + OnlyPrivatePreview: onlyPrivatePreview, + Parameters: paramMetadata, + Examples: examples, }, nil } +func onlyContainsPrivatePreview(operation *openapi3.Operation) (bool, error) { + versionsMap := map[string]*api.CommandVersion{} + + if err := processRequestBody(operation.RequestBody, versionsMap); err != nil { + return false, err + } + + if err := processResponses(operation.Responses, versionsMap); err != nil { + return false, err + } + + if len(versionsMap) != 1 { + return false, nil + } + + previewVersion, foundPreview := versionsMap[api.NewPreviewVersion().ToString()] + if !foundPreview { + return false, nil + } + + return !previewVersion.PublicPreview, nil +} + func extractParameterMetadata(parameters openapi3.Parameters) map[string]metadatatypes.ParameterMetadata { result := make(map[string]metadatatypes.ParameterMetadata) diff --git a/tools/cmd/api-generator/metadata.go.tmpl b/tools/cmd/api-generator/metadata.go.tmpl index 15dd89dddc..287ab99729 100644 --- a/tools/cmd/api-generator/metadata.go.tmpl +++ b/tools/cmd/api-generator/metadata.go.tmpl @@ -23,6 +23,9 @@ import "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/internal/metadataty var metadata = metadatatypes.Metadata{ {{- range $operationID := $metadata | sortedKeys }}{{$operationMetadata := index $metadata $operationID}} `{{ $operationID }}`: { + {{- if $operationMetadata.OnlyPrivatePreview}} + OnlyPrivatePreview: true, + {{- end}} Parameters: {{if not $operationMetadata.Parameters}}nil,{{else}}map[string]metadatatypes.ParameterMetadata{ {{- range $paramName := $operationMetadata.Parameters | sortedKeys }}{{$paramMetadata := index $operationMetadata.Parameters $paramName}} `{{ $paramName }}`: { diff --git a/tools/cmd/docs/metadata.go b/tools/cmd/docs/metadata.go index c243243d01..f497d3d453 100644 --- a/tools/cmd/docs/metadata.go +++ b/tools/cmd/docs/metadata.go @@ -1991,6 +1991,7 @@ var metadata = metadatatypes.Metadata{ Examples: nil, }, `createTransitGatewayRoute`: { + OnlyPrivatePreview: true, Parameters: map[string]metadatatypes.ParameterMetadata{ `envelope`: { Usage: `Flag that indicates whether Application wraps the response in an ` + "`" + `envelope` + "`" + ` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, @@ -3761,6 +3762,7 @@ var metadata = metadatatypes.Metadata{ }, }, `deleteTransitGatewayRoute`: { + OnlyPrivatePreview: true, Parameters: map[string]metadatatypes.ParameterMetadata{ `envelope`: { Usage: `Flag that indicates whether Application wraps the response in an ` + "`" + `envelope` + "`" + ` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, @@ -7480,6 +7482,7 @@ var metadata = metadatatypes.Metadata{ }, }, `getTransitGatewayRoute`: { + OnlyPrivatePreview: true, Parameters: map[string]metadatatypes.ParameterMetadata{ `envelope`: { Usage: `Flag that indicates whether Application wraps the response in an ` + "`" + `envelope` + "`" + ` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, @@ -10752,6 +10755,7 @@ var metadata = metadatatypes.Metadata{ }, }, `listTransitGatewayRoutes`: { + OnlyPrivatePreview: true, Parameters: map[string]metadatatypes.ParameterMetadata{ `envelope`: { Usage: `Flag that indicates whether Application wraps the response in an ` + "`" + `envelope` + "`" + ` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.`, diff --git a/tools/cmd/docs/transformations.go b/tools/cmd/docs/transformations.go index 748c07515f..60cb787639 100644 --- a/tools/cmd/docs/transformations.go +++ b/tools/cmd/docs/transformations.go @@ -267,12 +267,25 @@ func updateExamples(cmd *cobra.Command) error { return nil } +func removeCommandsWithOnlyPrivatePreview(cmd *cobra.Command) { + operationID := cmd.Annotations["operationId"] + if operationID == "" { + return + } + + cmdMetadata, ok := metadata[operationID] + if ok && cmdMetadata.OnlyPrivatePreview { + cmd.Parent().RemoveCommand(cmd) + } +} + func applyTransformations(cmd *cobra.Command) error { setDisableAutoGenTag(cmd) removePluginCommands(cmd) addAdditionalLongText(cmd) if isAPICommand(cmd) { + removeCommandsWithOnlyPrivatePreview(cmd) markExperimentalToAPICommands(cmd) updateAPICommandDescription(cmd) if err := updateExamples(cmd); err != nil { diff --git a/tools/internal/metadatatypes/metadatatypes.go b/tools/internal/metadatatypes/metadatatypes.go index 25cc927486..74e4b68778 100644 --- a/tools/internal/metadatatypes/metadatatypes.go +++ b/tools/internal/metadatatypes/metadatatypes.go @@ -17,8 +17,9 @@ package metadatatypes type Metadata map[string]*OperationMetadata // operationId: OperationMetadata type OperationMetadata struct { - Parameters map[string]ParameterMetadata // parameterName: ParameterMetadata - Examples map[string][]Example // version: []Example + OnlyPrivatePreview bool + Parameters map[string]ParameterMetadata // parameterName: ParameterMetadata + Examples map[string][]Example // version: []Example } type ParameterMetadata struct { From a986e33e03664834424988aab3699422bebbd9b5 Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Wed, 18 Jun 2025 17:40:06 +0100 Subject: [PATCH 06/14] Added copyright notice --- tools/shared/api/stability_levels.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/shared/api/stability_levels.go b/tools/shared/api/stability_levels.go index 1aa3c8c281..25a20b11e9 100644 --- a/tools/shared/api/stability_levels.go +++ b/tools/shared/api/stability_levels.go @@ -1,3 +1,17 @@ +// Copyright 2025 MongoDB Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package api import ( From b8410eace03c1aa0c78b3c7cc7dbc2aff7209d5d Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Thu, 19 Jun 2025 11:19:20 +0100 Subject: [PATCH 07/14] Improved version sorting, added more unit tests. Renamed ToString -> String, to match Stringer interface --- ...i-atlasSearch-getAtlasSearchDeployment.txt | 2 +- internal/api/commands.go | 4 +- internal/api/httprequest.go | 6 +-- internal/cli/api/api.go | 4 +- tools/cmd/api-generator/convert_commands.go | 2 +- tools/cmd/api-generator/convert_metadata.go | 6 +-- ...vel-private-preview.yaml-metadata.snapshot | 1 + tools/shared/api/stability_levels.go | 49 +++++++++-------- tools/shared/api/stability_levels_test.go | 53 +++++++++++++++++++ 9 files changed, 90 insertions(+), 37 deletions(-) create mode 100644 tools/shared/api/stability_levels_test.go diff --git a/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt b/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt index 6525be7883..cfa3d2648a 100644 --- a/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt +++ b/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt @@ -77,7 +77,7 @@ Options * - --version - string - false - - api version to use when calling the api call [options: "2023-01-01", "2024-05-30", "2025-03-12"], defaults to the latest version or the profiles api_version config value if set This value defaults to "2025-03-12". + - api version to use when calling the api call [options: "2023-01-01", "2024-05-30", "2025-03-12"], defaults to the latest version or the profiles api_version config value if set This value defaults to "2024-05-30". Inherited Options ----------------- diff --git a/internal/api/commands.go b/internal/api/commands.go index b6a5d2d84b..def94e3dcd 100644 --- a/internal/api/commands.go +++ b/internal/api/commands.go @@ -2028,14 +2028,14 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, }, { - Version: shared_api.NewStableVersion(2024, 5, 30), + Version: shared_api.NewStableVersion(2025, 3, 12), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: shared_api.NewStableVersion(2025, 3, 12), + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, diff --git a/internal/api/httprequest.go b/internal/api/httprequest.go index a4bb2e5ec9..13a3b85cef 100644 --- a/internal/api/httprequest.go +++ b/internal/api/httprequest.go @@ -152,7 +152,7 @@ func selectVersion(selectedVersion shared_api.Version, versions []shared_api.Com } } - return nil, fmt.Errorf("version '%s' not found", selectedVersion.ToString()) + return nil, fmt.Errorf("version '%s' not found", selectedVersion) } // generate the accept header using the given format string @@ -173,12 +173,12 @@ func acceptHeader(version *shared_api.CommandVersion, requestedContentType strin return "", fmt.Errorf("expected one of the following values: [%s], but got '%s' instead", strings.Join(supportedTypes, ","), requestedContentType) } - return fmt.Sprintf("application/vnd.atlas.%s+%s", version.Version.ToString(), contentType), nil + return fmt.Sprintf("application/vnd.atlas.%s+%s", version.Version, contentType), nil } func contentType(version *shared_api.CommandVersion) *string { if version.RequestContentType != "" { - contentType := fmt.Sprintf("application/vnd.atlas.%s+%s", version.Version.ToString(), version.RequestContentType) + contentType := fmt.Sprintf("application/vnd.atlas.%s+%s", version.Version, version.RequestContentType) return &contentType } diff --git a/internal/cli/api/api.go b/internal/cli/api/api.go index d1c49ccd02..7bf46407c4 100644 --- a/internal/cli/api/api.go +++ b/internal/cli/api/api.go @@ -424,7 +424,7 @@ func defaultAPIVersion(command shared_api.Command) (string, error) { } lastVersion := command.Versions[nVersions-1] - return lastVersion.Version.ToString(), nil + return lastVersion.Version.String(), nil } func remindUserToPinVersion(cmd *cobra.Command) { @@ -524,7 +524,7 @@ func addVersionFlag(cmd *cobra.Command, apiCommand shared_api.Command, version * // Create a unique list of all supported versions versions := make(map[string]struct{}, 0) for _, version := range apiCommand.Versions { - versions[version.Version.ToString()] = struct{}{} + versions[version.Version.String()] = struct{}{} } // Convert the keys of the map into a list diff --git a/tools/cmd/api-generator/convert_commands.go b/tools/cmd/api-generator/convert_commands.go index ece33e87a0..f59a9b036a 100644 --- a/tools/cmd/api-generator/convert_commands.go +++ b/tools/cmd/api-generator/convert_commands.go @@ -438,7 +438,7 @@ func addContentTypeToVersion(versionedContentType string, versionsMap map[string publicPreview := extractPublicPreview(extensions) // Add the version to the versions map if it doesn't exist. - versionString := version.ToString() + versionString := version.String() if _, ok := versionsMap[versionString]; !ok { versionsMap[versionString] = &api.CommandVersion{ Version: version, diff --git a/tools/cmd/api-generator/convert_metadata.go b/tools/cmd/api-generator/convert_metadata.go index b3f6d7a28a..ef0d57970a 100644 --- a/tools/cmd/api-generator/convert_metadata.go +++ b/tools/cmd/api-generator/convert_metadata.go @@ -93,7 +93,7 @@ func onlyContainsPrivatePreview(operation *openapi3.Operation) (bool, error) { return false, nil } - previewVersion, foundPreview := versionsMap[api.NewPreviewVersion().ToString()] + previewVersion, foundPreview := versionsMap[api.NewPreviewVersion().String()] if !foundPreview { return false, nil } @@ -183,7 +183,7 @@ func extractRequestBodyExamples(requestBody *openapi3.RequestBodyRef) (map[strin return nil, fmt.Errorf("unsupported version %q error: %w", versionedContentType, err) } - results[version.ToString()] = extractedExamples{ + results[version.String()] = extractedExamples{ Example: mediaType.Example, Examples: mediaType.Examples, } @@ -211,7 +211,7 @@ func extractDefaultVersion(operation *openapi3.Operation) (string, error) { if err != nil { return "", fmt.Errorf("unsupported version %q error: %w", mime, err) } - versions = append(versions, version.ToString()) + versions = append(versions, version.String()) } if len(versions) == 0 { diff --git a/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-metadata.snapshot b/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-metadata.snapshot index ef703bfb67..c26223b0cb 100644 --- a/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-metadata.snapshot +++ b/tools/cmd/api-generator/testdata/.snapshots/09-stability-level-private-preview.yaml-metadata.snapshot @@ -21,6 +21,7 @@ import "github.com/mongodb/mongodb-atlas-cli/atlascli/tools/internal/metadatatyp var metadata = metadatatypes.Metadata{ `exportChartsDashboard`: { + OnlyPrivatePreview: true, Parameters: map[string]metadatatypes.ParameterMetadata{ `dashboardId`: { Usage: `ID of the dashboard to export.`, diff --git a/tools/shared/api/stability_levels.go b/tools/shared/api/stability_levels.go index 25a20b11e9..4301615f65 100644 --- a/tools/shared/api/stability_levels.go +++ b/tools/shared/api/stability_levels.go @@ -55,7 +55,7 @@ type Version interface { // Returns true if v(this) is less than other Less(other Version) bool Equal(other Version) bool - ToString() string + String() string } func ParseVersion(version string) (Version, error) { @@ -118,21 +118,10 @@ func (PreviewVersion) StabilityLevel() StabilityLevel { return StabilityLevelPreview } -func (PreviewVersion) Less(other Version) bool { - // switch cast other Version to preview/upcoming/stable - switch other.(type) { - case PreviewVersion: - // other preview versions are always equal - return false - case UpcomingVersion: - // upcoming versions are always greater than preview versions - return true - case StableVersion: - // stable versions are always greater than preview versions - return true - } - - panic("unreachable") +func (PreviewVersion) Less(_ Version) bool { + // Preview is always last, so it's never less than anything + // When comparing two preview versions, they're equal, so less is also false + return false } func (PreviewVersion) Equal(other Version) bool { @@ -152,7 +141,7 @@ func (PreviewVersion) Equal(other Version) bool { panic("unreachable") } -func (PreviewVersion) ToString() string { +func (PreviewVersion) String() string { return "preview" } @@ -172,14 +161,19 @@ func (v UpcomingVersion) Less(other Version) bool { // switch cast other Version to preview/upcoming/stable switch o := other.(type) { case PreviewVersion: - // preview versions are always less than upcoming versions + // preview versions are always newer (greater) than upcoming versions return true case UpcomingVersion: // for other upcoming versions, compare dates return v.Date.Less(&o.Date) case StableVersion: - // stable versions are always less than upcoming versions - return true + // for stable versions we compare dates + // if the date is the same, then the stable version is always older (less) than upcoming versions + if v.Date.Equal(&o.Date) { + return false + } + + return v.Date.Less(&o.Date) } panic("unreachable") @@ -202,7 +196,7 @@ func (v UpcomingVersion) Equal(other Version) bool { panic("unreachable") } -func (v UpcomingVersion) ToString() string { +func (v UpcomingVersion) String() string { return fmt.Sprintf("%04d-%02d-%02d.upcoming", v.Date.Year, v.Date.Month, v.Date.Day) } @@ -222,11 +216,16 @@ func (v StableVersion) Less(other Version) bool { // switch cast other Version to preview/upcoming/stable switch o := other.(type) { case PreviewVersion: - // preview versions are always less than stable versions + // preview versions are always newer (greater) than stable versions return true case UpcomingVersion: - // upcoming versions are always less than stable versions - return true + // for upcoming versions we compare dates + // if the date is the same, then the upcoming version is always older (less) than stable versions + if v.Date.Equal(&o.Date) { + return true + } + + return v.Date.Less(&o.Date) case StableVersion: // for other stable versions, compare dates return v.Date.Less(&o.Date) @@ -252,6 +251,6 @@ func (v StableVersion) Equal(other Version) bool { panic("unreachable") } -func (v StableVersion) ToString() string { +func (v StableVersion) String() string { return fmt.Sprintf("%04d-%02d-%02d", v.Date.Year, v.Date.Month, v.Date.Day) } diff --git a/tools/shared/api/stability_levels_test.go b/tools/shared/api/stability_levels_test.go new file mode 100644 index 0000000000..2e9d34d33d --- /dev/null +++ b/tools/shared/api/stability_levels_test.go @@ -0,0 +1,53 @@ +package api + +import ( + "sort" + "testing" +) + +func TestStabilityLevelSorting(t *testing.T) { + inputs := []Version{ + NewStableVersion(2025, 1, 1), + NewPreviewVersion(), + NewUpcomingVersion(2025, 1, 1), + NewStableVersion(2024, 1, 1), + NewUpcomingVersion(2024, 1, 1), + NewStableVersion(2024, 2, 1), + NewStableVersion(2024, 2, 3), + NewStableVersion(2024, 2, 3), + NewUpcomingVersion(2024, 2, 1), + } + + // The order of the versions is: + // 2024-01-01 + // 2024-01-01.upcoming + // 2024-02-01 + // 2024-02-01.upcoming + // 2024-02-03 + // 2024-02-03 + // 2025-01-01 + // 2025-01-01.upcoming + // preview + want := []Version{ + NewStableVersion(2024, 1, 1), + NewUpcomingVersion(2024, 1, 1), + NewStableVersion(2024, 2, 1), + NewUpcomingVersion(2024, 2, 1), + NewStableVersion(2024, 2, 3), + NewStableVersion(2024, 2, 3), + NewStableVersion(2025, 1, 1), + NewUpcomingVersion(2025, 1, 1), + NewPreviewVersion(), + } + + sort.Slice(inputs, func(i, j int) bool { + return inputs[i].Less(inputs[j]) + }) + + // Check that the inputs are sorted in the correct order + for i := range inputs { + if !inputs[i].Equal(want[i]) { + t.Errorf("got %s, want %s", inputs[i], want[i]) + } + } +} From f548b636e8ce1dc9bb25dbef0865254179bfa456 Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Thu, 19 Jun 2025 11:26:50 +0100 Subject: [PATCH 08/14] ran make gen-api-commands --- .../atlas-api-atlasSearch-getAtlasSearchDeployment.txt | 2 +- internal/api/commands.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt b/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt index cfa3d2648a..6525be7883 100644 --- a/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt +++ b/docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt @@ -77,7 +77,7 @@ Options * - --version - string - false - - api version to use when calling the api call [options: "2023-01-01", "2024-05-30", "2025-03-12"], defaults to the latest version or the profiles api_version config value if set This value defaults to "2024-05-30". + - api version to use when calling the api call [options: "2023-01-01", "2024-05-30", "2025-03-12"], defaults to the latest version or the profiles api_version config value if set This value defaults to "2025-03-12". Inherited Options ----------------- diff --git a/internal/api/commands.go b/internal/api/commands.go index def94e3dcd..b6a5d2d84b 100644 --- a/internal/api/commands.go +++ b/internal/api/commands.go @@ -2028,14 +2028,14 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you }, }, { - Version: shared_api.NewStableVersion(2025, 3, 12), + Version: shared_api.NewStableVersion(2024, 5, 30), RequestContentType: ``, ResponseContentTypes: []string{ `json`, }, }, { - Version: shared_api.NewStableVersion(2024, 5, 30), + Version: shared_api.NewStableVersion(2025, 3, 12), RequestContentType: ``, ResponseContentTypes: []string{ `json`, From c2f3a20de16dbfbf041953e0fed4d276e11cb025 Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Thu, 19 Jun 2025 11:57:09 +0100 Subject: [PATCH 09/14] Fix version date sorting, implement stringer --- tools/shared/api/stability_levels.go | 20 ++++++++++++++--- tools/shared/api/stability_levels_test.go | 26 +++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/tools/shared/api/stability_levels.go b/tools/shared/api/stability_levels.go index 4301615f65..9ec88957b8 100644 --- a/tools/shared/api/stability_levels.go +++ b/tools/shared/api/stability_levels.go @@ -42,7 +42,16 @@ type VersionDate struct { // Returns true if v(this) is less than other func (v VersionDate) Less(other *VersionDate) bool { - return v.Year < other.Year || v.Month < other.Month || v.Day < other.Day + switch { + case v.Year < other.Year: + return true + case v.Year == other.Year && v.Month < other.Month: + return true + case v.Year == other.Year && v.Month == other.Month && v.Day < other.Day: + return true + default: + return false + } } // Returns true if v(this) is equal to other @@ -50,6 +59,11 @@ func (v VersionDate) Equal(other *VersionDate) bool { return v.Year == other.Year && v.Month == other.Month && v.Day == other.Day } +// Implement Stringer interface +func (v VersionDate) String() string { + return fmt.Sprintf("%04d-%02d-%02d", v.Year, v.Month, v.Day) +} + type Version interface { StabilityLevel() StabilityLevel // Returns true if v(this) is less than other @@ -197,7 +211,7 @@ func (v UpcomingVersion) Equal(other Version) bool { } func (v UpcomingVersion) String() string { - return fmt.Sprintf("%04d-%02d-%02d.upcoming", v.Date.Year, v.Date.Month, v.Date.Day) + return fmt.Sprintf("%s.upcoming", v.Date) } type StableVersion struct { @@ -252,5 +266,5 @@ func (v StableVersion) Equal(other Version) bool { } func (v StableVersion) String() string { - return fmt.Sprintf("%04d-%02d-%02d", v.Date.Year, v.Date.Month, v.Date.Day) + return v.Date.String() } diff --git a/tools/shared/api/stability_levels_test.go b/tools/shared/api/stability_levels_test.go index 2e9d34d33d..ab627cb6a2 100644 --- a/tools/shared/api/stability_levels_test.go +++ b/tools/shared/api/stability_levels_test.go @@ -5,6 +5,32 @@ import ( "testing" ) +func TestVersionDateLess(t *testing.T) { + tests := []struct { + a, b VersionDate + want bool + }{ + // Test year + {VersionDate{2024, 1, 1}, VersionDate{2024, 1, 1}, false}, + {VersionDate{2024, 1, 1}, VersionDate{2025, 1, 1}, true}, + {VersionDate{2024, 1, 1}, VersionDate{2023, 1, 1}, false}, + // Test month + {VersionDate{2024, 1, 1}, VersionDate{2024, 2, 1}, true}, + {VersionDate{2024, 2, 1}, VersionDate{2024, 2, 1}, false}, + {VersionDate{2024, 2, 1}, VersionDate{2024, 1, 1}, false}, + // Test day + {VersionDate{2024, 1, 1}, VersionDate{2024, 1, 2}, true}, + {VersionDate{2024, 1, 2}, VersionDate{2024, 1, 2}, false}, + {VersionDate{2024, 1, 2}, VersionDate{2024, 1, 1}, false}, + } + + for _, test := range tests { + got := test.a.Less(&test.b) + if got != test.want { + t.Errorf("VersionDate.Less(%s, %s) = %t, want %t", test.a, test.b, got, test.want) + } + } +} func TestStabilityLevelSorting(t *testing.T) { inputs := []Version{ NewStableVersion(2025, 1, 1), From a68c3c80894ddee39611f9350b480e59c86d7759 Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Thu, 19 Jun 2025 12:14:56 +0100 Subject: [PATCH 10/14] Ran make addcopy --- tools/shared/api/stability_levels_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/shared/api/stability_levels_test.go b/tools/shared/api/stability_levels_test.go index ab627cb6a2..c82facf69f 100644 --- a/tools/shared/api/stability_levels_test.go +++ b/tools/shared/api/stability_levels_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 MongoDB Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package api import ( From e99332dda485b4c8113b58dc3fb94b21793c6c59 Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Thu, 19 Jun 2025 12:44:14 +0100 Subject: [PATCH 11/14] fixed bug when the CLI is called with an unsupported version --- internal/cli/api/api.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/cli/api/api.go b/internal/cli/api/api.go index 7bf46407c4..fca7fddb5a 100644 --- a/internal/cli/api/api.go +++ b/internal/cli/api/api.go @@ -453,7 +453,6 @@ func ensureVersionIsSupported(apiCommand shared_api.Command, versionString *stri return } } - return } // if we get here it means that the picked version is not supported From ef62972b3cf285f7affdce88c54b21efabae0879 Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Thu, 19 Jun 2025 12:48:59 +0100 Subject: [PATCH 12/14] Added error print for cases where we received an invalid version --- internal/cli/api/api.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/cli/api/api.go b/internal/cli/api/api.go index fca7fddb5a..c93c1300e3 100644 --- a/internal/cli/api/api.go +++ b/internal/cli/api/api.go @@ -459,6 +459,7 @@ func ensureVersionIsSupported(apiCommand shared_api.Command, versionString *stri defaultVersion, err := defaultAPIVersion(apiCommand) // if we fail to get a version (which should never happen), then quit if err != nil { + fmt.Fprintf(os.Stderr, "error in 'ensureVersionIsSupported': received an invalid version '%s'\n", *versionString) return } @@ -471,6 +472,7 @@ func printPreviewWarning(apiCommand shared_api.Command, versionString *string) { // If the version is invalid return, this should never happen if err != nil { + fmt.Fprintf(os.Stderr, "error in 'printPreviewWarning': received an invalid version '%s'\n", *versionString) return } From a0b091e5452be8bec11f33ed9b3c099402689c1d Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Thu, 19 Jun 2025 12:54:18 +0100 Subject: [PATCH 13/14] improve error message --- internal/cli/api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cli/api/api.go b/internal/cli/api/api.go index c93c1300e3..bd46553ec0 100644 --- a/internal/cli/api/api.go +++ b/internal/cli/api/api.go @@ -459,7 +459,7 @@ func ensureVersionIsSupported(apiCommand shared_api.Command, versionString *stri defaultVersion, err := defaultAPIVersion(apiCommand) // if we fail to get a version (which should never happen), then quit if err != nil { - fmt.Fprintf(os.Stderr, "error in 'ensureVersionIsSupported': received an invalid version '%s'\n", *versionString) + fmt.Fprintf(os.Stderr, "error in 'ensureVersionIsSupported': default version has an invalid format '%s'\n", *versionString) return } From e5e4ae885ea7d9a6407e2149c6afd5f7b5cb8eb2 Mon Sep 17 00:00:00 2001 From: Jeroen Vervaeke Date: Thu, 19 Jun 2025 12:59:45 +0100 Subject: [PATCH 14/14] removed 'name' from public preview example --- tools/cmd/api-generator/convert_commands.go | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/cmd/api-generator/convert_commands.go b/tools/cmd/api-generator/convert_commands.go index f59a9b036a..aba223e698 100644 --- a/tools/cmd/api-generator/convert_commands.go +++ b/tools/cmd/api-generator/convert_commands.go @@ -479,7 +479,6 @@ func addContentTypeToVersion(versionedContentType string, versionsMap map[string // ```yaml // x-xgen-preview: // -// name: charts-dashboards // public: 'true' // // ```