From 859c226de41c7236b1a9157b217123869e711d04 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 31 Oct 2024 16:43:00 +0000 Subject: [PATCH] Regenerate client from commit 63c441b2 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 90 --------- api/datadogV2/api_cloud_cost_management.go | 73 ------- api/datadogV2/doc.go | 1 - api/datadogV2/model_aws_related_account.go | 183 ------------------ .../model_aws_related_account_attributes.go | 137 ------------- .../model_aws_related_account_type.go | 64 ------ .../model_aws_related_accounts_response.go | 102 ---------- .../ListAWSRelatedAccounts.go | 29 --- ...ed_AWS_accounts_returns_OK_response.freeze | 1 - ...ated_AWS_accounts_returns_OK_response.yaml | 32 --- .../features/v2/cloud_cost_management.feature | 15 -- tests/scenarios/features/v2/undo.json | 6 - 13 files changed, 4 insertions(+), 737 deletions(-) delete mode 100644 api/datadogV2/model_aws_related_account.go delete mode 100644 api/datadogV2/model_aws_related_account_attributes.go delete mode 100644 api/datadogV2/model_aws_related_account_type.go delete mode 100644 api/datadogV2/model_aws_related_accounts_response.go delete mode 100644 examples/v2/cloud-cost-management/ListAWSRelatedAccounts.go delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Cloud_Cost_Management/Scenario_List_related_AWS_accounts_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Cloud_Cost_Management/Scenario_List_related_AWS_accounts_returns_OK_response.yaml diff --git a/.apigentools-info b/.apigentools-info index 9f26508d2b9..de1ab46cfb8 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 16:03:50.739325", - "spec_repo_commit": "a11da7b5" + "regenerated": "2024-10-31 16:41:34.289382", + "spec_repo_commit": "63c441b2" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 16:03:50.758646", - "spec_repo_commit": "a11da7b5" + "regenerated": "2024-10-31 16:41:34.307754", + "spec_repo_commit": "63c441b2" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 61de273a3d9..7b467d1950e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -976,49 +976,6 @@ components: type: string x-enum-varnames: - API_KEYS - AWSRelatedAccount: - description: AWS related account. - properties: - attributes: - $ref: '#/components/schemas/AWSRelatedAccountAttributes' - id: - description: The AWS account ID. - example: '123456789123' - type: string - type: - $ref: '#/components/schemas/AWSRelatedAccountType' - required: - - id - - type - type: object - AWSRelatedAccountAttributes: - description: Attributes for an AWS related account. - properties: - has_datadog_integration: - description: Whether or not the AWS account has a Datadog integration. - type: boolean - name: - description: The name of the AWS account. - type: string - type: object - AWSRelatedAccountType: - default: aws_account - description: Type of AWS related account. - enum: - - aws_account - example: aws_account - type: string - x-enum-varnames: - - AWS_ACCOUNT - AWSRelatedAccountsResponse: - description: List of AWS related accounts. - properties: - data: - description: An AWS related account. - items: - $ref: '#/components/schemas/AWSRelatedAccount' - type: array - type: object ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -28974,53 +28931,6 @@ paths: operator: OR permissions: - cloud_cost_management_write - /api/v2/cost/aws_related_accounts: - get: - deprecated: true - description: List the AWS accounts in an organization by calling 'organizations:ListAccounts' - from the specified management account. - operationId: ListAWSRelatedAccounts - parameters: - - description: The ID of the management account to filter by. - example: '123456789123' - in: query - name: filter[management_account_id] - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AWSRelatedAccountsResponse' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cloud_cost_management_read - summary: List related AWS accounts - tags: - - Cloud Cost Management - x-permission: - operator: OR - permissions: - - cloud_cost_management_read /api/v2/cost/azure_uc_config: get: description: List the Azure configs. diff --git a/api/datadogV2/api_cloud_cost_management.go b/api/datadogV2/api_cloud_cost_management.go index d3710604f4d..fb49b970539 100644 --- a/api/datadogV2/api_cloud_cost_management.go +++ b/api/datadogV2/api_cloud_cost_management.go @@ -486,79 +486,6 @@ func (a *CloudCostManagementApi) GetCustomCostsFile(ctx _context.Context, fileId return localVarReturnValue, localVarHTTPResponse, nil } -// ListAWSRelatedAccounts List related AWS accounts. -// List the AWS accounts in an organization by calling 'organizations:ListAccounts' from the specified management account. -// -// Deprecated: This API is deprecated. -func (a *CloudCostManagementApi) ListAWSRelatedAccounts(ctx _context.Context, filterManagementAccountId string) (AWSRelatedAccountsResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue AWSRelatedAccountsResponse - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudCostManagementApi.ListAWSRelatedAccounts") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/cost/aws_related_accounts" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarQueryParams.Add("filter[management_account_id]", datadog.ParameterToString(filterManagementAccountId, "")) - localVarHeaderParams["Accept"] = "application/json" - - datadog.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"apiKeyAuth", "DD-API-KEY"}, - [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { - var v APIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - // ListCostAWSCURConfigs List Cloud Cost Management AWS CUR configs. // List the AWS CUR configs. func (a *CloudCostManagementApi) ListCostAWSCURConfigs(ctx _context.Context) (AwsCURConfigsResponse, *_nethttp.Response, error) { diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index b3e70d94f5e..25a26eb6911 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -60,7 +60,6 @@ // - [CloudCostManagementApi.DeleteCustomCostsFile] // - [CloudCostManagementApi.GetCloudCostActivity] // - [CloudCostManagementApi.GetCustomCostsFile] -// - [CloudCostManagementApi.ListAWSRelatedAccounts] // - [CloudCostManagementApi.ListCostAWSCURConfigs] // - [CloudCostManagementApi.ListCostAzureUCConfigs] // - [CloudCostManagementApi.ListCustomCostsFiles] diff --git a/api/datadogV2/model_aws_related_account.go b/api/datadogV2/model_aws_related_account.go deleted file mode 100644 index e8935b45ee2..00000000000 --- a/api/datadogV2/model_aws_related_account.go +++ /dev/null @@ -1,183 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AWSRelatedAccount AWS related account. -type AWSRelatedAccount struct { - // Attributes for an AWS related account. - Attributes *AWSRelatedAccountAttributes `json:"attributes,omitempty"` - // The AWS account ID. - Id string `json:"id"` - // Type of AWS related account. - Type AWSRelatedAccountType `json:"type"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewAWSRelatedAccount instantiates a new AWSRelatedAccount object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewAWSRelatedAccount(id string, typeVar AWSRelatedAccountType) *AWSRelatedAccount { - this := AWSRelatedAccount{} - this.Id = id - this.Type = typeVar - return &this -} - -// NewAWSRelatedAccountWithDefaults instantiates a new AWSRelatedAccount object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewAWSRelatedAccountWithDefaults() *AWSRelatedAccount { - this := AWSRelatedAccount{} - var typeVar AWSRelatedAccountType = AWSRELATEDACCOUNTTYPE_AWS_ACCOUNT - this.Type = typeVar - return &this -} - -// GetAttributes returns the Attributes field value if set, zero value otherwise. -func (o *AWSRelatedAccount) GetAttributes() AWSRelatedAccountAttributes { - if o == nil || o.Attributes == nil { - var ret AWSRelatedAccountAttributes - return ret - } - return *o.Attributes -} - -// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AWSRelatedAccount) GetAttributesOk() (*AWSRelatedAccountAttributes, bool) { - if o == nil || o.Attributes == nil { - return nil, false - } - return o.Attributes, true -} - -// HasAttributes returns a boolean if a field has been set. -func (o *AWSRelatedAccount) HasAttributes() bool { - return o != nil && o.Attributes != nil -} - -// SetAttributes gets a reference to the given AWSRelatedAccountAttributes and assigns it to the Attributes field. -func (o *AWSRelatedAccount) SetAttributes(v AWSRelatedAccountAttributes) { - o.Attributes = &v -} - -// GetId returns the Id field value. -func (o *AWSRelatedAccount) GetId() string { - if o == nil { - var ret string - return ret - } - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *AWSRelatedAccount) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value. -func (o *AWSRelatedAccount) SetId(v string) { - o.Id = v -} - -// GetType returns the Type field value. -func (o *AWSRelatedAccount) GetType() AWSRelatedAccountType { - if o == nil { - var ret AWSRelatedAccountType - return ret - } - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *AWSRelatedAccount) GetTypeOk() (*AWSRelatedAccountType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value. -func (o *AWSRelatedAccount) SetType(v AWSRelatedAccountType) { - o.Type = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o AWSRelatedAccount) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Attributes != nil { - toSerialize["attributes"] = o.Attributes - } - toSerialize["id"] = o.Id - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *AWSRelatedAccount) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Attributes *AWSRelatedAccountAttributes `json:"attributes,omitempty"` - Id *string `json:"id"` - Type *AWSRelatedAccountType `json:"type"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Id == nil { - return fmt.Errorf("required field id missing") - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) - } else { - return err - } - - hasInvalidField := false - if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Attributes = all.Attributes - o.Id = *all.Id - if !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = *all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_aws_related_account_attributes.go b/api/datadogV2/model_aws_related_account_attributes.go deleted file mode 100644 index ca1287085b0..00000000000 --- a/api/datadogV2/model_aws_related_account_attributes.go +++ /dev/null @@ -1,137 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AWSRelatedAccountAttributes Attributes for an AWS related account. -type AWSRelatedAccountAttributes struct { - // Whether or not the AWS account has a Datadog integration. - HasDatadogIntegration *bool `json:"has_datadog_integration,omitempty"` - // The name of the AWS account. - Name *string `json:"name,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewAWSRelatedAccountAttributes instantiates a new AWSRelatedAccountAttributes object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewAWSRelatedAccountAttributes() *AWSRelatedAccountAttributes { - this := AWSRelatedAccountAttributes{} - return &this -} - -// NewAWSRelatedAccountAttributesWithDefaults instantiates a new AWSRelatedAccountAttributes object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewAWSRelatedAccountAttributesWithDefaults() *AWSRelatedAccountAttributes { - this := AWSRelatedAccountAttributes{} - return &this -} - -// GetHasDatadogIntegration returns the HasDatadogIntegration field value if set, zero value otherwise. -func (o *AWSRelatedAccountAttributes) GetHasDatadogIntegration() bool { - if o == nil || o.HasDatadogIntegration == nil { - var ret bool - return ret - } - return *o.HasDatadogIntegration -} - -// GetHasDatadogIntegrationOk returns a tuple with the HasDatadogIntegration field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AWSRelatedAccountAttributes) GetHasDatadogIntegrationOk() (*bool, bool) { - if o == nil || o.HasDatadogIntegration == nil { - return nil, false - } - return o.HasDatadogIntegration, true -} - -// HasHasDatadogIntegration returns a boolean if a field has been set. -func (o *AWSRelatedAccountAttributes) HasHasDatadogIntegration() bool { - return o != nil && o.HasDatadogIntegration != nil -} - -// SetHasDatadogIntegration gets a reference to the given bool and assigns it to the HasDatadogIntegration field. -func (o *AWSRelatedAccountAttributes) SetHasDatadogIntegration(v bool) { - o.HasDatadogIntegration = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *AWSRelatedAccountAttributes) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AWSRelatedAccountAttributes) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *AWSRelatedAccountAttributes) HasName() bool { - return o != nil && o.Name != nil -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *AWSRelatedAccountAttributes) SetName(v string) { - o.Name = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o AWSRelatedAccountAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.HasDatadogIntegration != nil { - toSerialize["has_datadog_integration"] = o.HasDatadogIntegration - } - if o.Name != nil { - toSerialize["name"] = o.Name - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *AWSRelatedAccountAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - HasDatadogIntegration *bool `json:"has_datadog_integration,omitempty"` - Name *string `json:"name,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"has_datadog_integration", "name"}) - } else { - return err - } - o.HasDatadogIntegration = all.HasDatadogIntegration - o.Name = all.Name - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_aws_related_account_type.go b/api/datadogV2/model_aws_related_account_type.go deleted file mode 100644 index 83738dea6fc..00000000000 --- a/api/datadogV2/model_aws_related_account_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AWSRelatedAccountType Type of AWS related account. -type AWSRelatedAccountType string - -// List of AWSRelatedAccountType. -const ( - AWSRELATEDACCOUNTTYPE_AWS_ACCOUNT AWSRelatedAccountType = "aws_account" -) - -var allowedAWSRelatedAccountTypeEnumValues = []AWSRelatedAccountType{ - AWSRELATEDACCOUNTTYPE_AWS_ACCOUNT, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *AWSRelatedAccountType) GetAllowedValues() []AWSRelatedAccountType { - return allowedAWSRelatedAccountTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *AWSRelatedAccountType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = AWSRelatedAccountType(value) - return nil -} - -// NewAWSRelatedAccountTypeFromValue returns a pointer to a valid AWSRelatedAccountType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewAWSRelatedAccountTypeFromValue(v string) (*AWSRelatedAccountType, error) { - ev := AWSRelatedAccountType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for AWSRelatedAccountType: valid values are %v", v, allowedAWSRelatedAccountTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v AWSRelatedAccountType) IsValid() bool { - for _, existing := range allowedAWSRelatedAccountTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to AWSRelatedAccountType value. -func (v AWSRelatedAccountType) Ptr() *AWSRelatedAccountType { - return &v -} diff --git a/api/datadogV2/model_aws_related_accounts_response.go b/api/datadogV2/model_aws_related_accounts_response.go deleted file mode 100644 index a3b0de5e23f..00000000000 --- a/api/datadogV2/model_aws_related_accounts_response.go +++ /dev/null @@ -1,102 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AWSRelatedAccountsResponse List of AWS related accounts. -type AWSRelatedAccountsResponse struct { - // An AWS related account. - Data []AWSRelatedAccount `json:"data,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewAWSRelatedAccountsResponse instantiates a new AWSRelatedAccountsResponse object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewAWSRelatedAccountsResponse() *AWSRelatedAccountsResponse { - this := AWSRelatedAccountsResponse{} - return &this -} - -// NewAWSRelatedAccountsResponseWithDefaults instantiates a new AWSRelatedAccountsResponse object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewAWSRelatedAccountsResponseWithDefaults() *AWSRelatedAccountsResponse { - this := AWSRelatedAccountsResponse{} - return &this -} - -// GetData returns the Data field value if set, zero value otherwise. -func (o *AWSRelatedAccountsResponse) GetData() []AWSRelatedAccount { - if o == nil || o.Data == nil { - var ret []AWSRelatedAccount - return ret - } - return o.Data -} - -// GetDataOk returns a tuple with the Data field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AWSRelatedAccountsResponse) GetDataOk() (*[]AWSRelatedAccount, bool) { - if o == nil || o.Data == nil { - return nil, false - } - return &o.Data, true -} - -// HasData returns a boolean if a field has been set. -func (o *AWSRelatedAccountsResponse) HasData() bool { - return o != nil && o.Data != nil -} - -// SetData gets a reference to the given []AWSRelatedAccount and assigns it to the Data field. -func (o *AWSRelatedAccountsResponse) SetData(v []AWSRelatedAccount) { - o.Data = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o AWSRelatedAccountsResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Data != nil { - toSerialize["data"] = o.Data - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *AWSRelatedAccountsResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data []AWSRelatedAccount `json:"data,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data"}) - } else { - return err - } - o.Data = all.Data - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.go b/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.go deleted file mode 100644 index fd918b2d002..00000000000 --- a/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.go +++ /dev/null @@ -1,29 +0,0 @@ -// List related AWS accounts returns "OK" response - -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" -) - -func main() { - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewCloudCostManagementApi(apiClient) - resp, r, err := api.ListAWSRelatedAccounts(ctx, "123456789123") - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListAWSRelatedAccounts`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListAWSRelatedAccounts`:\n%s\n", responseContent) -} diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cloud_Cost_Management/Scenario_List_related_AWS_accounts_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cloud_Cost_Management/Scenario_List_related_AWS_accounts_returns_OK_response.freeze deleted file mode 100644 index fc911e03b7a..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cloud_Cost_Management/Scenario_List_related_AWS_accounts_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2023-12-12T14:56:29.893Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cloud_Cost_Management/Scenario_List_related_AWS_accounts_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cloud_Cost_Management/Scenario_List_related_AWS_accounts_returns_OK_response.yaml deleted file mode 100644 index 27445b9ffb9..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Cloud_Cost_Management/Scenario_List_related_AWS_accounts_returns_OK_response.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: GET - url: https://api.datadoghq.com/api/v2/cost/aws_related_accounts?filter%5Bmanagement_account_id%5D=123456789123 - response: - body: '{"data": [{"type": "aws_account", "id": "000000000000", "attributes": {"name": - "test_name", "has_datadog_integration": false}}, {"type": "aws_account", "id": - "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": - true}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": - "test_name", "has_datadog_integration": false}}, {"type": "aws_account", "id": - "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": - false}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": - "test_name", "has_datadog_integration": true}}, {"type": "aws_account", "id": - "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": - false}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": - "test_name", "has_datadog_integration": false}}, {"type": "aws_account", "id": - "000000000000", "attributes": {"name": "test_name", "has_datadog_integration": - true}}, {"type": "aws_account", "id": "000000000000", "attributes": {"name": - "test_name", "has_datadog_integration": false}}]}' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/json - status: 200 OK -version: 2 diff --git a/tests/scenarios/features/v2/cloud_cost_management.feature b/tests/scenarios/features/v2/cloud_cost_management.feature index 7794b249d33..2b87e8fe98d 100644 --- a/tests/scenarios/features/v2/cloud_cost_management.feature +++ b/tests/scenarios/features/v2/cloud_cost_management.feature @@ -148,21 +148,6 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK - @generated @skip @team:Datadog/cloud-cost-management - Scenario: List related AWS accounts returns "Bad Request" response - Given new "ListAWSRelatedAccounts" request - And request contains "filter[management_account_id]" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @replay-only @team:Datadog/cloud-cost-management - Scenario: List related AWS accounts returns "OK" response - Given new "ListAWSRelatedAccounts" request - And request contains "filter[management_account_id]" parameter with value "123456789123" - When the request is sent - Then the response status is 200 OK - And the response "data[0].attributes.name" is equal to "test_name" - @replay-only @team:Datadog/cloud-cost-management Scenario: Update Cloud Cost Management AWS CUR config returns "OK" response Given new "UpdateCostAWSCURConfig" request diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 0e2af9556a5..81c6a29e22c 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -414,12 +414,6 @@ "type": "idempotent" } }, - "ListAWSRelatedAccounts": { - "tag": "Cloud Cost Management", - "undo": { - "type": "safe" - } - }, "ListCostAzureUCConfigs": { "tag": "Cloud Cost Management", "undo": {