Skip to content

Commit 7e47a7a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update documentation with account filtering info for aws_cur_config endpoints (#2251)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 2ab8736 commit 7e47a7a

File tree

9 files changed

+205
-31
lines changed

9 files changed

+205
-31
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-02-20 13:35:00.547017",
8-
"spec_repo_commit": "c64543d0"
7+
"regenerated": "2025-02-20 18:33:33.220649",
8+
"spec_repo_commit": "d3fcdb89"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-20 13:35:00.565048",
13-
"spec_repo_commit": "c64543d0"
12+
"regenerated": "2025-02-20 18:33:33.236028",
13+
"spec_repo_commit": "d3fcdb89"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,33 @@ components:
17151715
xray_services:
17161716
$ref: '#/components/schemas/XRayServicesList'
17171717
type: object
1718+
AccountFilteringConfig:
1719+
description: The account filtering configuration.
1720+
properties:
1721+
excluded_accounts:
1722+
description: The AWS account IDs to be excluded from your billing dataset.
1723+
This field is used when `include_new_accounts` is `true`.
1724+
example:
1725+
- '123456789123'
1726+
- '123456789143'
1727+
items:
1728+
type: string
1729+
type: array
1730+
include_new_accounts:
1731+
description: Whether or not to automatically include new member accounts
1732+
by default in your billing dataset.
1733+
example: true
1734+
type: boolean
1735+
included_accounts:
1736+
description: The AWS account IDs to be included in your billing dataset.
1737+
This field is used when `include_new_accounts` is `false`.
1738+
example:
1739+
- '123456789123'
1740+
- '123456789143'
1741+
items:
1742+
type: string
1743+
type: array
1744+
type: object
17181745
ActionConnectionAttributes:
17191746
description: The definition of `ActionConnectionAttributes` object.
17201747
properties:
@@ -2870,6 +2897,8 @@ components:
28702897
AwsCURConfigAttributes:
28712898
description: Attributes for An AWS CUR config.
28722899
properties:
2900+
account_filters:
2901+
$ref: '#/components/schemas/AccountFilteringConfig'
28732902
account_id:
28742903
description: The AWS account ID.
28752904
example: '123456789123'
@@ -2947,12 +2976,12 @@ components:
29472976
AwsCURConfigPatchRequestAttributes:
29482977
description: Attributes for AWS CUR config Patch Request.
29492978
properties:
2979+
account_filters:
2980+
$ref: '#/components/schemas/AccountFilteringConfig'
29502981
is_enabled:
29512982
description: Whether or not the Cloud Cost Management account is enabled.
29522983
example: true
29532984
type: boolean
2954-
required:
2955-
- is_enabled
29562985
type: object
29572986
AwsCURConfigPatchRequestType:
29582987
default: aws_cur_config_patch_request
@@ -2985,6 +3014,8 @@ components:
29853014
AwsCURConfigPostRequestAttributes:
29863015
description: Attributes for AWS CUR config Post Request.
29873016
properties:
3017+
account_filters:
3018+
$ref: '#/components/schemas/AccountFilteringConfig'
29883019
account_id:
29893020
description: The AWS account ID.
29903021
example: '123456789123'
@@ -35630,7 +35661,8 @@ paths:
3563035661
permissions:
3563135662
- cloud_cost_management_write
3563235663
patch:
35633-
description: Update the status of an AWS CUR config (active/archived).
35664+
description: Update the status (active/archived) and/or account filtering configuration
35665+
of an AWS CUR config.
3563435666
operationId: UpdateCostAWSCURConfig
3563535667
parameters:
3563635668
- $ref: '#/components/parameters/CloudAccountID'

features/v2/cloud_cost_management.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Feature: Cloud Cost Management
1616
@generated @skip @team:Datadog/cloud-cost-management
1717
Scenario: Create Cloud Cost Management AWS CUR config returns "Bad Request" response
1818
Given new "CreateCostAWSCURConfig" request
19-
And body with value {"data": {"attributes": {"account_id": "123456789123", "bucket_name": "dd-cost-bucket", "bucket_region": "us-east-1", "report_name": "dd-report-name", "report_prefix": "dd-report-prefix"}, "type": "aws_cur_config_post_request"}}
19+
And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}, "account_id": "123456789123", "bucket_name": "dd-cost-bucket", "bucket_region": "us-east-1", "report_name": "dd-report-name", "report_prefix": "dd-report-prefix"}, "type": "aws_cur_config_post_request"}}
2020
When the request is sent
2121
Then the response status is 400 Bad Request
2222

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ def overrides
916916
"v1.widget_vertical_align" => "WidgetVerticalAlign",
917917
"v1.widget_view_mode" => "WidgetViewMode",
918918
"v1.widget_viz_type" => "WidgetVizType",
919+
"v2.account_filtering_config" => "AccountFilteringConfig",
919920
"v2.action_connection_attributes" => "ActionConnectionAttributes",
920921
"v2.action_connection_attributes_update" => "ActionConnectionAttributesUpdate",
921922
"v2.action_connection_data" => "ActionConnectionData",

