Skip to content

Commit fdf5364

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit f0a4221 of spec repo (#425)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent db11dcb commit fdf5364

10 files changed

Lines changed: 347 additions & 12 deletions

File tree

.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.4.1.dev11",
7-
"regenerated": "2021-07-13 15:55:06.006131",
8-
"spec_repo_commit": "c2e2dda"
7+
"regenerated": "2021-07-14 09:07:16.506440",
8+
"spec_repo_commit": "f0a4221"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev11",
12-
"regenerated": "2021-07-13 15:55:50.392899",
13-
"spec_repo_commit": "c2e2dda"
12+
"regenerated": "2021-07-14 09:08:07.251643",
13+
"spec_repo_commit": "f0a4221"
1414
}
1515
}
1616
}

data/v1/openapi.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,22 @@ components:
131131
description: AWS external_id.
132132
type: string
133133
type: object
134+
AWSAccountDeleteRequest:
135+
description: List of AWS accounts to delete.
136+
properties:
137+
access_key_id:
138+
description: Your AWS access key ID. Only required if your AWS account is
139+
a GovCloud or China account.
140+
type: string
141+
account_id:
142+
description: Your AWS Account ID without dashes.
143+
example: '1234567'
144+
type: string
145+
role_name:
146+
description: Your Datadog role delegation name.
147+
example: DatadogAWSIntegrationRole
148+
type: string
149+
type: object
134150
AWSAccountListResponse:
135151
description: List of enabled AWS accounts.
136152
properties:
@@ -15153,7 +15169,7 @@ paths:
1515315169
content:
1515415170
application/json:
1515515171
schema:
15156-
$ref: '#/components/schemas/AWSAccount'
15172+
$ref: '#/components/schemas/AWSAccountDeleteRequest'
1515715173
description: AWS request object
1515815174
required: true
1515915175
responses:

docs/v1/AWSAccountDeleteRequest.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# DatadogAPIClient::V1::AWSAccountDeleteRequest
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **access_key_id** | **String** | Your AWS access key ID. Only required if your AWS account is a GovCloud or China account. | [optional] |
8+
| **account_id** | **String** | Your AWS Account ID without dashes. | [optional] |
9+
| **role_name** | **String** | Your Datadog role delegation name. | [optional] |
10+
11+
## Example
12+
13+
```ruby
14+
require 'datadog_api_client/v1'
15+
16+
instance = DatadogAPIClient::V1::AWSAccountDeleteRequest.new(
17+
access_key_id: null,
18+
account_id: 1234567,
19+
role_name: DatadogAWSIntegrationRole
20+
)
21+
```
22+

docs/v1/AWSIntegrationAPI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Delete a Datadog-AWS integration matching the specified `account_id` and `role_n
209209
```ruby
210210
require 'datadog_api_client'
211211
api_instance = DatadogAPIClient::V1::AWSIntegrationAPI.new
212-
body = DatadogAPIClient::V1::AWSAccount.new # AWSAccount | AWS request object
212+
body = DatadogAPIClient::V1::AWSAccountDeleteRequest.new # AWSAccountDeleteRequest | AWS request object
213213

214214
begin
215215
# Delete an AWS integration
@@ -242,7 +242,7 @@ end
242242

243243
| Name | Type | Description | Notes |
244244
| ---- | ---- | ----------- | ----- |
245-
| **body** | [**AWSAccount**](AWSAccount.md) | AWS request object | |
245+
| **body** | [**AWSAccountDeleteRequest**](AWSAccountDeleteRequest.md) | AWS request object | |
246246

247247
### Return type
248248

docs/v1/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ Class | Method | HTTP request | Description
230230
- [DatadogAPIClient::V1::AWSAccount](AWSAccount.md)
231231
- [DatadogAPIClient::V1::AWSAccountAndLambdaRequest](AWSAccountAndLambdaRequest.md)
232232
- [DatadogAPIClient::V1::AWSAccountCreateResponse](AWSAccountCreateResponse.md)
233+
- [DatadogAPIClient::V1::AWSAccountDeleteRequest](AWSAccountDeleteRequest.md)
233234
- [DatadogAPIClient::V1::AWSAccountListResponse](AWSAccountListResponse.md)
234235
- [DatadogAPIClient::V1::AWSLogsAsyncError](AWSLogsAsyncError.md)
235236
- [DatadogAPIClient::V1::AWSLogsAsyncResponse](AWSLogsAsyncResponse.md)

features/v1/aws_integration.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ Feature: AWS Integration
4747
@generated @skip
4848
Scenario: Delete an AWS integration returns "Bad Request" response
4949
Given new "DeleteAWSAccount" request
50-
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
50+
And body with value {"access_key_id": null, "account_id": "1234567", "role_name": "DatadogAWSIntegrationRole"}
5151
When the request is sent
5252
Then the response status is 400 Bad Request
5353

