datadog_api_client 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +195 -46
  4. data/.generator/schemas/v2/openapi.yaml +877 -96
  5. data/.generator/src/generator/formatter.py +1 -0
  6. data/.generator/src/generator/templates/model_base.j2 +8 -4
  7. data/CHANGELOG.md +39 -0
  8. data/examples/v1/dashboards/CreateDashboard_109450134.rb +44 -0
  9. data/examples/v1/dashboards/CreateDashboard_2800096921.rb +62 -0
  10. data/examples/v1/dashboards/CreateDashboard_3195475781.rb +32 -0
  11. data/examples/v1/service-level-objectives/SearchSLO.rb +0 -3
  12. data/examples/v2/incidents/CreateIncidentIntegration.rb +31 -0
  13. data/examples/v2/incidents/DeleteIncidentIntegration.rb +14 -0
  14. data/examples/v2/incidents/GetIncidentIntegration.rb +14 -0
  15. data/examples/v2/incidents/ListIncidentIntegrations.rb +11 -0
  16. data/examples/v2/incidents/UpdateIncidentIntegration.rb +34 -0
  17. data/examples/v2/ip-allowlist/GetIPAllowlist.rb +5 -0
  18. data/examples/v2/ip-allowlist/UpdateIPAllowlist.rb +25 -0
  19. data/examples/v2/logs-metrics/CreateLogsMetric.rb +1 -1
  20. data/examples/v2/restriction-policies/DeleteRestrictionPolicy.rb +5 -0
  21. data/examples/v2/restriction-policies/GetRestrictionPolicy.rb +5 -0
  22. data/examples/v2/restriction-policies/UpdateRestrictionPolicy.rb +25 -0
  23. data/examples/v2/synthetics/GetOnDemandConcurrencyCap.rb +5 -0
  24. data/examples/v2/synthetics/GetOnDemandConcurrencyCap_2633566918.rb +5 -0
  25. data/examples/v2/synthetics/SetOnDemandConcurrencyCap.rb +7 -0
  26. data/examples/v2/synthetics/SetOnDemandConcurrencyCap_2850884405.rb +9 -0
  27. data/lib/datadog_api_client/configuration.rb +5 -1
  28. data/lib/datadog_api_client/inflector.rb +38 -0
  29. data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +0 -6
  30. data/lib/datadog_api_client/v1/api/snapshots_api.rb +2 -2
  31. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  32. data/lib/datadog_api_client/v1/model_base.rb +7 -3
  33. data/lib/datadog_api_client/v1/models/application_key.rb +16 -16
  34. data/lib/datadog_api_client/v1/models/cancel_downtimes_by_scope_request.rb +1 -1
  35. data/lib/datadog_api_client/v1/models/downtime.rb +1 -1
  36. data/lib/datadog_api_client/v1/models/downtime_child.rb +1 -1
  37. data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
  38. data/lib/datadog_api_client/v1/models/host_meta.rb +3 -3
  39. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -0
  40. data/lib/datadog_api_client/v1/models/ip_prefixes_orchestrator.rb +105 -0
  41. data/lib/datadog_api_client/v1/models/ip_ranges.rb +11 -1
  42. data/lib/datadog_api_client/v1/models/list_stream_source.rb +3 -0
  43. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -0
  44. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +31 -11
  45. data/lib/datadog_api_client/v1/models/search_service_level_objective_attributes.rb +11 -1
  46. data/lib/datadog_api_client/v1/models/slo_list_widget_query.rb +16 -4
  47. data/lib/datadog_api_client/v1/models/slo_overall_statuses.rb +24 -1
  48. data/lib/datadog_api_client/v1/models/slo_state.rb +29 -0
  49. data/lib/datadog_api_client/v1/models/slo_status.rb +164 -0
  50. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +10 -10
  51. data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +12 -1
  52. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +41 -1
  53. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +41 -1
  54. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +41 -1
  55. data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +3 -3
  56. data/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb +3 -3
  57. data/lib/datadog_api_client/v2/api/incidents_api.rb +384 -0
  58. data/lib/datadog_api_client/v2/api/ip_allowlist_api.rb +153 -0
  59. data/lib/datadog_api_client/v2/api/logs_api.rb +1 -0
  60. data/lib/datadog_api_client/v2/api/metrics_api.rb +2 -2
  61. data/lib/datadog_api_client/v2/api/monitors_api.rb +3 -3
  62. data/lib/datadog_api_client/v2/api/restriction_policies_api.rb +236 -0
  63. data/lib/datadog_api_client/v2/api/synthetics_api.rb +153 -0
  64. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +1 -1
  65. data/lib/datadog_api_client/v2/model_base.rb +7 -3
  66. data/lib/datadog_api_client/v2/models/events_data_source.rb +1 -0
  67. data/lib/datadog_api_client/v2/models/incident_integration_metadata_attributes.rb +161 -0
  68. data/lib/datadog_api_client/v2/models/incident_integration_metadata_create_data.rb +123 -0
  69. data/lib/datadog_api_client/v2/models/incident_integration_metadata_create_request.rb +102 -0
  70. data/lib/datadog_api_client/v2/models/incident_integration_metadata_list_response.rb +126 -0
  71. data/lib/datadog_api_client/v2/models/incident_integration_metadata_metadata.rb +63 -0
  72. data/lib/datadog_api_client/v2/models/incident_integration_metadata_patch_data.rb +123 -0
  73. data/lib/datadog_api_client/v2/models/incident_integration_metadata_patch_request.rb +102 -0
  74. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response.rb +114 -0
  75. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_data.rb +133 -0
  76. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_included_item.rb +62 -0
  77. data/lib/datadog_api_client/v2/models/incident_update_data.rb +1 -1
  78. data/lib/datadog_api_client/v2/models/ip_allowlist_attributes.rb +103 -0
  79. data/lib/datadog_api_client/v2/models/ip_allowlist_data.rb +122 -0
  80. data/lib/datadog_api_client/v2/models/ip_allowlist_entry.rb +102 -0
  81. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_attributes.rb +121 -0
  82. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_data.rb +122 -0
  83. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_type.rb +26 -0
  84. data/lib/datadog_api_client/v2/models/ip_allowlist_response.rb +91 -0
  85. data/lib/datadog_api_client/v2/models/ip_allowlist_type.rb +26 -0
  86. data/lib/datadog_api_client/v2/models/ip_allowlist_update_request.rb +102 -0
  87. data/lib/datadog_api_client/v2/models/jira_integration_metadata.rb +104 -0
  88. data/lib/datadog_api_client/v2/models/jira_integration_metadata_issues_item.rb +153 -0
  89. data/lib/datadog_api_client/v2/models/metrics_aggregator.rb +4 -0
  90. data/lib/datadog_api_client/v2/models/metrics_data_source.rb +2 -1
  91. data/lib/datadog_api_client/v2/models/metrics_scalar_query.rb +1 -1
  92. data/lib/datadog_api_client/v2/models/metrics_timeseries_query.rb +1 -1
  93. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap.rb +91 -0
  94. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_attributes.rb +91 -0
  95. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_response.rb +91 -0
  96. data/lib/datadog_api_client/v2/models/relationship_to_incident_integration_metadatas.rb +1 -1
  97. data/lib/datadog_api_client/v2/models/restriction_policy.rb +144 -0
  98. data/lib/datadog_api_client/v2/models/restriction_policy_attributes.rb +104 -0
  99. data/lib/datadog_api_client/v2/models/restriction_policy_binding.rb +127 -0
  100. data/lib/datadog_api_client/v2/models/restriction_policy_response.rb +102 -0
  101. data/lib/datadog_api_client/v2/models/restriction_policy_type.rb +26 -0
  102. data/lib/datadog_api_client/v2/models/restriction_policy_update_request.rb +102 -0
  103. data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +7 -7
  104. data/lib/datadog_api_client/v2/models/rum_application_list_attributes.rb +7 -7
  105. data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_read.rb +1 -0
  106. data/lib/datadog_api_client/v2/models/slack_integration_metadata.rb +104 -0
  107. data/lib/datadog_api_client/v2/models/slack_integration_metadata_channel_item.rb +154 -0
  108. data/lib/datadog_api_client/version.rb +1 -1
  109. metadata +57 -2
