datadog_api_client 2.6.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +233 -14
  4. data/.generator/schemas/v2/openapi.yaml +1403 -151
  5. data/CHANGELOG.md +27 -0
  6. data/examples/v1/dashboards/CreateDashboard_1039800684.rb +37 -0
  7. data/examples/v1/dashboards/CreateDashboard_2432046716.rb +33 -0
  8. data/examples/v1/dashboards/CreateDashboard_2610827685.rb +38 -0
  9. data/examples/v1/dashboards/CreateDashboard_2843286292.rb +43 -0
  10. data/examples/v1/gcp-integration/CreateGCPIntegration.rb +1 -0
  11. data/examples/v1/gcp-integration/DeleteGCPIntegration.rb +1 -0
  12. data/examples/v1/gcp-integration/UpdateGCPIntegration.rb +1 -0
  13. data/examples/v1/monitors/ValidateExistingMonitor.rb +1 -0
  14. data/examples/v1/monitors/ValidateMonitor.rb +1 -0
  15. data/examples/v1/service-level-objectives/CreateSLO.rb +2 -2
  16. data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +16 -0
  17. data/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb +1 -0
  18. data/examples/v1/synthetics/CreateSyntheticsBrowserTest_397420811.rb +74 -0
  19. data/examples/v1/synthetics/UpdateBrowserTest.rb +16 -0
  20. data/examples/v2/cloudflare-integration/CreateCloudflareAccount.rb +16 -0
  21. data/examples/v2/cloudflare-integration/DeleteCloudflareAccount.rb +5 -0
  22. data/examples/v2/cloudflare-integration/GetCloudflareAccount.rb +8 -0
  23. data/examples/v2/cloudflare-integration/ListCloudflareAccounts.rb +5 -0
  24. data/examples/v2/cloudflare-integration/UpdateCloudflareAccount.rb +18 -0
  25. data/examples/v2/fastly-integration/CreateFastlyAccount.rb +16 -0
  26. data/examples/v2/fastly-integration/CreateFastlyService.rb +18 -0
  27. data/examples/v2/fastly-integration/DeleteFastlyAccount.rb +5 -0
  28. data/examples/v2/fastly-integration/DeleteFastlyService.rb +5 -0
  29. data/examples/v2/fastly-integration/GetFastlyAccount.rb +8 -0
  30. data/examples/v2/fastly-integration/GetFastlyService.rb +5 -0
  31. data/examples/v2/fastly-integration/ListFastlyAccounts.rb +5 -0
  32. data/examples/v2/fastly-integration/ListFastlyServices.rb +5 -0
  33. data/examples/v2/fastly-integration/UpdateFastlyAccount.rb +17 -0
  34. data/examples/v2/fastly-integration/UpdateFastlyService.rb +18 -0
  35. data/examples/v2/metrics/QueryScalarData.rb +5 -6
  36. data/examples/v2/metrics/QueryScalarData_3112571352.rb +35 -0
  37. data/examples/v2/metrics/QueryTimeseriesData.rb +5 -6
  38. data/examples/v2/metrics/QueryTimeseriesData_301142940.rb +35 -0
  39. data/examples/v2/monitors/CreateMonitorConfigPolicy.rb +22 -0
  40. data/examples/v2/monitors/DeleteMonitorConfigPolicy.rb +8 -0
  41. data/examples/v2/monitors/GetMonitorConfigPolicy.rb +8 -0
  42. data/examples/v2/monitors/ListMonitorConfigPolicies.rb +5 -0
  43. data/examples/v2/monitors/UpdateMonitorConfigPolicy.rb +26 -0
  44. data/examples/v2/sensitive-data-scanner/CreateScanningRule.rb +6 -0
  45. data/examples/v2/{users → service-accounts}/CreateServiceAccount.rb +1 -1
  46. data/lib/datadog_api_client/inflector.rb +61 -0
  47. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  48. data/lib/datadog_api_client/v1/models/gcp_account.rb +11 -1
  49. data/lib/datadog_api_client/v1/models/host_meta.rb +1 -1
  50. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -1
  51. data/lib/datadog_api_client/v1/models/list_stream_compute_aggregation.rb +40 -0
  52. data/lib/datadog_api_client/v1/models/list_stream_compute_items.rb +112 -0
  53. data/lib/datadog_api_client/v1/models/list_stream_group_by_items.rb +102 -0
  54. data/lib/datadog_api_client/v1/models/list_stream_query.rb +61 -1
  55. data/lib/datadog_api_client/v1/models/list_stream_source.rb +2 -0
  56. data/lib/datadog_api_client/v1/models/metrics_query_metadata.rb +3 -2
  57. data/lib/datadog_api_client/v1/models/monitor_options.rb +11 -1
  58. data/lib/datadog_api_client/v1/models/monitor_options_notification_presets.rb +29 -0
  59. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -2
  60. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +13 -13
  61. data/lib/datadog_api_client/v1/models/run_workflow_widget_definition.rb +187 -0
  62. data/lib/datadog_api_client/v1/models/run_workflow_widget_definition_type.rb +26 -0
  63. data/lib/datadog_api_client/v1/models/run_workflow_widget_input.rb +123 -0
  64. data/lib/datadog_api_client/v1/models/synthetics_config_variable.rb +1 -1
  65. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +21 -1
  66. data/lib/datadog_api_client/v1/models/synthetics_test_options_http_version.rb +28 -0
  67. data/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling.rb +103 -0
  68. data/lib/datadog_api_client/v1/models/synthetics_test_options_scheduling_timeframe.rb +126 -0
  69. data/lib/datadog_api_client/v1/models/widget_definition.rb +1 -0
  70. data/lib/datadog_api_client/v2/api/cloudflare_integration_api.rb +355 -0
  71. data/lib/datadog_api_client/v2/api/fastly_integration_api.rb +709 -0
  72. data/lib/datadog_api_client/v2/api/metrics_api.rb +7 -6
  73. data/lib/datadog_api_client/v2/api/monitors_api.rb +355 -0
  74. data/lib/datadog_api_client/v2/api/service_accounts_api.rb +67 -0
  75. data/lib/datadog_api_client/v2/api/users_api.rb +0 -67
  76. data/lib/datadog_api_client/v2/models/cloudflare_account_create_request.rb +102 -0
  77. data/lib/datadog_api_client/v2/models/cloudflare_account_create_request_attributes.rb +133 -0
  78. data/lib/datadog_api_client/v2/models/cloudflare_account_create_request_data.rb +123 -0
  79. data/lib/datadog_api_client/v2/models/cloudflare_account_response.rb +91 -0
  80. data/lib/datadog_api_client/v2/models/cloudflare_account_response_attributes.rb +112 -0
  81. data/lib/datadog_api_client/v2/models/cloudflare_account_response_data.rb +144 -0
  82. data/lib/datadog_api_client/v2/models/cloudflare_account_type.rb +26 -0
  83. data/lib/datadog_api_client/v2/models/cloudflare_account_update_request.rb +102 -0
  84. data/lib/datadog_api_client/v2/models/cloudflare_account_update_request_attributes.rb +112 -0
  85. data/lib/datadog_api_client/v2/models/cloudflare_account_update_request_data.rb +101 -0
  86. data/lib/datadog_api_client/v2/models/cloudflare_accounts_response.rb +93 -0
  87. data/lib/datadog_api_client/v2/models/cost_by_org_attributes.rb +11 -1
  88. data/lib/datadog_api_client/v2/models/data_scalar_column.rb +123 -0
  89. data/lib/datadog_api_client/v2/models/fastly_accoun_response_attributes.rb +114 -0
  90. data/lib/datadog_api_client/v2/models/fastly_account_create_request.rb +102 -0
  91. data/lib/datadog_api_client/v2/models/fastly_account_create_request_attributes.rb +135 -0
  92. data/lib/datadog_api_client/v2/models/fastly_account_create_request_data.rb +123 -0
  93. data/lib/datadog_api_client/v2/models/fastly_account_response.rb +91 -0
  94. data/lib/datadog_api_client/v2/models/fastly_account_response_data.rb +144 -0
  95. data/lib/datadog_api_client/v2/models/fastly_account_type.rb +26 -0
  96. data/lib/datadog_api_client/v2/models/fastly_account_update_request.rb +102 -0
  97. data/lib/datadog_api_client/v2/models/fastly_account_update_request_attributes.rb +91 -0
  98. data/lib/datadog_api_client/v2/models/fastly_account_update_request_data.rb +101 -0
  99. data/lib/datadog_api_client/v2/models/fastly_accounts_response.rb +93 -0
  100. data/lib/datadog_api_client/v2/models/fastly_service.rb +114 -0
  101. data/lib/datadog_api_client/v2/models/fastly_service_attributes.rb +93 -0
  102. data/lib/datadog_api_client/v2/models/fastly_service_data.rb +133 -0
  103. data/lib/datadog_api_client/v2/models/fastly_service_request.rb +102 -0
  104. data/lib/datadog_api_client/v2/models/fastly_service_response.rb +91 -0
  105. data/lib/datadog_api_client/v2/models/fastly_service_type.rb +26 -0
  106. data/lib/datadog_api_client/v2/models/fastly_services_response.rb +93 -0
  107. data/lib/datadog_api_client/v2/models/group_scalar_column.rb +113 -0
  108. data/lib/datadog_api_client/v2/models/monitor_config_policy_attribute_create_request.rb +123 -0
  109. data/lib/datadog_api_client/v2/models/monitor_config_policy_attribute_edit_request.rb +123 -0
  110. data/lib/datadog_api_client/v2/models/monitor_config_policy_attribute_response.rb +101 -0
  111. data/lib/datadog_api_client/v2/models/monitor_config_policy_create_data.rb +123 -0
  112. data/lib/datadog_api_client/v2/models/monitor_config_policy_create_request.rb +102 -0
  113. data/lib/datadog_api_client/v2/models/monitor_config_policy_edit_data.rb +144 -0
  114. data/lib/datadog_api_client/v2/models/monitor_config_policy_edit_request.rb +102 -0
  115. data/lib/datadog_api_client/v2/models/monitor_config_policy_list_response.rb +93 -0
  116. data/lib/datadog_api_client/v2/models/monitor_config_policy_policy.rb +62 -0
  117. data/lib/datadog_api_client/v2/models/monitor_config_policy_policy_create_request.rb +62 -0
  118. data/lib/datadog_api_client/v2/models/monitor_config_policy_resource_type.rb +26 -0
  119. data/lib/datadog_api_client/v2/models/monitor_config_policy_response.rb +91 -0
  120. data/lib/datadog_api_client/v2/models/monitor_config_policy_response_data.rb +111 -0
  121. data/lib/datadog_api_client/v2/models/monitor_config_policy_tag_policy.rb +124 -0
  122. data/lib/datadog_api_client/v2/models/monitor_config_policy_tag_policy_create_request.rb +150 -0
  123. data/lib/datadog_api_client/v2/models/monitor_config_policy_type.rb +26 -0
  124. data/lib/datadog_api_client/v2/models/scalar_column.rb +35 -77
  125. data/lib/datadog_api_client/v2/models/scalar_formula_response_atrributes.rb +4 -16
  126. data/lib/datadog_api_client/v2/models/scalar_meta.rb +96 -0
  127. data/lib/datadog_api_client/v2/models/security_monitoring_rule_detection_method.rb +1 -0
  128. data/lib/datadog_api_client/v2/models/security_monitoring_rule_query_aggregation.rb +1 -0
  129. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response.rb +11 -1
  130. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +11 -1
  131. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_rule_attributes.rb +22 -9
  132. data/lib/datadog_api_client/v2/models/timeseries_response_series.rb +4 -1
  133. data/lib/datadog_api_client/version.rb +1 -1
  134. metadata +91 -3