5454
@generated @skip
5555
Scenario: Delete an AWS integration returns "Conflict Error" response
5656
Given new "DeleteAWSAccount" request
57-
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
57+
And body with value {"access_key_id": null, "account_id": "1234567", "role_name": "DatadogAWSIntegrationRole"}
5858
When the request is sent
5959
Then the response status is 409 Conflict Error
6060

6161
@generated @skip
6262
Scenario: Delete an AWS integration returns "OK" response
6363
Given new "DeleteAWSAccount" request
64-
And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": ["<KEY>:<VALUE>"], "host_tags": ["<KEY>:<VALUE>"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null}
64+
And body with value {"access_key_id": null, "account_id": "1234567", "role_name": "DatadogAWSIntegrationRole"}
6565
When the request is sent
6666
Then the response status is 200 OK
6767

lib/datadog_api_client/v1.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
require 'datadog_api_client/v1/models/aws_account'
2525
require 'datadog_api_client/v1/models/aws_account_and_lambda_request'
2626
require 'datadog_api_client/v1/models/aws_account_create_response'
27+
require 'datadog_api_client/v1/models/aws_account_delete_request'
2728
require 'datadog_api_client/v1/models/aws_account_list_response'
2829
require 'datadog_api_client/v1/models/aws_logs_async_error'
2930
require 'datadog_api_client/v1/models/aws_logs_async_response'

lib/datadog_api_client/v1/api/aws_integration_api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def create_new_aws_external_id_with_http_info(body, opts = {})
249249

250250
# Delete an AWS integration
251251
# Delete a Datadog-AWS integration matching the specified `account_id` and `role_name parameters`.
252-
# @param body [AWSAccount] AWS request object
252+
# @param body [AWSAccountDeleteRequest] AWS request object
253253
# @param [Hash] opts the optional parameters
254254
# @return [Object]
255255
def delete_aws_account(body, opts = {})
@@ -259,7 +259,7 @@ def delete_aws_account(body, opts = {})
259259

