datadog_api_client 1.10.0 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +715 -44
  4. data/.generator/schemas/v2/openapi.yaml +458 -44
  5. data/.generator/src/generator/formatter.py +14 -0
  6. data/.github/workflows/test_integration.yml +0 -7
  7. data/CHANGELOG.md +34 -0
  8. data/examples/v1/dashboards/CreateDashboard_1442588603.rb +61 -0
  9. data/examples/v1/dashboards/CreateDashboard_252716965.rb +52 -0
  10. data/examples/v1/dashboards/CreateDashboard_3882428227.rb +60 -0
  11. data/examples/v1/metrics/SubmitDistributionPoints.rb +22 -0
  12. data/examples/v1/metrics/SubmitDistributionPoints_3109558960.rb +25 -0
  13. data/examples/v1/organizations/DowngradeOrg.rb +5 -0
  14. data/examples/v1/organizations/UpdateOrg.rb +1 -0
  15. data/examples/v1/service-level-objectives/SearchSLO.rb +16 -0
  16. data/examples/v1/snapshots/GetGraphSnapshot.rb +2 -0
  17. data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +3 -0
  18. data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +3 -0
  19. data/examples/v1/synthetics/UpdateBrowserTest.rb +3 -0
  20. data/examples/v2/metrics/CreateTagConfiguration.rb +0 -3
  21. data/examples/v2/metrics/DeleteTagConfiguration.rb +0 -3
  22. data/examples/v2/metrics/ListTagConfigurationByName.rb +0 -3
  23. data/examples/v2/metrics/ListTagConfigurations.rb +0 -3
  24. data/examples/v2/metrics/ListTagConfigurations_103226315.rb +0 -3
  25. data/examples/v2/metrics/ListTagConfigurations_1799362914.rb +0 -3
  26. data/examples/v2/metrics/UpdateTagConfiguration.rb +0 -3
  27. data/examples/v2/opsgenie-integration/CreateOpsgenieService.rb +16 -0
  28. data/examples/v2/opsgenie-integration/DeleteOpsgenieService.rb +8 -0
  29. data/examples/v2/opsgenie-integration/GetOpsgenieService.rb +8 -0
  30. data/examples/v2/opsgenie-integration/ListOpsgenieServices.rb +5 -0
  31. data/examples/v2/opsgenie-integration/UpdateOpsgenieService.rb +21 -0
  32. data/examples/v2/security-monitoring/ListSecurityMonitoringSignals.rb +0 -3
  33. data/examples/v2/security-monitoring/SearchSecurityMonitoringSignals.rb +0 -3
  34. data/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.rb +3 -0
  35. data/examples/v2/usage-metering/GetEstimatedCostByOrg.rb +5 -0
  36. data/examples/v2/usage-metering/GetEstimatedCostByOrg_1171921972.rb +9 -0
  37. data/examples/v2/usage-metering/GetEstimatedCostByOrg_627383212.rb +9 -0
  38. data/lib/datadog_api_client/v1/api/metrics_api.rb +81 -0
  39. data/lib/datadog_api_client/v1/api/organizations_api.rb +74 -1
  40. data/lib/datadog_api_client/v1/api/security_monitoring_api.rb +2 -2
  41. data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +78 -4
  42. data/lib/datadog_api_client/v1/api/snapshots_api.rb +4 -0
  43. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +9 -5
  44. data/lib/datadog_api_client/v1/configuration.rb +51 -0
  45. data/lib/datadog_api_client/v1/models/distribution_point_item.rb +63 -0
  46. data/lib/datadog_api_client/v1/models/distribution_points_content_encoding.rb +26 -0
  47. data/lib/datadog_api_client/v1/models/distribution_points_payload.rb +124 -0
  48. data/lib/datadog_api_client/v1/models/distribution_points_series.rb +179 -0
  49. data/lib/datadog_api_client/v1/models/distribution_points_type.rb +26 -0
  50. data/lib/datadog_api_client/v1/models/distribution_widget_histogram_request_query.rb +64 -0
  51. data/lib/datadog_api_client/v1/models/distribution_widget_histogram_request_type.rb +26 -0
  52. data/lib/datadog_api_client/v1/models/distribution_widget_request.rb +21 -1
  53. data/lib/datadog_api_client/v1/models/formula_and_function_apm_resource_stat_name.rb +1 -0
  54. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +2 -0
  55. data/lib/datadog_api_client/v1/models/ip_prefixes_synthetics_private_locations.rb +125 -0
  56. data/lib/datadog_api_client/v1/models/ip_ranges.rb +11 -1
  57. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +4 -0
  58. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +41 -1
  59. data/lib/datadog_api_client/v1/models/org_downgraded_response.rb +111 -0
  60. data/lib/datadog_api_client/v1/models/organization.rb +14 -4
  61. data/lib/datadog_api_client/v1/models/search_slo_response.rb +131 -0
  62. data/lib/datadog_api_client/v1/models/search_slo_response_data.rb +121 -0
  63. data/lib/datadog_api_client/v1/models/search_slo_response_data_attributes.rb +123 -0
  64. data/lib/datadog_api_client/v1/models/search_slo_response_data_attributes_facets.rb +197 -0
  65. data/lib/datadog_api_client/v1/models/search_slo_response_data_attributes_facets_object_int.rb +121 -0
  66. data/lib/datadog_api_client/v1/models/search_slo_response_data_attributes_facets_object_string.rb +121 -0
  67. data/lib/datadog_api_client/v1/models/search_slo_response_links.rb +151 -0
  68. data/lib/datadog_api_client/v1/models/search_slo_response_meta.rb +111 -0
  69. data/lib/datadog_api_client/v1/models/search_slo_response_meta_page.rb +181 -0
  70. data/lib/datadog_api_client/v1/models/service_level_objective.rb +3 -3
  71. data/lib/datadog_api_client/v1/models/service_level_objective_query.rb +1 -1
  72. data/lib/datadog_api_client/v1/models/service_level_objective_request.rb +3 -3
  73. data/lib/datadog_api_client/v1/models/slo_history_metrics.rb +1 -1
  74. data/lib/datadog_api_client/v1/models/slo_response_data.rb +1 -1
  75. data/lib/datadog_api_client/v1/models/synthetics_api_test.rb +11 -0
  76. data/lib/datadog_api_client/v1/models/synthetics_browser_test.rb +11 -0
  77. data/lib/datadog_api_client/v1/models/synthetics_core_web_vitals.rb +2 -2
  78. data/lib/datadog_api_client/v1/models/synthetics_test_ci_options.rb +111 -0
  79. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +11 -1
  80. data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +4 -0
  81. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +4 -0
  82. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +41 -1
  83. data/lib/datadog_api_client/v1/models/usage_billable_summary_keys.rb +474 -4
  84. data/lib/datadog_api_client/v1.rb +19 -0
  85. data/lib/datadog_api_client/v2/api/cloud_workload_security_api.rb +1 -1
  86. data/lib/datadog_api_client/v2/api/metrics_api.rb +0 -2
  87. data/lib/datadog_api_client/v2/api/opsgenie_integration_api.rb +395 -0
  88. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +76 -0
  89. data/lib/datadog_api_client/v2/configuration.rb +0 -7
  90. data/lib/datadog_api_client/v2/models/intake_payload_accepted.rb +10 -8
  91. data/lib/datadog_api_client/v2/models/metric_tag_configuration_create_attributes.rb +0 -2
  92. data/lib/datadog_api_client/v2/models/metric_tag_configuration_update_attributes.rb +0 -2
  93. data/lib/datadog_api_client/v2/models/opsgenie_service_create_attributes.rb +174 -0
  94. data/lib/datadog_api_client/v2/models/opsgenie_service_create_data.rb +145 -0
  95. data/lib/datadog_api_client/v2/models/opsgenie_service_create_request.rb +122 -0
  96. data/lib/datadog_api_client/v2/models/opsgenie_service_region_type.rb +28 -0
  97. data/lib/datadog_api_client/v2/models/opsgenie_service_response.rb +122 -0
  98. data/lib/datadog_api_client/v2/models/opsgenie_service_response_attributes.rb +132 -0
  99. data/lib/datadog_api_client/v2/models/opsgenie_service_response_data.rb +166 -0
  100. data/lib/datadog_api_client/v2/models/opsgenie_service_type.rb +26 -0
  101. data/lib/datadog_api_client/v2/models/opsgenie_service_update_attributes.rb +142 -0
  102. data/lib/datadog_api_client/v2/models/opsgenie_service_update_data.rb +166 -0
  103. data/lib/datadog_api_client/v2/models/opsgenie_service_update_request.rb +122 -0
  104. data/lib/datadog_api_client/v2/models/opsgenie_services_response.rb +124 -0
  105. data/lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options.rb +30 -4
  106. data/lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_learning_method.rb +27 -0
  107. data/lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options_learning_threshold.rb +27 -0
  108. data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +13 -1
  109. data/lib/datadog_api_client/v2.rb +15 -0
  110. data/lib/datadog_api_client/version.rb +1 -1
  111. metadata +51 -2
