datadog_api_client 2.15.0 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +6 -6
  3. data/.generator/schemas/v1/openapi.yaml +643 -123
  4. data/.generator/schemas/v2/openapi.yaml +1815 -195
  5. data/.generator/src/generator/templates/api_client.j2 +19 -1
  6. data/.generator/src/generator/templates/model_base.j2 +1 -0
  7. data/CHANGELOG.md +30 -0
  8. data/examples/v1/dashboards/CreateDashboard_1754992756.rb +44 -0
  9. data/examples/v1/dashboards/CreateDashboard_2278756614.rb +91 -0
  10. data/examples/v1/monitors/CreateMonitor_1539578087.rb +36 -0
  11. data/examples/v1/synthetics/CreateSyntheticsBrowserTest.rb +1 -1
  12. data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +1 -1
  13. data/examples/v1/synthetics/CreateSyntheticsBrowserTest_397420811.rb +1 -1
  14. data/examples/v1/usage-metering/GetUsageCIApp.rb +4 -1
  15. data/examples/v1/usage-metering/GetUsageCWS.rb +4 -1
  16. data/examples/v1/usage-metering/GetUsageCloudSecurityPostureManagement.rb +1 -1
  17. data/examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb +20 -0
  18. data/examples/v2/apm-retention-filters/DeleteApmRetentionFilter.rb +8 -0
  19. data/examples/v2/apm-retention-filters/GetApmRetentionFilter.rb +8 -0
  20. data/examples/v2/apm-retention-filters/ListApmRetentionFilters.rb +5 -0
  21. data/examples/v2/apm-retention-filters/ReorderApmRetentionFilters.rb +18 -0
  22. data/examples/v2/apm-retention-filters/UpdateApmRetentionFilter.rb +24 -0
  23. data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.rb +0 -3
  24. data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb +0 -8
  25. data/examples/v2/container-images/ListContainerImages.rb +8 -0
  26. data/examples/v2/container-images/ListContainerImages_3088586393.rb +11 -0
  27. data/examples/v2/container-images/ListContainerImages_3974828736.rb +11 -0
  28. data/examples/v2/gcp-integration/CreateGCPSTSAccount_109518525.rb +19 -0
  29. data/examples/v2/powerpack/CreatePowerpack.rb +47 -0
  30. data/examples/v2/powerpack/DeletePowerpack.rb +8 -0
  31. data/examples/v2/powerpack/GetPowerpack.rb +8 -0
  32. data/examples/v2/powerpack/ListPowerpacks.rb +8 -0
  33. data/examples/v2/powerpack/ListPowerpacks_1173755071.rb +8 -0
  34. data/examples/v2/powerpack/UpdatePowerpack.rb +50 -0
  35. data/examples/v2/rum/CreateRUMApplication.rb +1 -1
  36. data/examples/v2/service-accounts/CreateServiceAccountApplicationKey.rb +5 -7
  37. data/examples/v2/service-accounts/DeleteServiceAccountApplicationKey.rb +7 -1
  38. data/examples/v2/service-accounts/GetServiceAccountApplicationKey.rb +7 -1
  39. data/examples/v2/service-accounts/ListServiceAccountApplicationKeys.rb +4 -1
  40. data/examples/v2/service-accounts/UpdateServiceAccountApplicationKey.rb +11 -9
  41. data/examples/v2/service-definition/CreateOrUpdateServiceDefinitions.rb +23 -12
  42. data/examples/v2/service-definition/CreateOrUpdateServiceDefinitions_2621709423.rb +53 -0
  43. data/lib/datadog_api_client/api_client.rb +19 -1
  44. data/lib/datadog_api_client/configuration.rb +1 -1
  45. data/lib/datadog_api_client/inflector.rb +80 -0
  46. data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -20
  47. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +6 -6
  48. data/lib/datadog_api_client/v1/api/webhooks_integration_api.rb +1 -1
  49. data/lib/datadog_api_client/v1/model_base.rb +1 -0
  50. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +6 -4
  51. data/lib/datadog_api_client/v1/models/ip_prefixes_global.rb +94 -0
  52. data/lib/datadog_api_client/v1/models/ip_ranges.rb +11 -1
  53. data/lib/datadog_api_client/v1/models/monitor_options_custom_schedule.rb +82 -0
  54. data/lib/datadog_api_client/v1/models/monitor_options_custom_schedule_recurrence.rb +100 -0
  55. data/lib/datadog_api_client/v1/models/monitor_options_scheduling_options.rb +11 -1
  56. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +4 -0
  57. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +45 -5
  58. data/lib/datadog_api_client/v1/models/powerpack_template_variable_contents.rb +131 -0
  59. data/lib/datadog_api_client/v1/models/powerpack_template_variables.rb +94 -0
  60. data/lib/datadog_api_client/v1/models/powerpack_widget_definition.rb +169 -0
  61. data/lib/datadog_api_client/v1/models/powerpack_widget_definition_type.rb +26 -0
  62. data/lib/datadog_api_client/v1/models/split_config.rb +181 -0
  63. data/lib/datadog_api_client/v1/models/split_config_sort_compute.rb +119 -0
  64. data/lib/datadog_api_client/v1/models/split_dimension.rb +98 -0
  65. data/lib/datadog_api_client/v1/models/split_graph_source_widget_definition.rb +70 -0
  66. data/lib/datadog_api_client/v1/models/split_graph_viz_size.rb +29 -0
  67. data/lib/datadog_api_client/v1/models/split_graph_widget_definition.rb +191 -0
  68. data/lib/datadog_api_client/v1/models/split_graph_widget_definition_type.rb +26 -0
  69. data/lib/datadog_api_client/v1/models/split_sort.rb +108 -0
  70. data/lib/datadog_api_client/v1/models/split_vector_entry_item.rb +125 -0
  71. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +4 -4
  72. data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_hour.rb +8 -8
  73. data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_response.rb +2 -2
  74. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +148 -8
  75. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +148 -8
  76. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +148 -8
  77. data/lib/datadog_api_client/v1/models/widget_definition.rb +8 -6
  78. data/lib/datadog_api_client/v2/api/apm_retention_filters_api.rb +423 -0
  79. data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +4 -10
  80. data/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb +3 -3
  81. data/lib/datadog_api_client/v2/api/container_images_api.rb +129 -0
  82. data/lib/datadog_api_client/v2/api/incidents_api.rb +1 -1
  83. data/lib/datadog_api_client/v2/api/powerpack_api.rb +383 -0
  84. data/lib/datadog_api_client/v2/api/service_definition_api.rb +2 -2
  85. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +1 -1
  86. data/lib/datadog_api_client/v2/model_base.rb +1 -0
  87. data/lib/datadog_api_client/v2/models/apm_retention_filter_type.rb +26 -0
  88. data/lib/datadog_api_client/v2/models/container_image.rb +100 -0
  89. data/lib/datadog_api_client/v2/models/container_image_attributes.rb +261 -0
  90. data/lib/datadog_api_client/v2/models/container_image_flavor.rb +120 -0
  91. data/lib/datadog_api_client/v2/models/container_image_group.rb +110 -0
  92. data/lib/datadog_api_client/v2/models/container_image_group_attributes.rb +100 -0
  93. data/lib/datadog_api_client/v2/models/container_image_group_images_relationships_link.rb +92 -0
  94. data/lib/datadog_api_client/v2/models/container_image_group_relationships.rb +80 -0
  95. data/lib/datadog_api_client/v2/models/container_image_group_relationships_links.rb +80 -0
  96. data/lib/datadog_api_client/v2/models/container_image_group_type.rb +26 -0
  97. data/lib/datadog_api_client/v2/models/container_image_item.rb +63 -0
  98. data/lib/datadog_api_client/v2/models/container_image_meta.rb +80 -0
  99. data/lib/datadog_api_client/v2/models/container_image_meta_page.rb +160 -0
  100. data/lib/datadog_api_client/v2/models/container_image_meta_page_type.rb +26 -0
  101. data/lib/datadog_api_client/v2/models/container_image_type.rb +26 -0
  102. data/lib/datadog_api_client/v2/models/container_image_vulnerabilities.rb +140 -0
  103. data/lib/datadog_api_client/v2/models/container_images_response.rb +102 -0
  104. data/lib/datadog_api_client/v2/models/container_images_response_links.rb +130 -0
  105. data/lib/datadog_api_client/v2/models/data_scalar_column.rb +2 -2
  106. data/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb +13 -1
  107. data/lib/datadog_api_client/v2/models/group_scalar_column.rb +2 -2
  108. data/lib/datadog_api_client/v2/models/list_powerpacks_response.rb +114 -0
  109. data/lib/datadog_api_client/v2/models/powerpack.rb +80 -0
  110. data/lib/datadog_api_client/v2/models/powerpack_attributes.rb +164 -0
  111. data/lib/datadog_api_client/v2/models/powerpack_data.rb +110 -0
  112. data/lib/datadog_api_client/v2/models/powerpack_group_widget.rb +108 -0
  113. data/lib/datadog_api_client/v2/models/powerpack_group_widget_definition.rb +162 -0
  114. data/lib/datadog_api_client/v2/models/powerpack_group_widget_layout.rb +177 -0
  115. data/lib/datadog_api_client/v2/models/powerpack_inner_widget_layout.rb +177 -0
  116. data/lib/datadog_api_client/v2/models/powerpack_inner_widgets.rb +108 -0
  117. data/lib/datadog_api_client/v2/models/powerpack_relationships.rb +80 -0
  118. data/lib/datadog_api_client/v2/models/powerpack_response.rb +92 -0
  119. data/lib/datadog_api_client/v2/models/powerpack_response_links.rb +129 -0
  120. data/lib/datadog_api_client/v2/models/powerpack_template_variable.rb +110 -0
  121. data/lib/datadog_api_client/v2/models/powerpacks_response_meta.rb +80 -0
  122. data/lib/datadog_api_client/v2/models/powerpacks_response_meta_pagination.rb +150 -0
  123. data/lib/datadog_api_client/v2/models/reorder_retention_filters_request.rb +100 -0
  124. data/lib/datadog_api_client/v2/models/restriction_policy_binding.rb +1 -1
  125. data/lib/datadog_api_client/v2/models/retention_filter.rb +140 -0
  126. data/lib/datadog_api_client/v2/models/retention_filter_all.rb +140 -0
  127. data/lib/datadog_api_client/v2/models/retention_filter_all_attributes.rb +181 -0
  128. data/lib/datadog_api_client/v2/models/retention_filter_all_type.rb +28 -0
  129. data/lib/datadog_api_client/v2/models/retention_filter_attributes.rb +181 -0
  130. data/lib/datadog_api_client/v2/models/retention_filter_create_attributes.rb +183 -0
  131. data/lib/datadog_api_client/v2/models/retention_filter_create_data.rb +119 -0
  132. data/lib/datadog_api_client/v2/models/retention_filter_create_request.rb +98 -0
  133. data/lib/datadog_api_client/v2/models/retention_filter_response.rb +80 -0
  134. data/lib/datadog_api_client/v2/models/retention_filter_type.rb +26 -0
  135. data/lib/datadog_api_client/v2/models/retention_filter_update_data.rb +140 -0
  136. data/lib/datadog_api_client/v2/models/retention_filter_update_request.rb +98 -0
  137. data/lib/datadog_api_client/v2/models/retention_filter_without_attributes.rb +119 -0
  138. data/lib/datadog_api_client/v2/models/retention_filters_response.rb +100 -0
  139. data/lib/datadog_api_client/v2/models/scalar_column_type_group.rb +26 -0
  140. data/lib/datadog_api_client/v2/models/scalar_column_type_number.rb +26 -0
  141. data/lib/datadog_api_client/v2/models/scalar_meta.rb +8 -0
  142. data/lib/datadog_api_client/v2/models/service_definition_schema.rb +2 -1
  143. data/lib/datadog_api_client/v2/models/service_definition_schema_versions.rb +1 -0
  144. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2.rb +247 -0
  145. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_contact.rb +129 -0
  146. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_integrations.rb +90 -0
  147. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_link.rb +150 -0
  148. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_opsgenie.rb +108 -0
  149. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_opsgenie_region.rb +27 -0
  150. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_pagerduty.rb +80 -0
  151. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_type.rb +32 -0
  152. data/lib/datadog_api_client/v2/models/service_definition_v2_dot2_version.rb +26 -0
  153. data/lib/datadog_api_client/v2/models/service_definitions_create_request.rb +1 -0
  154. data/lib/datadog_api_client/v2/models/spans_filter.rb +80 -0
  155. data/lib/datadog_api_client/v2/models/spans_filter_create.rb +98 -0
  156. data/lib/datadog_api_client/version.rb +1 -1
  157. data/run-tests.sh +6 -5
  158. metadata +102 -9
  159. data/examples/v1/usage-metering/GetUsageCIApp_1064440884.rb +0 -8
  160. data/examples/v1/usage-metering/GetUsageCWS_736958514.rb +0 -8
  161. data/examples/v2/service-accounts/CreateServiceAccountApplicationKey_1761876297.rb +0 -17
  162. data/examples/v2/service-accounts/DeleteServiceAccountApplicationKey_992091161.rb +0 -11
  163. data/examples/v2/service-accounts/GetServiceAccountApplicationKey_819075131.rb +0 -11
  164. data/examples/v2/service-accounts/ListServiceAccountApplicationKeys_1268914341.rb +0 -8
  165. data/examples/v2/service-accounts/UpdateServiceAccountApplicationKey_768415790.rb +0 -22
