Skip to content

Commit

Permalink
Regenerate client from commit 37a9266 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Aug 16, 2021
1 parent d0b46a0 commit 84496c3
Show file tree
Hide file tree
Showing 930 changed files with 6,077 additions and 1,133 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.4.1.dev11",
"regenerated": "2021-08-13 15:34:31.003048",
"spec_repo_commit": "64ee0b9"
"regenerated": "2021-08-16 13:58:42.639406",
"spec_repo_commit": "37a9266"
},
"v2": {
"apigentools_version": "1.4.1.dev11",
"regenerated": "2021-08-13 15:35:26.937747",
"spec_repo_commit": "64ee0b9"
"regenerated": "2021-08-16 13:59:33.901537",
"spec_repo_commit": "37a9266"
}
}
}
2 changes: 1 addition & 1 deletion features/v1/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Feature: Synthetics
And a valid "appKeyAuth" key in the system
And an instance of "Synthetics" API

@replay-only @skip-java @skip-ruby
@replay-only @skip-java
Scenario: Client is resilient to enum and oneOf deserialization errors
Given new "ListTests" request
When the request is sent
Expand Down
14 changes: 14 additions & 0 deletions lib/datadog_api_client/v1/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -457,4 +457,18 @@ def server_url(index, variables = {}, servers = nil)
url
end
end

class UnparsedObject
# Defines unparsed object
attr_accessor :data

def initialize(data)
@data = data
end

def to_hash
self.data
end
end

end
3 changes: 1 addition & 2 deletions lib/datadog_api_client/v1/models/access_role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def self.build_from_hash(value)
# @return [String] The enum value
def build_from_hash(value)
constantValues = AccessRole.constants.select { |c| AccessRole::const_get(c) == value }
raise "Invalid ENUM value #{value} for class #AccessRole" if constantValues.empty?
value
constantValues.empty? ? DatadogAPIClient::V1::UnparsedObject.new(value) : value
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# Alert graphs are timeseries graphs showing the current status of any monitor defined on your system.
class AlertGraphWidgetDefinition
# whether the object has unparsed attributes
attr_accessor :_unparsed

# ID of the alert to use in the widget.
attr_accessor :alert_id

Expand Down Expand Up @@ -244,7 +247,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def self.build_from_hash(value)
# @return [String] The enum value
def build_from_hash(value)
constantValues = AlertGraphWidgetDefinitionType.constants.select { |c| AlertGraphWidgetDefinitionType::const_get(c) == value }
raise "Invalid ENUM value #{value} for class #AlertGraphWidgetDefinitionType" if constantValues.empty?
value
constantValues.empty? ? DatadogAPIClient::V1::UnparsedObject.new(value) : value
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# Alert values are query values showing the current value of the metric in any monitor defined on your system.
class AlertValueWidgetDefinition
# whether the object has unparsed attributes
attr_accessor :_unparsed

# ID of the alert to use in the widget.
attr_accessor :alert_id

Expand Down Expand Up @@ -250,7 +253,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def self.build_from_hash(value)
# @return [String] The enum value
def build_from_hash(value)
constantValues = AlertValueWidgetDefinitionType.constants.select { |c| AlertValueWidgetDefinitionType::const_get(c) == value }
raise "Invalid ENUM value #{value} for class #AlertValueWidgetDefinitionType" if constantValues.empty?
value
constantValues.empty? ? DatadogAPIClient::V1::UnparsedObject.new(value) : value
end
end
end
9 changes: 8 additions & 1 deletion lib/datadog_api_client/v1/models/api_error_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# Error response object.
class APIErrorResponse
# whether the object has unparsed attributes
attr_accessor :_unparsed

# Array of errors returned by the API.
attr_accessor :errors

Expand Down Expand Up @@ -178,7 +181,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
9 changes: 8 additions & 1 deletion lib/datadog_api_client/v1/models/api_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# Datadog API key.
class ApiKey
# whether the object has unparsed attributes
attr_accessor :_unparsed