@@ -0,0 +1,132 @@
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
+ # The attributes from an Opsgenie service response.
21
+ class OpsgenieServiceResponseAttributes
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # The custom URL for a custom region.
29
+ attr_accessor :custom_url
30
+
31
+ # The name for the Opsgenie service.
32
+ attr_accessor :name
33
+
34
+ # The region for the Opsgenie service.
35
+ attr_accessor :region
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ # @!visibility private
39
+ def self.attribute_map
40
+ {
41
+ :'custom_url' => :'custom_url',
42
+ :'name' => :'name',
43
+ :'region' => :'region'
44
+ }
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ # @!visibility private
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ # @!visibility private
55
+ def self.openapi_types
56
+ {
57
+ :'custom_url' => :'String',
58
+ :'name' => :'String',
59
+ :'region' => :'OpsgenieServiceRegionType'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ # @!visibility private
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ :'custom_url',
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param attributes [Hash] Model attributes in the form of hash
73
+ # @!visibility private
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OpsgenieServiceResponseAttributes` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::OpsgenieServiceResponseAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'custom_url')
88
+ self.custom_url = attributes[:'custom_url']
89
+ end
90
+
91
+ if attributes.key?(:'name')
92
+ self.name = attributes[:'name']
93
+ end
94
+
95
+ if attributes.key?(:'region')
96
+ self.region = attributes[:'region']
97
+ end
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ # @!visibility private
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param o [Object] Object to be compared
109
+ # @!visibility private
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ custom_url == o.custom_url &&
114
+ name == o.name &&
115
+ region == o.region
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param o [Object] Object to be compared
120
+ # @!visibility private
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ # @!visibility private
128
+ def hash
129
+ [custom_url, name, region].hash
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,166 @@
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
+ # Opsgenie service data from a response.
21
+ class OpsgenieServiceResponseData
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # The attributes from an Opsgenie service response.
29
+ attr_accessor :attributes
30
+
31
+ # The ID of the Opsgenie service.
32
+ attr_accessor :id
33
+
34
+ # Opsgenie service resource type.
35
+ attr_accessor :type
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ # @!visibility private
39
+ def self.attribute_map
40
+ {
41
+ :'attributes' => :'attributes',
42
+ :'id' => :'id',
43
+ :'type' => :'type'
44
+ }
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ # @!visibility private
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ # @!visibility private
55
+ def self.openapi_types
56
+ {
57
+ :'attributes' => :'OpsgenieServiceResponseAttributes',
58
+ :'id' => :'String',
59
+ :'type' => :'OpsgenieServiceType'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ # @!visibility private
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param attributes [Hash] Model attributes in the form of hash
72
+ # @!visibility private
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OpsgenieServiceResponseData` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::OpsgenieServiceResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'attributes')
87
+ self.attributes = attributes[:'attributes']
88
+ end
89
+
90
+ if attributes.key?(:'id')
91
+ self.id = attributes[:'id']
92
+ end
93
+
94
+ if attributes.key?(:'type')
95
+ self.type = attributes[:'type']
96
+ else
97
+ self.type = 'opsgenie-service'
98
+ end
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ # @!visibility private
104
+ def valid?
105
+ return false if @attributes.nil?
106
+ return false if @id.nil?
107
+ return false if @type.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param attributes [Object] Object to be assigned
113
+ # @!visibility private
114
+ def attributes=(attributes)
115
+ if attributes.nil?
116
+ fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
117
+ end
118
+ @attributes = attributes
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param id [Object] Object to be assigned
123
+ # @!visibility private
124
+ def id=(id)
125
+ if id.nil?
126
+ fail ArgumentError, 'invalid value for "id", id cannot be nil.'
127
+ end
128
+ @id = id
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param type [Object] Object to be assigned
133
+ # @!visibility private
134
+ def type=(type)
135
+ if type.nil?
136
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
137
+ end
138
+ @type = type
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param o [Object] Object to be compared
143
+ # @!visibility private
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ attributes == o.attributes &&
148
+ id == o.id &&
149
+ type == o.type
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param o [Object] Object to be compared
154
+ # @!visibility private
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ # @!visibility private
162
+ def hash
163
+ [attributes, id, type].hash
164
+ end
165
+ end
166
+ end
@@ -0,0 +1,26 @@
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
+ # Opsgenie service resource type.
21
+ class OpsgenieServiceType
22
+ include BaseEnumModel
23
+
24
+ OPSGENIE_SERVICE = "opsgenie-service".freeze
25
+ end
26
+ end
@@ -0,0 +1,142 @@
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
+ # The Opsgenie service attributes for an update request.
21
+ class OpsgenieServiceUpdateAttributes
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # The custom URL for a custom region.
29
+ attr_accessor :custom_url
30
+
31
+ # The name for the Opsgenie service.
32
+ attr_accessor :name
33
+
34
+ # The Opsgenie API key for your Opsgenie service.
35
+ attr_accessor :opsgenie_api_key
36
+
37
+ # The region for the Opsgenie service.
38
+ attr_accessor :region
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ # @!visibility private
42
+ def self.attribute_map
43
+ {
44
+ :'custom_url' => :'custom_url',
45
+ :'name' => :'name',
46
+ :'opsgenie_api_key' => :'opsgenie_api_key',
47
+ :'region' => :'region'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ # @!visibility private
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ # @!visibility private
59
+ def self.openapi_types
60
+ {
61
+ :'custom_url' => :'String',
62
+ :'name' => :'String',
63
+ :'opsgenie_api_key' => :'String',
64
+ :'region' => :'OpsgenieServiceRegionType'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ # @!visibility private
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'custom_url',
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param attributes [Hash] Model attributes in the form of hash
78
+ # @!visibility private
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OpsgenieServiceUpdateAttributes` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::OpsgenieServiceUpdateAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'custom_url')
93
+ self.custom_url = attributes[:'custom_url']
94
+ end
95
+
96
+ if attributes.key?(:'name')
97
+ self.name = attributes[:'name']
98
+ end
99
+
100
+ if attributes.key?(:'opsgenie_api_key')
101
+ self.opsgenie_api_key = attributes[:'opsgenie_api_key']
102
+ end
103
+
104
+ if attributes.key?(:'region')
105
+ self.region = attributes[:'region']
106
+ end
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ # @!visibility private
112
+ def valid?
113
+ true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param o [Object] Object to be compared
118
+ # @!visibility private
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ custom_url == o.custom_url &&
123
+ name == o.name &&
124
+ opsgenie_api_key == o.opsgenie_api_key &&
125
+ region == o.region
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param o [Object] Object to be compared
130
+ # @!visibility private
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ # @!visibility private
138
+ def hash
139
+ [custom_url, name, opsgenie_api_key, region].hash
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,166 @@
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
+ # Opsgenie service for an update request.
21
+ class OpsgenieServiceUpdateData
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # The Opsgenie service attributes for an update request.
29
+ attr_accessor :attributes
30
+
31
+ # The ID of the Opsgenie service.
32
+ attr_accessor :id
33
+
34
+ # Opsgenie service resource type.
35
+ attr_accessor :type
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ # @!visibility private
39
+ def self.attribute_map
40
+ {
41
+ :'attributes' => :'attributes',
42
+ :'id' => :'id',
43
+ :'type' => :'type'
44
+ }
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ # @!visibility private
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ # @!visibility private
55
+ def self.openapi_types
56
+ {
57
+ :'attributes' => :'OpsgenieServiceUpdateAttributes',
58
+ :'id' => :'String',
59
+ :'type' => :'OpsgenieServiceType'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ # @!visibility private
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param attributes [Hash] Model attributes in the form of hash
72
+ # @!visibility private
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OpsgenieServiceUpdateData` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::OpsgenieServiceUpdateData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'attributes')
87
+ self.attributes = attributes[:'attributes']
88
+ end
89
+
90
+ if attributes.key?(:'id')
91
+ self.id = attributes[:'id']
92
+ end
93
+
94
+ if attributes.key?(:'type')
95
+ self.type = attributes[:'type']
96
+ else
97
+ self.type = 'opsgenie-service'
98
+ end
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ # @!visibility private
104
+ def valid?
105
+ return false if @attributes.nil?
106
+ return false if @id.nil?
107
+ return false if @type.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param attributes [Object] Object to be assigned
113
+ # @!visibility private
114
+ def attributes=(attributes)
115
+ if attributes.nil?
116
+ fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
117
+ end
118
+ @attributes = attributes
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param id [Object] Object to be assigned
123
+ # @!visibility private
124
+ def id=(id)
125
+ if id.nil?
126
+ fail ArgumentError, 'invalid value for "id", id cannot be nil.'
127
+ end
128
+ @id = id
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param type [Object] Object to be assigned
133
+ # @!visibility private
134
+ def type=(type)
135
+ if type.nil?
136
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
137
+ end
138
+ @type = type
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param o [Object] Object to be compared
143
+ # @!visibility private
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ attributes == o.attributes &&
148
+ id == o.id &&
149
+ type == o.type
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param o [Object] Object to be compared
154
+ # @!visibility private
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ # @!visibility private
162
+ def hash
163
+ [attributes, id, type].hash
164
+ end
165
+ end
166
+ end