@@ -0,0 +1,119 @@
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
+ # Defines the metric and aggregation used as the sort value.
21
+ class SplitConfigSortCompute
22
+ include BaseGenericModel
23
+
24
+ # How to aggregate the sort metric for the purposes of ordering.
25
+ attr_reader :aggregation
26
+
27
+ # The metric to use for sorting graphs.
28
+ attr_reader :metric
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ # @!visibility private
32
+ def self.attribute_map
33
+ {
34
+ :'aggregation' => :'aggregation',
35
+ :'metric' => :'metric'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'aggregation' => :'String',
44
+ :'metric' => :'String'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param attributes [Hash] Model attributes in the form of hash
50
+ # @!visibility private
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SplitConfigSortCompute` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SplitConfigSortCompute`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'aggregation')
65
+ self.aggregation = attributes[:'aggregation']
66
+ end
67
+
68
+ if attributes.key?(:'metric')
69
+ self.metric = attributes[:'metric']
70
+ end
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ # @!visibility private
76
+ def valid?
77
+ return false if @aggregation.nil?
78
+ return false if @metric.nil?
79
+ true
80
+ end
81
+
82
+ # Custom attribute writer method with validation
83
+ # @param aggregation [Object] Object to be assigned
84
+ # @!visibility private
85
+ def aggregation=(aggregation)
86
+ if aggregation.nil?
87
+ fail ArgumentError, 'invalid value for "aggregation", aggregation cannot be nil.'
88
+ end
89
+ @aggregation = aggregation
90
+ end
91
+
92
+ # Custom attribute writer method with validation
93
+ # @param metric [Object] Object to be assigned
94
+ # @!visibility private
95
+ def metric=(metric)
96
+ if metric.nil?
97
+ fail ArgumentError, 'invalid value for "metric", metric cannot be nil.'
98
+ end
99
+ @metric = metric
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param o [Object] Object to be compared
104
+ # @!visibility private
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ aggregation == o.aggregation &&
109
+ metric == o.metric
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ # @!visibility private
115
+ def hash
116
+ [aggregation, metric].hash
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,98 @@
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
+ # The property by which the graph splits
21
+ class SplitDimension
22
+ include BaseGenericModel
23
+
24
+ # The system interprets this attribute differently depending on the data source of the query being split. For metrics, it's a tag. For the events platform, it's an attribute or tag.
25
+ attr_reader :one_graph_per
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ # @!visibility private
29
+ def self.attribute_map
30
+ {
31
+ :'one_graph_per' => :'one_graph_per'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ # @!visibility private
37
+ def self.openapi_types
38
+ {
39
+ :'one_graph_per' => :'String'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param attributes [Hash] Model attributes in the form of hash
45
+ # @!visibility private
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SplitDimension` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SplitDimension`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'one_graph_per')
60
+ self.one_graph_per = attributes[:'one_graph_per']
61
+ end
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ # @!visibility private
67
+ def valid?
68
+ return false if @one_graph_per.nil?
69
+ true
70
+ end
71
+
72
+ # Custom attribute writer method with validation
73
+ # @param one_graph_per [Object] Object to be assigned
74
+ # @!visibility private
75
+ def one_graph_per=(one_graph_per)
76
+ if one_graph_per.nil?
77
+ fail ArgumentError, 'invalid value for "one_graph_per", one_graph_per cannot be nil.'
78
+ end
79
+ @one_graph_per = one_graph_per
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param o [Object] Object to be compared
84
+ # @!visibility private
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ one_graph_per == o.one_graph_per
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Integer] Hash code
93
+ # @!visibility private
94
+ def hash
95
+ [one_graph_per].hash
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,70 @@
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
+ # The original widget we are splitting on.
21
+ module SplitGraphSourceWidgetDefinition
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
+ :'ChangeWidgetDefinition',
30
+ :'GeomapWidgetDefinition',
31
+ :'QueryValueWidgetDefinition',
32
+ :'ScatterPlotWidgetDefinition',
33
+ :'SunburstWidgetDefinition',
34
+ :'TableWidgetDefinition',
35
+ :'TimeseriesWidgetDefinition',
36
+ :'ToplistWidgetDefinition',
37
+ :'TreeMapWidgetDefinition'
38
+ ]
39
+ end
40
+ # Builds the object
41
+ # @param data [Mixed] Data to be matched against the list of oneOf items
42
+ # @return [Object] Returns the model or the data itself
43
+ def build(data)
44
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
45
+ # Note:
46
+ # - We do not attempt to check whether exactly one item matches.
47
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
48
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
49
+ # - TODO: scalar values are de facto behaving as if they were nullable.
50
+ # - TODO: logging when debugging is set.
51
+ openapi_one_of.each do |klass|
52
+ begin
53
+ next if klass == :AnyType # "nullable: true"
54
+ typed_data = find_and_cast_into_type(klass, data)
55
+ next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
56
+ return typed_data if typed_data
57
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
58
+ end
59
+ end
60
+
61
+ if openapi_one_of.include?(:AnyType)
62
+ data
63
+ else
64
+ self._unparsed = true
65
+ DatadogAPIClient::UnparsedObject.new(data)
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,29 @@
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
+ # Size of the individual graphs in the split.
21
+ class SplitGraphVizSize
22
+ include BaseEnumModel
23
+
24
+ XS = "xs".freeze
25
+ SM = "sm".freeze
26
+ MD = "md".freeze
27
+ LG = "lg".freeze
28
+ end
29
+ end
@@ -0,0 +1,191 @@
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
+ # The split graph widget allows you to create repeating units of a graph - one for each value in a group (for example: one per service)
21
+ class SplitGraphWidgetDefinition
22
+ include BaseGenericModel
23
+
24
+ # Normalize y axes across graphs
25
+ attr_accessor :has_uniform_y_axes
26
+
27
+ # Size of the individual graphs in the split.
28
+ attr_reader :size
29
+
30
+ # The original widget we are splitting on.
31
+ attr_reader :source_widget_definition
32
+
33
+ # Encapsulates all user choices about how to split a graph.
34
+ attr_reader :split_config
35
+
36
+ # Time setting for the widget.
37
+ attr_accessor :time
38
+
39
+ # Title of your widget.
40
+ attr_accessor :title
41
+
42
+ # Type of the split graph widget
43
+ attr_reader :type
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ # @!visibility private
47
+ def self.attribute_map
48
+ {
49
+ :'has_uniform_y_axes' => :'has_uniform_y_axes',
50
+ :'size' => :'size',
51
+ :'source_widget_definition' => :'source_widget_definition',
52
+ :'split_config' => :'split_config',
53
+ :'time' => :'time',
54
+ :'title' => :'title',
55
+ :'type' => :'type'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ # @!visibility private
61
+ def self.openapi_types
62
+ {
63
+ :'has_uniform_y_axes' => :'Boolean',
64
+ :'size' => :'SplitGraphVizSize',
65
+ :'source_widget_definition' => :'SplitGraphSourceWidgetDefinition',
66
+ :'split_config' => :'SplitConfig',
67
+ :'time' => :'WidgetTime',
68
+ :'title' => :'String',
69
+ :'type' => :'SplitGraphWidgetDefinitionType'
70
+ }
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param attributes [Hash] Model attributes in the form of hash
75
+ # @!visibility private
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SplitGraphWidgetDefinition` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!self.class.attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SplitGraphWidgetDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'has_uniform_y_axes')
90
+ self.has_uniform_y_axes = attributes[:'has_uniform_y_axes']
91
+ end
92
+
93
+ if attributes.key?(:'size')
94
+ self.size = attributes[:'size']
95
+ end
96
+
97
+ if attributes.key?(:'source_widget_definition')
98
+ self.source_widget_definition = attributes[:'source_widget_definition']
99
+ end
100
+
101
+ if attributes.key?(:'split_config')
102
+ self.split_config = attributes[:'split_config']
103
+ end
104
+
105
+ if attributes.key?(:'time')
106
+ self.time = attributes[:'time']
107
+ end
108
+
109
+ if attributes.key?(:'title')
110
+ self.title = attributes[:'title']
111
+ end
112
+
113
+ if attributes.key?(:'type')
114
+ self.type = attributes[:'type']
115
+ end
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ # @!visibility private
121
+ def valid?
122
+ return false if @size.nil?
123
+ return false if @source_widget_definition.nil?
124
+ return false if @split_config.nil?
125
+ return false if @type.nil?
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param size [Object] Object to be assigned
131
+ # @!visibility private
132
+ def size=(size)
133
+ if size.nil?
134
+ fail ArgumentError, 'invalid value for "size", size cannot be nil.'
135
+ end
136
+ @size = size
137
+ end
138
+
139
+ # Custom attribute writer method with validation
140
+ # @param source_widget_definition [Object] Object to be assigned
141
+ # @!visibility private
142
+ def source_widget_definition=(source_widget_definition)
143
+ if source_widget_definition.nil?
144
+ fail ArgumentError, 'invalid value for "source_widget_definition", source_widget_definition cannot be nil.'
145
+ end
146
+ @source_widget_definition = source_widget_definition
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param split_config [Object] Object to be assigned
151
+ # @!visibility private
152
+ def split_config=(split_config)
153
+ if split_config.nil?
154
+ fail ArgumentError, 'invalid value for "split_config", split_config cannot be nil.'
155
+ end
156
+ @split_config = split_config
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param type [Object] Object to be assigned
161
+ # @!visibility private
162
+ def type=(type)
163
+ if type.nil?
164
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
165
+ end
166
+ @type = type
167
+ end
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param o [Object] Object to be compared
171
+ # @!visibility private
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ has_uniform_y_axes == o.has_uniform_y_axes &&
176
+ size == o.size &&
177
+ source_widget_definition == o.source_widget_definition &&
178
+ split_config == o.split_config &&
179
+ time == o.time &&
180
+ title == o.title &&
181
+ type == o.type
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ # @!visibility private
187
+ def hash
188
+ [has_uniform_y_axes, size, source_widget_definition, split_config, time, title, type].hash
189
+ end
190
+ end
191
+ 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 split graph widget
21
+ class SplitGraphWidgetDefinitionType
22
+ include BaseEnumModel
23
+
24
+ SPLIT_GROUP = "split_group".freeze
25
+ end
26
+ end
@@ -0,0 +1,108 @@
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
+ # Controls the order in which graphs appear in the split.
21
+ class SplitSort
22
+ include BaseGenericModel
23
+
24
+ # Defines the metric and aggregation used as the sort value.
25
+ attr_accessor :compute
26
+
27
+ # Widget sorting methods.
28
+ attr_reader :order
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ # @!visibility private
32
+ def self.attribute_map
33
+ {
34
+ :'compute' => :'compute',
35
+ :'order' => :'order'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'compute' => :'SplitConfigSortCompute',
44
+ :'order' => :'WidgetSort'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param attributes [Hash] Model attributes in the form of hash
50
+ # @!visibility private
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SplitSort` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SplitSort`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'compute')
65
+ self.compute = attributes[:'compute']
66
+ end
67
+
68
+ if attributes.key?(:'order')
69
+ self.order = attributes[:'order']
70
+ end
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ # @!visibility private
76
+ def valid?
77
+ return false if @order.nil?
78
+ true
79
+ end
80
+
81
+ # Custom attribute writer method with validation
82
+ # @param order [Object] Object to be assigned
83
+ # @!visibility private
84
+ def order=(order)
85
+ if order.nil?
86
+ fail ArgumentError, 'invalid value for "order", order cannot be nil.'
87
+ end
88
+ @order = order
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param o [Object] Object to be compared
93
+ # @!visibility private
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ compute == o.compute &&
98
+ order == o.order
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ # @!visibility private
104
+ def hash
105
+ [compute, order].hash
106
+ end
107
+ end
108
+ end