@@ -0,0 +1,123 @@
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
+ Contact: support@datadoghq.com
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
+ # Incident integration metadata data for a create request.
21
+ class IncidentIntegrationMetadataCreateData
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Incident integration metadata's attributes for a create request.
29
+ attr_reader :attributes
30
+
31
+ # Integration metadata resource type.
32
+ attr_reader :type
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'attributes' => :'attributes',
39
+ :'type' => :'type'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ # @!visibility private
45
+ def self.openapi_types
46
+ {
47
+ :'attributes' => :'IncidentIntegrationMetadataAttributes',
48
+ :'type' => :'IncidentIntegrationMetadataType'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param attributes [Hash] Model attributes in the form of hash
54
+ # @!visibility private
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentIntegrationMetadataCreateData` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IncidentIntegrationMetadataCreateData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'attributes')
69
+ self.attributes = attributes[:'attributes']
70
+ end
71
+
72
+ if attributes.key?(:'type')
73
+ self.type = attributes[:'type']
74
+ end
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ # @!visibility private
80
+ def valid?
81
+ return false if @attributes.nil?
82
+ return false if @type.nil?
83
+ true
84
+ end
85
+
86
+ # Custom attribute writer method with validation
87
+ # @param attributes [Object] Object to be assigned
88
+ # @!visibility private
89
+ def attributes=(attributes)
90
+ if attributes.nil?
91
+ fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
92
+ end
93
+ @attributes = attributes
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param type [Object] Object to be assigned
98
+ # @!visibility private
99
+ def type=(type)
100
+ if type.nil?
101
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
102
+ end
103
+ @type = type
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param o [Object] Object to be compared
108
+ # @!visibility private
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ attributes == o.attributes &&
113
+ type == o.type
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ # @!visibility private
119
+ def hash
120
+ [attributes, type].hash
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,102 @@
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
+ Contact: support@datadoghq.com
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
+ # Create request for an incident integration metadata.
21
+ class IncidentIntegrationMetadataCreateRequest
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Incident integration metadata data for a create request.
29
+ attr_reader :data
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'data' => :'data'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'data' => :'IncidentIntegrationMetadataCreateData'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param attributes [Hash] Model attributes in the form of hash
49
+ # @!visibility private
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentIntegrationMetadataCreateRequest` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IncidentIntegrationMetadataCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'data')
64
+ self.data = attributes[:'data']
65
+ 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 @data.nil?
73
+ true
74
+ end
75
+
76
+ # Custom attribute writer method with validation
77
+ # @param data [Object] Object to be assigned
78
+ # @!visibility private
79
+ def data=(data)
80
+ if data.nil?
81
+ fail ArgumentError, 'invalid value for "data", data cannot be nil.'
82
+ end
83
+ @data = data
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param o [Object] Object to be compared
88
+ # @!visibility private
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ data == o.data
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ # @!visibility private
98
+ def hash
99
+ [data].hash
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,126 @@
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
+ Contact: support@datadoghq.com
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
+ # Response with a list of incident integration metadata.
21
+ class IncidentIntegrationMetadataListResponse
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # An array of incident integration metadata.
29
+ attr_reader :data
30
+
31
+ # Included related resources that the user requested.
32
+ attr_accessor :included
33
+
34
+ # The metadata object containing pagination metadata.
35
+ attr_accessor :meta
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ # @!visibility private
39
+ def self.attribute_map
40
+ {
41
+ :'data' => :'data',
42
+ :'included' => :'included',
43
+ :'meta' => :'meta'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ # @!visibility private
49
+ def self.openapi_types
50
+ {
51
+ :'data' => :'Array<IncidentIntegrationMetadataResponseData>',
52
+ :'included' => :'Array<IncidentIntegrationMetadataResponseIncludedItem>',
53
+ :'meta' => :'IncidentResponseMeta'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param attributes [Hash] Model attributes in the form of hash
59
+ # @!visibility private
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentIntegrationMetadataListResponse` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IncidentIntegrationMetadataListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'data')
74
+ if (value = attributes[:'data']).is_a?(Array)
75
+ self.data = value
76
+ end
77
+ end
78
+
79
+ if attributes.key?(:'included')
80
+ if (value = attributes[:'included']).is_a?(Array)
81
+ self.included = value
82
+ end
83
+ end
84
+
85
+ if attributes.key?(:'meta')
86
+ self.meta = attributes[:'meta']
87
+ end
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ # @!visibility private
93
+ def valid?
94
+ return false if @data.nil?
95
+ true
96
+ end
97
+
98
+ # Custom attribute writer method with validation
99
+ # @param data [Object] Object to be assigned
100
+ # @!visibility private
101
+ def data=(data)
102
+ if data.nil?
103
+ fail ArgumentError, 'invalid value for "data", data cannot be nil.'
104
+ end
105
+ @data = data
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param o [Object] Object to be compared
110
+ # @!visibility private
111
+ def ==(o)
112
+ return true if self.equal?(o)
113
+ self.class == o.class &&
114
+ data == o.data &&
115
+ included == o.included &&
116
+ meta == o.meta
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ # @!visibility private
122
+ def hash
123
+ [data, included, meta].hash
124
+ end
125
+ end
126
+ end
@@ -0,0 +1,63 @@
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
+ Contact: support@datadoghq.com
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
+ # Incident integration metadata's metadata attribute.
21
+ module IncidentIntegrationMetadataMetadata
22
+ class << self
23
+ include BaseOneOfModel
24
+ include BaseOneOfModelNoDiscriminator
25
+
26
+ # List of class defined in oneOf (OpenAPI v3)
27
+ def openapi_one_of
28
+ [
29
+ :'SlackIntegrationMetadata',
30
+ :'JiraIntegrationMetadata'
31
+ ]
32
+ end
33
+ # Builds the object
34
+ # @param data [Mixed] Data to be matched against the list of oneOf items
35
+ # @return [Object] Returns the model or the data itself
36
+ def build(data)
37
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
38
+ # Note:
39
+ # - We do not attempt to check whether exactly one item matches.
40
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
41
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
42
+ # - TODO: scalar values are de facto behaving as if they were nullable.
43
+ # - TODO: logging when debugging is set.
44
+ openapi_one_of.each do |klass|
45
+ begin
46
+ next if klass == :AnyType # "nullable: true"
47
+ typed_data = find_and_cast_into_type(klass, data)
48
+ next if typed_data._unparsed
49
+ return typed_data if typed_data
50
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
51
+ end
52
+ end
53
+
54
+ if openapi_one_of.include?(:AnyType)
55
+ data
56
+ else
57
+ self._unparsed = true
58
+ DatadogAPIClient::UnparsedObject.new(data)
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,123 @@
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
+ Contact: support@datadoghq.com
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
+ # Incident integration metadata data for a patch request.
21
+ class IncidentIntegrationMetadataPatchData
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Incident integration metadata's attributes for a create request.
29
+ attr_reader :attributes
30
+
31
+ # Integration metadata resource type.
32
+ attr_reader :type
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'attributes' => :'attributes',
39
+ :'type' => :'type'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ # @!visibility private
45
+ def self.openapi_types
46
+ {
47
+ :'attributes' => :'IncidentIntegrationMetadataAttributes',
48
+ :'type' => :'IncidentIntegrationMetadataType'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param attributes [Hash] Model attributes in the form of hash
54
+ # @!visibility private
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentIntegrationMetadataPatchData` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IncidentIntegrationMetadataPatchData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'attributes')
69
+ self.attributes = attributes[:'attributes']
70
+ end
71
+
72
+ if attributes.key?(:'type')
73
+ self.type = attributes[:'type']
74
+ end
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ # @!visibility private
80
+ def valid?
81
+ return false if @attributes.nil?
82
+ return false if @type.nil?
83
+ true
84
+ end
85
+
86
+ # Custom attribute writer method with validation
87
+ # @param attributes [Object] Object to be assigned
88
+ # @!visibility private
89
+ def attributes=(attributes)
90
+ if attributes.nil?
91
+ fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
92
+ end
93
+ @attributes = attributes
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param type [Object] Object to be assigned
98
+ # @!visibility private
99
+ def type=(type)
100
+ if type.nil?
101
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
102
+ end
103
+ @type = type
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param o [Object] Object to be compared
108
+ # @!visibility private
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ attributes == o.attributes &&
113
+ type == o.type
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ # @!visibility private
119
+ def hash
120
+ [attributes, type].hash
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,102 @@
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
+ Contact: support@datadoghq.com
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
+ # Patch request for an incident integration metadata.
21
+ class IncidentIntegrationMetadataPatchRequest
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Incident integration metadata data for a patch request.
29
+ attr_reader :data
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'data' => :'data'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'data' => :'IncidentIntegrationMetadataPatchData'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param attributes [Hash] Model attributes in the form of hash
49
+ # @!visibility private
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentIntegrationMetadataPatchRequest` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IncidentIntegrationMetadataPatchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'data')
64
+ self.data = attributes[:'data']
65
+ 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 @data.nil?
73
+ true
74
+ end
75
+
76
+ # Custom attribute writer method with validation
77
+ # @param data [Object] Object to be assigned
78
+ # @!visibility private
79
+ def data=(data)
80
+ if data.nil?
81
+ fail ArgumentError, 'invalid value for "data", data cannot be nil.'
82
+ end
83
+ @data = data
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param o [Object] Object to be compared
88
+ # @!visibility private
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ data == o.data
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ # @!visibility private
98
+ def hash
99
+ [data].hash
100
+ end
101
+ end
102
+ end