datadog_api_client 2.1.0 → 2.2.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 (130) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/poetry.lock +21 -14
  4. data/.generator/pyproject.toml +1 -1
  5. data/.generator/schemas/v1/openapi.yaml +558 -8
  6. data/.generator/schemas/v2/openapi.yaml +973 -253
  7. data/.generator/src/generator/templates/api_client.j2 +5 -1
  8. data/.generator/src/generator/templates/configuration.j2 +17 -0
  9. data/.github/workflows/test.yml +3 -0
  10. data/.pre-commit-config.yaml +1 -1
  11. data/CHANGELOG.md +26 -0
  12. data/README.md +11 -0
  13. data/examples/v1/dashboards/CreateDashboard_1423904722.rb +38 -0
  14. data/examples/v1/dashboards/CreateDashboard_2652180930.rb +43 -0
  15. data/examples/v1/dashboards/CreateDashboard_2850365602.rb +55 -0
  16. data/examples/v1/dashboards/CreateDashboard_3117424216.rb +33 -0
  17. data/examples/v1/dashboards/CreateDashboard_3669695268.rb +50 -0
  18. data/examples/v1/dashboards/CreateDashboard_858397694.rb +41 -0
  19. data/examples/v1/synthetics/CreateGlobalVariable_1068962881.rb +1 -1
  20. data/examples/v2/incidents/ListIncidentAttachments.rb +8 -0
  21. data/examples/v2/incidents/ListIncidentAttachments_2457735435.rb +11 -0
  22. data/examples/v2/incidents/UpdateIncidentAttachments.rb +38 -0
  23. data/examples/v2/incidents/UpdateIncidentAttachments_3881702075.rb +26 -0
  24. data/examples/v2/metrics/ListActiveMetricConfigurations.rb +5 -0
  25. data/examples/v2/metrics/ListTagConfigurations.rb +1 -1
  26. data/examples/v2/metrics/ListTagConfigurations_265033704.rb +8 -0
  27. data/examples/v2/metrics/{ListTagConfigurations_103226315.rb → ListTagConfigurations_2739018321.rb} +1 -1
  28. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule.rb +3 -2
  29. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_461183901.rb +2 -2
  30. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_498211763.rb +2 -2
  31. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_914562040.rb +50 -0
  32. data/examples/v2/security-monitoring/GetSecurityMonitoringSignal.rb +5 -0
  33. data/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.rb +2 -1
  34. data/examples/v2/usage-metering/GetEstimatedCostByOrg.rb +1 -4
  35. data/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.rb +2 -4
  36. data/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.rb +2 -4
  37. data/examples/v2/usage-metering/GetHistoricalCostByOrg.rb +8 -0
  38. data/generate.sh +30 -0
  39. data/lib/datadog_api_client/api_client.rb +5 -1
  40. data/lib/datadog_api_client/configuration.rb +20 -1
  41. data/lib/datadog_api_client/inflector.rb +51 -1
  42. data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +3 -1
  43. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +5 -5
  44. data/lib/datadog_api_client/v1/models/dashboard_template_variable.rb +14 -2
  45. data/lib/datadog_api_client/v1/models/dashboard_template_variable_preset_value.rb +28 -5
  46. data/lib/datadog_api_client/v1/models/formula_and_function_event_query_definition.rb +14 -4
  47. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -0
  48. data/lib/datadog_api_client/v1/models/list_stream_query.rb +14 -4
  49. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -0
  50. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +21 -1
  51. data/lib/datadog_api_client/v1/models/search_service_level_objective.rb +111 -0
  52. data/lib/datadog_api_client/v1/models/search_service_level_objective_attributes.rb +286 -0
  53. data/lib/datadog_api_client/v1/models/search_service_level_objective_data.rb +134 -0
  54. data/lib/datadog_api_client/v1/models/search_slo_query.rb +137 -0
  55. data/lib/datadog_api_client/v1/models/search_slo_response_data_attributes.rb +8 -8
  56. data/lib/datadog_api_client/v1/models/search_slo_response_links.rb +2 -0
  57. data/lib/datadog_api_client/v1/models/search_slo_threshold.rb +184 -0
  58. data/lib/datadog_api_client/v1/models/search_slo_timeframe.rb +28 -0
  59. data/lib/datadog_api_client/v1/models/slo_creator.rb +131 -0
  60. data/lib/datadog_api_client/v1/models/slo_list_widget_definition.rb +185 -0
  61. data/lib/datadog_api_client/v1/models/slo_list_widget_definition_type.rb +26 -0
  62. data/lib/datadog_api_client/v1/models/slo_list_widget_query.rb +149 -0
  63. data/lib/datadog_api_client/v1/models/slo_list_widget_request.rb +143 -0
  64. data/lib/datadog_api_client/v1/models/slo_list_widget_request_type.rb +26 -0
  65. data/lib/datadog_api_client/v1/models/slo_overall_statuses.rb +174 -0
  66. data/lib/datadog_api_client/v1/models/slo_raw_error_budget_remaining.rb +121 -0
  67. data/lib/datadog_api_client/v1/models/synthetics_assertion_operator.rb +1 -0
  68. data/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb +193 -0
  69. data/lib/datadog_api_client/v1/models/topology_map_widget_definition_type.rb +26 -0
  70. data/lib/datadog_api_client/v1/models/topology_query.rb +144 -0
  71. data/lib/datadog_api_client/v1/models/topology_query_data_source.rb +27 -0
  72. data/lib/datadog_api_client/v1/models/topology_request.rb +121 -0
  73. data/lib/datadog_api_client/v1/models/topology_request_type.rb +26 -0
  74. data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +2 -0
  75. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +2 -0
  76. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +21 -1
  77. data/lib/datadog_api_client/v1/models/usage_fargate_hour.rb +11 -1
  78. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
  79. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +11 -1
  80. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
  81. data/lib/datadog_api_client/v1/models/widget_definition.rb +3 -1
  82. data/lib/datadog_api_client/v2/api/incident_services_api.rb +2 -2
  83. data/lib/datadog_api_client/v2/api/incident_teams_api.rb +2 -2
  84. data/lib/datadog_api_client/v2/api/incidents_api.rb +155 -0
  85. data/lib/datadog_api_client/v2/api/metrics_api.rb +76 -8
  86. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +65 -0
  87. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +83 -17
  88. data/lib/datadog_api_client/v2/models/incident_attachment_attachment_type.rb +27 -0
  89. data/lib/datadog_api_client/v2/models/incident_attachment_attributes.rb +63 -0
  90. data/lib/datadog_api_client/v2/models/incident_attachment_data.rb +187 -0
  91. data/lib/datadog_api_client/v2/models/incident_attachment_link_attachment_type.rb +26 -0
  92. data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes.rb +145 -0
  93. data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes_attachment_object.rb +143 -0
  94. data/lib/datadog_api_client/v2/models/incident_attachment_postmortem_attachment_type.rb +26 -0
  95. data/lib/datadog_api_client/v2/models/incident_attachment_postmortem_attributes.rb +145 -0
  96. data/lib/datadog_api_client/v2/models/incident_attachment_related_object.rb +26 -0
  97. data/lib/datadog_api_client/v2/models/incident_attachment_relationships.rb +111 -0
  98. data/lib/datadog_api_client/v2/models/incident_attachment_type.rb +26 -0
  99. data/lib/datadog_api_client/v2/models/incident_attachment_update_attributes.rb +63 -0
  100. data/lib/datadog_api_client/v2/models/incident_attachment_update_data.rb +144 -0
  101. data/lib/datadog_api_client/v2/models/incident_attachment_update_request.rb +127 -0
  102. data/lib/datadog_api_client/v2/models/incident_attachment_update_response.rb +137 -0
  103. data/lib/datadog_api_client/v2/models/incident_attachments_postmortem_attributes_attachment_object.rb +143 -0
  104. data/lib/datadog_api_client/v2/models/incident_attachments_response.rb +136 -0
  105. data/lib/datadog_api_client/v2/models/incident_attachments_response_included_item.rb +62 -0
  106. data/lib/datadog_api_client/v2/models/incident_related_object.rb +1 -0
  107. data/lib/datadog_api_client/v2/models/incident_response_attributes.rb +1 -11
  108. data/lib/datadog_api_client/v2/models/incident_response_included_item.rb +2 -1
  109. data/lib/datadog_api_client/v2/models/incident_response_relationships.rb +14 -14
  110. data/lib/datadog_api_client/v2/models/metric_active_configuration_type.rb +26 -0
  111. data/lib/datadog_api_client/v2/models/metric_suggested_tags_and_aggregations.rb +133 -0
  112. data/lib/datadog_api_client/v2/models/metric_suggested_tags_and_aggregations_response.rb +111 -0
  113. data/lib/datadog_api_client/v2/models/metric_suggested_tags_attributes.rb +125 -0
  114. data/lib/datadog_api_client/v2/models/relationship_to_incident_attachment.rb +124 -0
  115. data/lib/datadog_api_client/v2/models/relationship_to_incident_attachment_data.rb +145 -0
  116. data/lib/datadog_api_client/v2/models/security_monitoring_rule_create_payload.rb +36 -248
  117. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query.rb +36 -151
  118. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_aggregation.rb +1 -0
  119. data/lib/datadog_api_client/v2/models/security_monitoring_rule_response.rb +37 -253
  120. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_create_payload.rb +275 -0
  121. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_query.rb +187 -0
  122. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response.rb +279 -0
  123. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_type.rb +26 -0
  124. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +275 -0
  125. data/lib/datadog_api_client/v2/models/{security_monitoring_rule_query_create.rb → security_monitoring_standard_rule_query.rb} +3 -3
  126. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +279 -0
  127. data/lib/datadog_api_client/version.rb +1 -1
  128. metadata +70 -6
  129. data/Makefile +0 -7
  130. data/examples/v2/metrics/ListTagConfigurations_1799362914.rb +0 -8