lib/datadog_api_client/v2/api/cloud_cost_management_api.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def update_cost_awscur_config(cloud_account_id, body, opts = {})
607607

608608
# Update Cloud Cost Management AWS CUR config.
609609
#
610-
# Update the status of an AWS CUR config (active/archived).
610+
# Update the status (active/archived) and/or account filtering configuration of an AWS CUR config.
611611
#
612612
# @param cloud_account_id [String] Cloud Account id.
613613
# @param body [AwsCURConfigPatchRequest]
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# The account filtering configuration.
21+
class AccountFilteringConfig
22+
include BaseGenericModel
23+
24+
# The AWS account IDs to be excluded from your billing dataset. This field is used when `include_new_accounts` is `true`.
25+
attr_accessor :excluded_accounts
26+
27+
# Whether or not to automatically include new member accounts by default in your billing dataset.
28+
attr_accessor :include_new_accounts
29+
30+
# The AWS account IDs to be included in your billing dataset. This field is used when `include_new_accounts` is `false`.
31+
attr_accessor :included_accounts
32+
33+
attr_accessor :additional_properties
34+
35+
# Attribute mapping from ruby-style variable name to JSON key.
36+
# @!visibility private
37+
def self.attribute_map
38+
{
39+
:'excluded_accounts' => :'excluded_accounts',
40+
:'include_new_accounts' => :'include_new_accounts',
41+
:'included_accounts' => :'included_accounts'
42+
}
43+
end
44+
45+
# Attribute type mapping.
46+
# @!visibility private
47+
def self.openapi_types
48+
{
49+
:'excluded_accounts' => :'Array<String>',
50+
:'include_new_accounts' => :'Boolean',
51+
:'included_accounts' => :'Array<String>'
52+
}
53+
end
54+
55+
# Initializes the object
56+
# @param attributes [Hash] Model attributes in the form of hash
57+
# @!visibility private
58+
def initialize(attributes = {})
59+
if (!attributes.is_a?(Hash))
60+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AccountFilteringConfig` initialize method"
61+
end
62+
63+
self.additional_properties = {}
64+
# check to see if the attribute exists and convert string to symbol for hash key
65+
attributes = attributes.each_with_object({}) { |(k, v), h|
66+
if (!self.class.attribute_map.key?(k.to_sym))
67+
self.additional_properties[k.to_sym] = v
68+
else
69+
h[k.to_sym] = v
70+
end
71+
}
72+
73+
if attributes.key?(:'excluded_accounts')
74+
if (value = attributes[:'excluded_accounts']).is_a?(Array)
75+
self.excluded_accounts = value
76+
end
77+
end
78+
79+
if attributes.key?(:'include_new_accounts')
80+
self.include_new_accounts = attributes[:'include_new_accounts']
81+
end
82+
83+
if attributes.key?(:'included_accounts')
84+
if (value = attributes[:'included_accounts']).is_a?(Array)
85+
self.included_accounts = value
86+
end
87+
end
88+
end
89+
90+
# Returns the object in the form of hash, with additionalProperties support.
91+
# @return [Hash] Returns the object in the form of hash
92+
# @!visibility private
93+
def to_hash
94+
hash = {}
95+
self.class.attribute_map.each_pair do |attr, param|
96+
value = self.send(attr)
97+
if value.nil?
98+
is_nullable = self.class.openapi_nullable.include?(attr)
99+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
100+
end
101+
102+
hash[param] = _to_hash(value)
103+
end
104+
self.additional_properties.each_pair do |attr, value|
105+
hash[attr] = value
106+
end
107+
hash
108+
end
109+
110+
# Checks equality by comparing each attribute.
111+
# @param o [Object] Object to be compared
112+
# @!visibility private
113+
def ==(o)
114+
return true if self.equal?(o)
115+
self.class == o.class &&
116+
excluded_accounts == o.excluded_accounts &&
117+
include_new_accounts == o.include_new_accounts &&
118+
included_accounts == o.included_accounts &&
119+
additional_properties == o.additional_properties
120+
end
121+
122+
# Calculates hash code according to all attributes.
123+
# @return [Integer] Hash code
124+
# @!visibility private
125+
def hash
126+
[excluded_accounts, include_new_accounts, included_accounts, additional_properties].hash
127+
end
128+
end
129+
end

lib/datadog_api_client/v2/models/aws_cur_config_attributes.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ module DatadogAPIClient::V2
2121
class AwsCURConfigAttributes
2222
include BaseGenericModel
2323

24+
# The account filtering configuration.
25+
attr_accessor :account_filters
26+
2427
# The AWS account ID.
2528
attr_reader :account_id
2629

@@ -60,6 +63,7 @@ class AwsCURConfigAttributes
6063
# @!visibility private
6164
def self.attribute_map
6265
{
66+
:'account_filters' => :'account_filters',
6367
:'account_id' => :'account_id',
6468
:'bucket_name' => :'bucket_name',
6569
:'bucket_region' => :'bucket_region',
@@ -78,6 +82,7 @@ def self.attribute_map
7882
# @!visibility private
7983
def self.openapi_types
8084
{
85+
:'account_filters' => :'AccountFilteringConfig',
8186
:'account_id' => :'String',
8287
:'bucket_name' => :'String',
8388
:'bucket_region' => :'String',
@@ -110,6 +115,10 @@ def initialize(attributes = {})
110115
end
111116
}
112117

118+
if attributes.key?(:'account_filters')
119+
self.account_filters = attributes[:'account_filters']
120+
end
121+
113122
if attributes.key?(:'account_id')
114123
self.account_id = attributes[:'account_id']
115124
end
@@ -306,6 +315,7 @@ def to_hash
306315
def ==(o)
307316
return true if self.equal?(o)
308317
self.class == o.class &&
318+
account_filters == o.account_filters &&
309319
account_id == o.account_id &&
310320
bucket_name == o.bucket_name &&
311321
bucket_region == o.bucket_region &&
@@ -324,7 +334,7 @@ def ==(o)
324334
# @return [Integer] Hash code
325335
# @!visibility private
326336
def hash
327-
[account_id, bucket_name, bucket_region, created_at, error_messages, months, report_name, report_prefix, status, status_updated_at, updated_at, additional_properties].hash
337+
[account_filters, account_id, bucket_name, bucket_region, created_at, error_messages, months, report_name, report_prefix, status, status_updated_at, updated_at, additional_properties].hash
328338
end
329339
end
330340
end

lib/datadog_api_client/v2/models/aws_cur_config_patch_request_attributes.rb

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ module DatadogAPIClient::V2
2121
class AwsCURConfigPatchRequestAttributes
2222
include BaseGenericModel
2323

24+
# The account filtering configuration.
25+
attr_accessor :account_filters
26+
2427
# Whether or not the Cloud Cost Management account is enabled.
25-
attr_reader :is_enabled
28+
attr_accessor :is_enabled
2629

2730
attr_accessor :additional_properties
2831

2932
# Attribute mapping from ruby-style variable name to JSON key.
3033
# @!visibility private
3134
def self.attribute_map
3235
{
36+
:'account_filters' => :'account_filters',
3337
:'is_enabled' => :'is_enabled'
3438
}
3539
end
@@ -38,6 +42,7 @@ def self.attribute_map
3842
# @!visibility private
3943
def self.openapi_types
4044
{
45+
:'account_filters' => :'AccountFilteringConfig',
4146
:'is_enabled' => :'Boolean'
4247
}
4348
end
@@ -60,27 +65,13 @@ def initialize(attributes = {})
6065
end
6166
}
6267

63-
if attributes.key?(:'is_enabled')
64-
self.is_enabled = attributes[:'is_enabled']
68+
if attributes.key?(:'account_filters')
69+
self.account_filters = attributes[:'account_filters']
6570
end
66-
end
67-
68-
# Check to see if the all the properties in the model are valid
69-
# @return true if the model is valid
70-
# @!visibility private
71-
def valid?
72-
return false if @is_enabled.nil?
73-
true
74-
end
7571

76-
# Custom attribute writer method with validation
77-
# @param is_enabled [Object] Object to be assigned
78-
# @!visibility private
79-
def is_enabled=(is_enabled)
80-
if is_enabled.nil?
81-
fail ArgumentError, 'invalid value for "is_enabled", is_enabled cannot be nil.'
72+
if attributes.key?(:'is_enabled')
73+
self.is_enabled = attributes[:'is_enabled']
8274
end
83-
@is_enabled = is_enabled
8475
end
8576

8677
# Returns the object in the form of hash, with additionalProperties support.
@@ -109,6 +100,7 @@ def to_hash
109100
def ==(o)
110101
return true if self.equal?(o)
111102
self.class == o.class &&
103+
account_filters == o.account_filters &&
112104
is_enabled == o.is_enabled &&
113105
additional_properties == o.additional_properties
114106
end
@@ -117,7 +109,7 @@ def ==(o)
117109
# @return [Integer] Hash code
118110
# @!visibility private
119111
def hash
120-
[is_enabled, additional_properties].hash
112+
[account_filters, is_enabled, additional_properties].hash
121113
end
122114
end
123115
end

0 commit comments

Comments
 (0)