260260
# Delete an AWS integration
261261
# Delete a Datadog-AWS integration matching the specified &#x60;account_id&#x60; and &#x60;role_name parameters&#x60;.
262-
# @param body [AWSAccount] AWS request object
262+
# @param body [AWSAccountDeleteRequest] AWS request object
263263
# @param [Hash] opts the optional parameters
264264
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
265265
def delete_aws_account_with_http_info(body, opts = {})
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
=begin
2+
#Datadog API V1 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://openapi-generator.tech
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::V1
20+
# List of AWS accounts to delete.
21+
class AWSAccountDeleteRequest
22+
# Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.
23+
attr_accessor :access_key_id
24+
25+
# Your AWS Account ID without dashes.
26+
attr_accessor :account_id
27+
28+
# Your Datadog role delegation name.
29+
attr_accessor :role_name
30+
31+
# Attribute mapping from ruby-style variable name to JSON key.
32+
def self.attribute_map
33+
{
34+
:'access_key_id' => :'access_key_id',
35+
:'account_id' => :'account_id',
36+
:'role_name' => :'role_name'
37+
}
38+
end
39+
40+
# Returns all the JSON keys this model knows about
41+
def self.acceptable_attributes
42+
attribute_map.values
43+
end
44+
45+
# Attribute type mapping.
46+
def self.openapi_types
47+
{
48+
:'access_key_id' => :'String',
49+
:'account_id' => :'String',
50+
:'role_name' => :'String'
51+
}
52+
end
53+
54+
# List of attributes with nullable: true
55+
def self.openapi_nullable
56+
Set.new([
57+
])
58+
end
59+
60+
# Initializes the object
61+
# @param [Hash] attributes Model attributes in the form of hash
62+
def initialize(attributes = {})
63+
if (!attributes.is_a?(Hash))
64+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::AWSAccountDeleteRequest` initialize method"
65+
end
66+
67+
# check to see if the attribute exists and convert string to symbol for hash key
68+
attributes = attributes.each_with_object({}) { |(k, v), h|
69+
if (!self.class.attribute_map.key?(k.to_sym))
70+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::AWSAccountDeleteRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71+
end
72+
h[k.to_sym] = v
73+
}
74+
75+
if attributes.key?(:'access_key_id')
76+
self.access_key_id = attributes[:'access_key_id']
77+
end
78+
79+
if attributes.key?(:'account_id')
80+
self.account_id = attributes[:'account_id']
81+
end
82+
83+
if attributes.key?(:'role_name')
84+
self.role_name = attributes[:'role_name']
85+
end
86+
end
87+
88+
# Show invalid properties with the reasons. Usually used together with valid?
89+
# @return Array for valid properties with the reasons
90+
def list_invalid_properties
91+
invalid_properties = Array.new
92+
invalid_properties
93+
end
94+
95+
# Check to see if the all the properties in the model are valid
96+
# @return true if the model is valid
97+
def valid?
98+
true
99+
end
100+
101+
# Checks equality by comparing each attribute.
102+
# @param [Object] Object to be compared
103+
def ==(o)
104+
return true if self.equal?(o)
105+
self.class == o.class &&
106+
access_key_id == o.access_key_id &&
107+
account_id == o.account_id &&
108+
role_name == o.role_name
109+
end
110+
111+
# @see the `==` method
112+
# @param [Object] Object to be compared
113+
def eql?(o)
114+
self == o
115+
end
116+
117+
# Calculates hash code according to all attributes.
118+
# @return [Integer] Hash code
119+
def hash
120+
[access_key_id, account_id, role_name].hash
121+
end
122+
123+
# Builds the object from hash
124+
# @param [Hash] attributes Model attributes in the form of hash
125+
# @return [Object] Returns the model itself
126+
def self.build_from_hash(attributes)
127+
new.build_from_hash(attributes)
128+
end
129+
130+
# Builds the object from hash
131+
# @param [Hash] attributes Model attributes in the form of hash
132+
# @return [Object] Returns the model itself
133+
def build_from_hash(attributes)
134+
return nil unless attributes.is_a?(Hash)
135+
self.class.openapi_types.each_pair do |key, type|
136+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
137+
self.send("#{key}=", nil)
138+
elsif type =~ /\AArray<(.*)>/i
139+
# check to ensure the input is an array given that the attribute
140+
# is documented as an array but the input is not
141+
if attributes[self.class.attribute_map[key]].is_a?(Array)
142+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143+
end
144+
elsif !attributes[self.class.attribute_map[key]].nil?
145+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146+
end
147+
end
148+
149+
self
150+
end
151+
152+
# Deserializes the data based on type
153+
# @param string type Data type
154+
# @param string value Value to be deserialized
155+
# @return [Object] Deserialized data
156+
def _deserialize(type, value)
157+
case type.to_sym
158+
when :Time
159+
Time.parse(value)
160+
when :Date
161+
Date.parse(value)
162+
when :String
163+
value.to_s
164+
when :Integer
165+
value.to_i
166+
when :Float
167+
value.to_f
168+
when :Boolean
169+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170+
true
171+
else
172+
false
173+
end
174+
when :Object
175+
# generic object (usually a Hash), return directly
176+
value
177+
when :Array
178+
# generic array, return directly
179+
value
180+
when /\AArray<(?<inner_type>.+)>\z/
181+
inner_type = Regexp.last_match[:inner_type]
182+
value.map { |v| _deserialize(inner_type, v) }
183+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184+
k_type = Regexp.last_match[:k_type]
185+
v_type = Regexp.last_match[:v_type]
186+
{}.tap do |hash|
187+
value.each do |k, v|
188+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189+
end
190+
end
191+
else # model
192+
# models (e.g. Pet) or oneOf
193+
klass = DatadogAPIClient::V1.const_get(type)
194+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
195+
end
196+
end
197+
198+
# Returns the string representation of the object
199+
# @return [String] String presentation of the object
200+
def to_s
201+
to_hash.to_s
202+
end
203+
204+
# to_body is an alias to to_hash (backward compatibility)
205+
# @return [Hash] Returns the object in the form of hash
206+
def to_body
207+
to_hash
208+
end
209+
210+
# Returns the object in the form of hash
211+
# @return [Hash] Returns the object in the form of hash
212+
def to_hash
213+
hash = {}
214+
self.class.attribute_map.each_pair do |attr, param|
215+
value = self.send(attr)
216+
if value.nil?
217+
is_nullable = self.class.openapi_nullable.include?(attr)
218+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219+
end
220+
221+
hash[param] = _to_hash(value)
222+
end
223+
hash
224+
end
225+
226+
# Outputs non-array value in the form of hash
227+
# For object, use to_hash. Otherwise, just return the value
228+
# @param [Object] value Any valid value
229+
# @return [Hash] Returns the value in the form of hash
230+
def _to_hash(value)
231+
if value.is_a?(Array)
232+
value.compact.map { |v| _to_hash(v) }
233+
elsif value.is_a?(Hash)
234+
{}.tap do |hash|
235+
value.each { |k, v| hash[k] = _to_hash(v) }
236+
end
237+
elsif value.respond_to? :to_hash
238+
value.to_hash
239+
else
240+
value
241+
end
242+
end
243+
244+
end
245+
246+
end

0 commit comments

Comments
 (0)