@@ -0,0 +1,185 @@
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://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::V1
20
+ # Use the SLO List widget to track your SLOs (Service Level Objectives) on dashboards.
21
+ class SLOListWidgetDefinition
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Array of one request object to display in the widget.
29
+ attr_accessor :requests
30
+
31
+ # Title of the widget.
32
+ attr_accessor :title
33
+
34
+ # How to align the text on the widget.
35
+ attr_accessor :title_align
36
+
37
+ # Size of the title.
38
+ attr_accessor :title_size
39
+
40
+ # Type of the SLO List widget.
41
+ attr_accessor :type
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ # @!visibility private
45
+ def self.attribute_map
46
+ {
47
+ :'requests' => :'requests',
48
+ :'title' => :'title',
49
+ :'title_align' => :'title_align',
50
+ :'title_size' => :'title_size',
51
+ :'type' => :'type'
52
+ }
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ # @!visibility private
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ # @!visibility private
63
+ def self.openapi_types
64
+ {
65
+ :'requests' => :'Array<SLOListWidgetRequest>',
66
+ :'title' => :'String',
67
+ :'title_align' => :'WidgetTextAlign',
68
+ :'title_size' => :'String',
69
+ :'type' => :'SLOListWidgetDefinitionType'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ # @!visibility private
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param attributes [Hash] Model attributes in the form of hash
82
+ # @!visibility private
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SLOListWidgetDefinition` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!self.class.attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SLOListWidgetDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'requests')
97
+ if (value = attributes[:'requests']).is_a?(Array)
98
+ self.requests = value
99
+ end
100
+ end
101
+
102
+ if attributes.key?(:'title')
103
+ self.title = attributes[:'title']
104
+ end
105
+
106
+ if attributes.key?(:'title_align')
107
+ self.title_align = attributes[:'title_align']
108
+ end
109
+
110
+ if attributes.key?(:'title_size')
111
+ self.title_size = attributes[:'title_size']
112
+ end
113
+
114
+ if attributes.key?(:'type')
115
+ self.type = attributes[:'type']
116
+ else
117
+ self.type = 'slo_list'
118
+ end
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ # @!visibility private
124
+ def valid?
125
+ return false if @requests.nil?
126
+ return false if @requests.length > 1
127
+ return false if @requests.length < 1
128
+ return false if @type.nil?
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method with validation
133
+ # @param requests [Object] Object to be assigned
134
+ # @!visibility private
135
+ def requests=(requests)
136
+ if requests.nil?
137
+ fail ArgumentError, 'invalid value for "requests", requests cannot be nil.'
138
+ end
139
+ if requests.length > 1
140
+ fail ArgumentError, 'invalid value for "requests", number of items must be less than or equal to 1.'
141
+ end
142
+ if requests.length < 1
143
+ fail ArgumentError, 'invalid value for "requests", number of items must be greater than or equal to 1.'
144
+ end
145
+ @requests = requests
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param type [Object] Object to be assigned
150
+ # @!visibility private
151
+ def type=(type)
152
+ if type.nil?
153
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
154
+ end
155
+ @type = type
156
+ end
157
+
158
+ # Checks equality by comparing each attribute.
159
+ # @param o [Object] Object to be compared
160
+ # @!visibility private
161
+ def ==(o)
162
+ return true if self.equal?(o)
163
+ self.class == o.class &&
164
+ requests == o.requests &&
165
+ title == o.title &&
166
+ title_align == o.title_align &&
167
+ title_size == o.title_size &&
168
+ type == o.type
169
+ end
170
+
171
+ # @see the `==` method
172
+ # @param o [Object] Object to be compared
173
+ # @!visibility private
174
+ def eql?(o)
175
+ self == o
176
+ end
177
+
178
+ # Calculates hash code according to all attributes.
179
+ # @return [Integer] Hash code
180
+ # @!visibility private
181
+ def hash
182
+ [requests, title, title_align, title_size, type].hash
183
+ end
184
+ end
185
+ end
@@ -0,0 +1,26 @@
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://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::V1
20
+ # Type of the SLO List widget.
21
+ class SLOListWidgetDefinitionType
22
+ include BaseEnumModel
23
+
24
+ SLO_LIST = "slo_list".freeze
25
+ end
26
+ end
@@ -0,0 +1,149 @@
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://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::V1
20
+ # Updated SLO List widget.
21
+ class SLOListWidgetQuery
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Maximum number of results to display in the table.
29
+ attr_accessor :limit
30
+
31
+ # Widget query.
32
+ attr_accessor :query_string
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'limit' => :'limit',
39
+ :'query_string' => :'query_string'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ # @!visibility private
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ # @!visibility private
51
+ def self.openapi_types
52
+ {
53
+ :'limit' => :'Integer',
54
+ :'query_string' => :'String'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ # @!visibility private
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param attributes [Hash] Model attributes in the form of hash
67
+ # @!visibility private
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SLOListWidgetQuery` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SLOListWidgetQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'limit')
82
+ self.limit = attributes[:'limit']
83
+ else
84
+ self.limit = 100
85
+ end
86
+
87
+ if attributes.key?(:'query_string')
88
+ self.query_string = attributes[:'query_string']
89
+ end
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ # @!visibility private
95
+ def valid?
96
+ return false if !@limit.nil? && @limit > 100
97
+ return false if !@limit.nil? && @limit < 1
98
+ return false if @query_string.nil?
99
+ true
100
+ end
101
+
102
+ # Custom attribute writer method with validation
103
+ # @param limit [Object] Object to be assigned
104
+ # @!visibility private
105
+ def limit=(limit)
106
+ if !limit.nil? && limit > 100
107
+ fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 100.'
108
+ end
109
+ if !limit.nil? && limit < 1
110
+ fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.'
111
+ end
112
+ @limit = limit
113
+ end
114
+
115
+ # Custom attribute writer method with validation
116
+ # @param query_string [Object] Object to be assigned
117
+ # @!visibility private
118
+ def query_string=(query_string)
119
+ if query_string.nil?
120
+ fail ArgumentError, 'invalid value for "query_string", query_string cannot be nil.'
121
+ end
122
+ @query_string = query_string
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param o [Object] Object to be compared
127
+ # @!visibility private
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ limit == o.limit &&
132
+ query_string == o.query_string
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param o [Object] Object to be compared
137
+ # @!visibility private
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ # @!visibility private
145
+ def hash
146
+ [limit, query_string].hash
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,143 @@
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://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::V1
20
+ # Updated SLO List widget.
21
+ class SLOListWidgetRequest
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Updated SLO List widget.
29
+ attr_accessor :query
30
+
31
+ # Widget request type.
32
+ attr_accessor :request_type
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'query' => :'query',
39
+ :'request_type' => :'request_type'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ # @!visibility private
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ # @!visibility private
51
+ def self.openapi_types
52
+ {
53
+ :'query' => :'SLOListWidgetQuery',
54
+ :'request_type' => :'SLOListWidgetRequestType'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ # @!visibility private
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param attributes [Hash] Model attributes in the form of hash
67
+ # @!visibility private
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SLOListWidgetRequest` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SLOListWidgetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'query')
82
+ self.query = attributes[:'query']
83
+ end
84
+
85
+ if attributes.key?(:'request_type')
86
+ self.request_type = attributes[:'request_type']
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 @query.nil?
95
+ return false if @request_type.nil?
96
+ true
97
+ end
98
+
99
+ # Custom attribute writer method with validation
100
+ # @param query [Object] Object to be assigned
101
+ # @!visibility private
102
+ def query=(query)
103
+ if query.nil?
104
+ fail ArgumentError, 'invalid value for "query", query cannot be nil.'
105
+ end
106
+ @query = query
107
+ end
108
+
109
+ # Custom attribute writer method with validation
110
+ # @param request_type [Object] Object to be assigned
111
+ # @!visibility private
112
+ def request_type=(request_type)
113
+ if request_type.nil?
114
+ fail ArgumentError, 'invalid value for "request_type", request_type cannot be nil.'
115
+ end
116
+ @request_type = request_type
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param o [Object] Object to be compared
121
+ # @!visibility private
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ query == o.query &&
126
+ request_type == o.request_type
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param o [Object] Object to be compared
131
+ # @!visibility private
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ # @!visibility private
139
+ def hash
140
+ [query, request_type].hash
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,26 @@
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://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::V1
20
+ # Widget request type.
21
+ class SLOListWidgetRequestType
22
+ include BaseEnumModel
23
+
24
+ SLO_LIST = "slo_list".freeze
25
+ end
26
+ end
@@ -0,0 +1,174 @@
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://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::V1
20
+ # Overall status of the SLO by timeframes.
21
+ class SLOOverallStatuses
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Error message if SLO status or error budget could not be calculated.
29
+ attr_accessor :error
30
+
31
+ # timestamp (UNIX time in seconds) of when the SLO status and error budget
32
+ # were calculated.
33
+ attr_accessor :indexed_at
34
+
35
+ # Error budget remaining for an SLO.
36
+ attr_accessor :raw_error_budget_remaining
37
+
38
+ # The amount of decimal places the SLI value is accurate to.
39
+ attr_accessor :span_precision
40
+
41
+ # The status of the SLO.
42
+ attr_accessor :status
43
+
44
+ # The target of the SLO.
45
+ attr_accessor :target
46
+
47
+ # The SLO time window options.
48
+ attr_accessor :timeframe
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ # @!visibility private
52
+ def self.attribute_map
53
+ {
54
+ :'error' => :'error',
55
+ :'indexed_at' => :'indexed_at',
56
+ :'raw_error_budget_remaining' => :'raw_error_budget_remaining',
57
+ :'span_precision' => :'span_precision',
58
+ :'status' => :'status',
59
+ :'target' => :'target',
60
+ :'timeframe' => :'timeframe'
61
+ }
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ # @!visibility private
66
+ def self.acceptable_attributes
67
+ attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ # @!visibility private
72
+ def self.openapi_types
73
+ {
74
+ :'error' => :'String',
75
+ :'indexed_at' => :'Integer',
76
+ :'raw_error_budget_remaining' => :'SLORawErrorBudgetRemaining',
77
+ :'span_precision' => :'Integer',
78
+ :'status' => :'Float',
79
+ :'target' => :'Float',
80
+ :'timeframe' => :'SLOTimeframe'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ # @!visibility private
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ :'error',
89
+ :'status',
90
+ ])
91
+ end
92
+
93
+ # Initializes the object
94
+ # @param attributes [Hash] Model attributes in the form of hash
95
+ # @!visibility private
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SLOOverallStatuses` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!self.class.attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SLOOverallStatuses`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'error')
110
+ self.error = attributes[:'error']
111
+ end
112
+
113
+ if attributes.key?(:'indexed_at')
114
+ self.indexed_at = attributes[:'indexed_at']
115
+ end
116
+
117
+ if attributes.key?(:'raw_error_budget_remaining')
118
+ self.raw_error_budget_remaining = attributes[:'raw_error_budget_remaining']
119
+ end
120
+
121
+ if attributes.key?(:'span_precision')
122
+ self.span_precision = attributes[:'span_precision']
123
+ end
124
+
125
+ if attributes.key?(:'status')
126
+ self.status = attributes[:'status']
127
+ end
128
+
129
+ if attributes.key?(:'target')
130
+ self.target = attributes[:'target']
131
+ end
132
+
133
+ if attributes.key?(:'timeframe')
134
+ self.timeframe = attributes[:'timeframe']
135
+ end
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ # @!visibility private
141
+ def valid?
142
+ true
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param o [Object] Object to be compared
147
+ # @!visibility private
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ error == o.error &&
152
+ indexed_at == o.indexed_at &&
153
+ raw_error_budget_remaining == o.raw_error_budget_remaining &&
154
+ span_precision == o.span_precision &&
155
+ status == o.status &&
156
+ target == o.target &&
157
+ timeframe == o.timeframe
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param o [Object] Object to be compared
162
+ # @!visibility private
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ # @!visibility private
170
+ def hash
171
+ [error, indexed_at, raw_error_budget_remaining, span_precision, status, target, timeframe].hash
172
+ end
173
+ end
174
+ end