@@ -0,0 +1,93 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Response for retrieving all monitor configuration policies.
21
+ class MonitorConfigPolicyListResponse
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # An array of monitor configuration policies.
29
+ attr_accessor :data
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'data' => :'data'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'data' => :'Array<MonitorConfigPolicyResponseData>'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param attributes [Hash] Model attributes in the form of hash
49
+ # @!visibility private
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorConfigPolicyListResponse` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MonitorConfigPolicyListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'data')
64
+ if (value = attributes[:'data']).is_a?(Array)
65
+ self.data = value
66
+ end
67
+ end
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ # @!visibility private
73
+ def valid?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param o [Object] Object to be compared
79
+ # @!visibility private
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ data == o.data
84
+ end
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Integer] Hash code
88
+ # @!visibility private
89
+ def hash
90
+ [data].hash
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,62 @@
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
+ # Configuration for the policy.
21
+ module MonitorConfigPolicyPolicy
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
+ :'MonitorConfigPolicyTagPolicy'
30
+ ]
31
+ end
32
+ # Builds the object
33
+ # @param data [Mixed] Data to be matched against the list of oneOf items
34
+ # @return [Object] Returns the model or the data itself
35
+ def build(data)
36
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
37
+ # Note:
38
+ # - We do not attempt to check whether exactly one item matches.
39
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
40
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
41
+ # - TODO: scalar values are de facto behaving as if they were nullable.
42
+ # - TODO: logging when debugging is set.
43
+ openapi_one_of.each do |klass|
44
+ begin
45
+ next if klass == :AnyType # "nullable: true"
46
+ typed_data = find_and_cast_into_type(klass, data)
47
+ next if typed_data._unparsed
48
+ return typed_data if typed_data
49
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
50
+ end
51
+ end
52
+
53
+ if openapi_one_of.include?(:AnyType)
54
+ data
55
+ else
56
+ self._unparsed = true
57
+ DatadogAPIClient::UnparsedObject.new(data)
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,62 @@
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
+ # Configuration for the policy.
21
+ module MonitorConfigPolicyPolicyCreateRequest
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
+ :'MonitorConfigPolicyTagPolicyCreateRequest'
30
+ ]
31
+ end
32
+ # Builds the object
33
+ # @param data [Mixed] Data to be matched against the list of oneOf items
34
+ # @return [Object] Returns the model or the data itself
35
+ def build(data)
36
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
37
+ # Note:
38
+ # - We do not attempt to check whether exactly one item matches.
39
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
40
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
41
+ # - TODO: scalar values are de facto behaving as if they were nullable.
42
+ # - TODO: logging when debugging is set.
43
+ openapi_one_of.each do |klass|
44
+ begin
45
+ next if klass == :AnyType # "nullable: true"
46
+ typed_data = find_and_cast_into_type(klass, data)
47
+ next if typed_data._unparsed
48
+ return typed_data if typed_data
49
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
50
+ end
51
+ end
52
+
53
+ if openapi_one_of.include?(:AnyType)
54
+ data
55
+ else
56
+ self._unparsed = true
57
+ DatadogAPIClient::UnparsedObject.new(data)
58
+ end
59
+ end
60
+ end
61
+ end
62
+ 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
+ # Monitor configuration policy resource type.
21
+ class MonitorConfigPolicyResourceType
22
+ include BaseEnumModel
23
+
24
+ MONITOR_CONFIG_POLICY = "monitor-config-policy".freeze
25
+ end
26
+ end
@@ -0,0 +1,91 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Response for retrieving a monitor configuration policy.
21
+ class MonitorConfigPolicyResponse
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # A monitor configuration policy data.
29
+ attr_accessor :data
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'data' => :'data'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'data' => :'MonitorConfigPolicyResponseData'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param attributes [Hash] Model attributes in the form of hash
49
+ # @!visibility private
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorConfigPolicyResponse` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MonitorConfigPolicyResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'data')
64
+ self.data = attributes[:'data']
65
+ end
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ # @!visibility private
71
+ def valid?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param o [Object] Object to be compared
77
+ # @!visibility private
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ data == o.data
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Integer] Hash code
86
+ # @!visibility private
87
+ def hash
88
+ [data].hash
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,111 @@
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
+ # A monitor configuration policy data.
21
+ class MonitorConfigPolicyResponseData
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Policy and policy type for a monitor configuration policy.
29
+ attr_accessor :attributes
30
+
31
+ # ID of this monitor configuration policy.
32
+ attr_accessor :id
33
+
34
+ # Monitor configuration policy 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
+ # Attribute type mapping.
48
+ # @!visibility private
49
+ def self.openapi_types
50
+ {
51
+ :'attributes' => :'MonitorConfigPolicyAttributeResponse',
52
+ :'id' => :'String',
53
+ :'type' => :'MonitorConfigPolicyResourceType'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param attributes [Hash] Model attributes in the form of hash
59
+ # @!visibility private
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorConfigPolicyResponseData` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MonitorConfigPolicyResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'attributes')
74
+ self.attributes = attributes[:'attributes']
75
+ end
76
+
77
+ if attributes.key?(:'id')
78
+ self.id = attributes[:'id']
79
+ end
80
+
81
+ if attributes.key?(:'type')
82
+ self.type = attributes[:'type']
83
+ end
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ # @!visibility private
89
+ def valid?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param o [Object] Object to be compared
95
+ # @!visibility private
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ attributes == o.attributes &&
100
+ id == o.id &&
101
+ type == o.type
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Integer] Hash code
106
+ # @!visibility private
107
+ def hash
108
+ [attributes, id, type].hash
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,124 @@
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
+ # Tag attributes of a monitor configuration policy.
21
+ class MonitorConfigPolicyTagPolicy
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # The key of the tag.
29
+ attr_reader :tag_key
30
+
31
+ # If a tag key is required for monitor creation.
32
+ attr_accessor :tag_key_required
33
+
34
+ # Valid values for the tag.
35
+ attr_accessor :valid_tag_values
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ # @!visibility private
39
+ def self.attribute_map
40
+ {
41
+ :'tag_key' => :'tag_key',
42
+ :'tag_key_required' => :'tag_key_required',
43
+ :'valid_tag_values' => :'valid_tag_values'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ # @!visibility private
49
+ def self.openapi_types
50
+ {
51
+ :'tag_key' => :'String',
52
+ :'tag_key_required' => :'Boolean',
53
+ :'valid_tag_values' => :'Array<String>'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param attributes [Hash] Model attributes in the form of hash
59
+ # @!visibility private
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorConfigPolicyTagPolicy` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MonitorConfigPolicyTagPolicy`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'tag_key')
74
+ self.tag_key = attributes[:'tag_key']
75
+ end
76
+
77
+ if attributes.key?(:'tag_key_required')
78
+ self.tag_key_required = attributes[:'tag_key_required']
79
+ end
80
+
81
+ if attributes.key?(:'valid_tag_values')
82
+ if (value = attributes[:'valid_tag_values']).is_a?(Array)
83
+ self.valid_tag_values = value
84
+ end
85
+ end
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ # @!visibility private
91
+ def valid?
92
+ return false if !@tag_key.nil? && @tag_key.to_s.length > 255
93
+ true
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param tag_key [Object] Object to be assigned
98
+ # @!visibility private
99
+ def tag_key=(tag_key)
100
+ if !tag_key.nil? && tag_key.to_s.length > 255
101
+ fail ArgumentError, 'invalid value for "tag_key", the character length must be smaller than or equal to 255.'
102
+ end
103
+ @tag_key = tag_key
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param o [Object] Object to be compared
108
+ # @!visibility private
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ tag_key == o.tag_key &&
113
+ tag_key_required == o.tag_key_required &&
114
+ valid_tag_values == o.valid_tag_values
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ # @!visibility private
120
+ def hash
121
+ [tag_key, tag_key_required, valid_tag_values].hash
122
+ end
123
+ end
124
+ end