# Date of creation of the API key.
attr_accessor :created

Expand Down Expand Up @@ -225,7 +228,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
9 changes: 8 additions & 1 deletion lib/datadog_api_client/v1/models/api_key_list_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# List of API and application keys available for a given organization.
class ApiKeyListResponse
# whether the object has unparsed attributes
attr_accessor :_unparsed

# Array of API keys.
attr_accessor :api_keys

Expand Down Expand Up @@ -173,7 +176,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
9 changes: 8 additions & 1 deletion lib/datadog_api_client/v1/models/api_key_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# An API key with its associated metadata.
class ApiKeyResponse
# whether the object has unparsed attributes
attr_accessor :_unparsed

attr_accessor :api_key

# Attribute mapping from ruby-style variable name to JSON key.
Expand Down Expand Up @@ -170,7 +173,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# Column properties.
class ApmStatsQueryColumnType
# whether the object has unparsed attributes
attr_accessor :_unparsed

# A user-assigned alias for the column.
attr_accessor :_alias

Expand Down Expand Up @@ -204,7 +207,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# The APM stats query for table and distributions widgets.
class ApmStatsQueryDefinition
# whether the object has unparsed attributes
attr_accessor :_unparsed

# Column properties used by the front end for display.
attr_accessor :columns

Expand Down Expand Up @@ -257,7 +260,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
3 changes: 1 addition & 2 deletions lib/datadog_api_client/v1/models/apm_stats_query_row_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def self.build_from_hash(value)
# @return [String] The enum value
def build_from_hash(value)
constantValues = ApmStatsQueryRowType.constants.select { |c| ApmStatsQueryRowType::const_get(c) == value }
raise "Invalid ENUM value #{value} for class #ApmStatsQueryRowType" if constantValues.empty?
value
constantValues.empty? ? DatadogAPIClient::V1::UnparsedObject.new(value) : value
end
end
end
9 changes: 8 additions & 1 deletion lib/datadog_api_client/v1/models/application_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# An application key with its associated metadata.
class ApplicationKey
# whether the object has unparsed attributes
attr_accessor :_unparsed

# Hash of an application key.
attr_accessor :hash

Expand Down Expand Up @@ -215,7 +218,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# An application key response.
class ApplicationKeyListResponse
# whether the object has unparsed attributes
attr_accessor :_unparsed

# Array of application keys.
attr_accessor :application_keys

Expand Down Expand Up @@ -173,7 +176,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
9 changes: 8 additions & 1 deletion lib/datadog_api_client/v1/models/application_key_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# An application key response.
class ApplicationKeyResponse
# whether the object has unparsed attributes
attr_accessor :_unparsed

attr_accessor :application_key

# Attribute mapping from ruby-style variable name to JSON key.
Expand Down Expand Up @@ -170,7 +173,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# Represent validation endpoint responses.
class AuthenticationValidationResponse
# whether the object has unparsed attributes
attr_accessor :_unparsed

# Return `true` if the authentication response is valid.
attr_accessor :valid

Expand Down Expand Up @@ -171,7 +174,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
9 changes: 8 additions & 1 deletion lib/datadog_api_client/v1/models/aws_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
module DatadogAPIClient::V1
# Returns the AWS account associated with this integration.
class AWSAccount
# whether the object has unparsed attributes
attr_accessor :_unparsed

# Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.
attr_accessor :access_key_id

Expand Down Expand Up @@ -249,7 +252,11 @@ def _deserialize(type, value)
else # model
# models (e.g. Pet) or oneOf
klass = DatadogAPIClient::V1.const_get(type)
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
res = klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
if res.instance_of? DatadogAPIClient::V1::UnparsedObject
self._unparsed = true
end
res
end
end

Expand Down
Loading

0 comments on commit 84496c3

Please sign in to comment.