datadog_api_client 2.24.0 → 2.25.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 (146) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/conftest.py +2 -0
  4. data/.generator/schemas/v1/openapi.yaml +265 -8
  5. data/.generator/schemas/v2/openapi.yaml +1471 -32
  6. data/.generator/src/generator/openapi.py +4 -0
  7. data/CHANGELOG.md +41 -0
  8. data/examples/v1/azure-integration/CreateAzureIntegration.rb +1 -1
  9. data/examples/v1/azure-integration/UpdateAzureHostFilters.rb +7 -1
  10. data/examples/v1/azure-integration/UpdateAzureIntegration.rb +7 -1
  11. data/examples/v1/dashboards/CreateDashboard_985012506.rb +61 -0
  12. data/examples/v1/synthetics/CreateSyntheticsAPITest_1717840259.rb +163 -0
  13. data/examples/v1/synthetics/CreateSyntheticsBrowserTest.rb +2 -0
  14. data/examples/v2/cloud-cost-management/DeleteCustomCostsFile.rb +5 -0
  15. data/examples/v2/cloud-cost-management/DeleteCustomCostsFile_372970393.rb +5 -0
  16. data/examples/v2/cloud-cost-management/GetCustomCostsFile.rb +5 -0
  17. data/examples/v2/cloud-cost-management/GetCustomCostsFile_1307381576.rb +5 -0
  18. data/examples/v2/cloud-cost-management/ListCustomCostsFiles.rb +5 -0
  19. data/examples/v2/cloud-cost-management/ListCustomCostsFiles_1968771127.rb +5 -0
  20. data/examples/v2/cloud-cost-management/UploadCustomCostsFile.rb +15 -0
  21. data/examples/v2/cloud-cost-management/UploadCustomCostsFile_4125168396.rb +19 -0
  22. data/examples/v2/network-device-monitoring/GetDevice.rb +5 -0
  23. data/examples/v2/network-device-monitoring/GetInterfaces.rb +5 -0
  24. data/examples/v2/network-device-monitoring/ListDeviceUserTags.rb +5 -0
  25. data/examples/v2/network-device-monitoring/ListDevices.rb +10 -0
  26. data/examples/v2/network-device-monitoring/UpdateDeviceUserTags.rb +18 -0
  27. data/examples/v2/roles/CreateRole.rb +0 -3
  28. data/examples/v2/security-monitoring/ConvertExistingSecurityMonitoringRule.rb +8 -0
  29. data/examples/v2/security-monitoring/ConvertSecurityMonitoringRuleFromJSONToTerraform.rb +36 -0
  30. data/examples/v2/service-scorecards/UpdateScorecardRule.rb +24 -0
  31. data/examples/v2/workflow-automation/CancelWorkflowInstance.rb +5 -0
  32. data/examples/v2/workflow-automation/CreateWorkflowInstance.rb +13 -0
  33. data/examples/v2/workflow-automation/GetWorkflowInstance.rb +5 -0
  34. data/examples/v2/workflow-automation/ListWorkflowInstances.rb +5 -0
  35. data/lib/datadog_api_client/configuration.rb +1 -0
  36. data/lib/datadog_api_client/inflector.rb +53 -1
  37. data/lib/datadog_api_client/v1/api/aws_logs_integration_api.rb +1 -1
  38. data/lib/datadog_api_client/v1/api/hosts_api.rb +1 -1
  39. data/lib/datadog_api_client/v1/api/monitors_api.rb +12 -1
  40. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +7 -3
  41. data/lib/datadog_api_client/v1/models/azure_account.rb +14 -1
  42. data/lib/datadog_api_client/v1/models/azure_account_metrics_config.rb +85 -0
  43. data/lib/datadog_api_client/v1/models/formula_and_function_apm_dependency_stats_query_definition.rb +24 -1
  44. data/lib/datadog_api_client/v1/models/formula_and_function_apm_resource_stats_query_definition.rb +24 -1
  45. data/lib/datadog_api_client/v1/models/formula_and_function_cloud_cost_query_definition.rb +24 -1
  46. data/lib/datadog_api_client/v1/models/formula_and_function_event_query_definition.rb +24 -1
  47. data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
  48. data/lib/datadog_api_client/v1/models/formula_and_function_metric_query_definition.rb +24 -1
  49. data/lib/datadog_api_client/v1/models/formula_and_function_process_query_definition.rb +24 -1
  50. data/lib/datadog_api_client/v1/models/formula_and_function_slo_query_definition.rb +24 -1
  51. data/lib/datadog_api_client/v1/models/formula_and_function_slo_query_type.rb +1 -0
  52. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +2 -0
  53. data/lib/datadog_api_client/v1/models/list_stream_source.rb +1 -0
  54. data/lib/datadog_api_client/v1/models/monitor_formula_and_function_events_data_source.rb +1 -0
  55. data/lib/datadog_api_client/v1/models/monitor_type.rb +1 -0
  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 +41 -1
  58. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest.rb +12 -1
  59. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_oauth_client.rb +12 -1
  60. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_oauth_rop.rb +12 -1
  61. data/lib/datadog_api_client/v1/models/synthetics_delete_tests_payload.rb +12 -1
  62. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +21 -1
  63. data/lib/datadog_api_client/v1/models/usage_billable_summary_hour.rb +21 -1
  64. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +61 -1
  65. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +81 -1
  66. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +61 -1
  67. data/lib/datadog_api_client/v2/api/api_management_api.rb +5 -5
  68. data/lib/datadog_api_client/v2/api/authn_mappings_api.rb +6 -0
  69. data/lib/datadog_api_client/v2/api/case_management_api.rb +13 -13
  70. data/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +260 -0
  71. data/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb +362 -0
  72. data/lib/datadog_api_client/v2/api/organizations_api.rb +1 -1
  73. data/lib/datadog_api_client/v2/api/restriction_policies_api.rb +15 -7
  74. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +134 -0
  75. data/lib/datadog_api_client/v2/api/service_scorecards_api.rb +79 -1
  76. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +8 -0
  77. data/lib/datadog_api_client/v2/api/workflow_automation_api.rb +307 -0
  78. data/lib/datadog_api_client/v2/models/api_key_relationships.rb +9 -1
  79. data/lib/datadog_api_client/v2/models/authn_mapping_resource_type.rb +27 -0
  80. data/lib/datadog_api_client/v2/models/cost_by_org_attributes.rb +21 -1
  81. data/lib/datadog_api_client/v2/models/custom_cost_get_response_meta.rb +80 -0
  82. data/lib/datadog_api_client/v2/models/custom_cost_list_response_meta.rb +90 -0
  83. data/lib/datadog_api_client/v2/models/custom_cost_upload_response_meta.rb +80 -0
  84. data/lib/datadog_api_client/v2/models/custom_costs_file_get_response.rb +90 -0
  85. data/lib/datadog_api_client/v2/models/custom_costs_file_line_item.rb +173 -0
  86. data/lib/datadog_api_client/v2/models/custom_costs_file_list_response.rb +92 -0
  87. data/lib/datadog_api_client/v2/models/custom_costs_file_metadata.rb +152 -0
  88. data/lib/datadog_api_client/v2/models/custom_costs_file_metadata_high_level.rb +100 -0
  89. data/lib/datadog_api_client/v2/models/custom_costs_file_metadata_with_content.rb +164 -0
  90. data/lib/datadog_api_client/v2/models/custom_costs_file_metadata_with_content_high_level.rb +100 -0
  91. data/lib/datadog_api_client/v2/models/custom_costs_file_upload_response.rb +90 -0
  92. data/lib/datadog_api_client/v2/models/custom_costs_file_usage_charge_period.rb +90 -0
  93. data/lib/datadog_api_client/v2/models/custom_costs_user.rb +100 -0
  94. data/lib/datadog_api_client/v2/models/device_attributes.rb +272 -0
  95. data/lib/datadog_api_client/v2/models/device_attributes_interface_statuses.rb +110 -0
  96. data/lib/datadog_api_client/v2/models/devices_list_data.rb +100 -0
  97. data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +2 -2
  98. data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +2 -2
  99. data/lib/datadog_api_client/v2/models/full_application_key_attributes.rb +1 -1
  100. data/lib/datadog_api_client/v2/models/get_device_attributes.rb +262 -0
  101. data/lib/datadog_api_client/v2/models/get_device_data.rb +100 -0
  102. data/lib/datadog_api_client/v2/models/get_device_response.rb +80 -0
  103. data/lib/datadog_api_client/v2/models/get_interfaces_data.rb +100 -0
  104. data/lib/datadog_api_client/v2/models/get_interfaces_response.rb +82 -0
  105. data/lib/datadog_api_client/v2/models/hourly_usage_attributes.rb +21 -1
  106. data/lib/datadog_api_client/v2/models/interface_attributes.rb +130 -0
  107. data/lib/datadog_api_client/v2/models/interface_attributes_status.rb +29 -0
  108. data/lib/datadog_api_client/v2/models/list_devices_response.rb +92 -0
  109. data/lib/datadog_api_client/v2/models/list_devices_response_metadata.rb +80 -0
  110. data/lib/datadog_api_client/v2/models/list_devices_response_metadata_page.rb +80 -0
  111. data/lib/datadog_api_client/v2/models/list_tags_response.rb +80 -0
  112. data/lib/datadog_api_client/v2/models/list_tags_response_data.rb +100 -0
  113. data/lib/datadog_api_client/v2/models/list_tags_response_data_attributes.rb +82 -0
  114. data/lib/datadog_api_client/v2/models/projected_cost_attributes.rb +21 -1
  115. data/lib/datadog_api_client/v2/models/role_relationships.rb +4 -14
  116. data/lib/datadog_api_client/v2/models/role_update_attributes.rb +32 -4
  117. data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +1 -1
  118. data/lib/datadog_api_client/v2/models/rum_application_create_attributes.rb +1 -1
  119. data/lib/datadog_api_client/v2/models/rum_application_list_attributes.rb +1 -1
  120. data/lib/datadog_api_client/v2/models/rum_application_update_attributes.rb +1 -1
  121. data/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_payload.rb +63 -0
  122. data/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_response.rb +80 -0
  123. data/lib/datadog_api_client/v2/models/security_monitoring_rule_detection_method.rb +1 -0
  124. data/lib/datadog_api_client/v2/models/security_monitoring_rule_evaluation_window.rb +1 -1
  125. data/lib/datadog_api_client/v2/models/security_monitoring_rule_keep_alive.rb +1 -1
  126. data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +2 -2
  127. data/lib/datadog_api_client/v2/models/update_rule_request.rb +80 -0
  128. data/lib/datadog_api_client/v2/models/update_rule_request_data.rb +90 -0
  129. data/lib/datadog_api_client/v2/models/update_rule_response.rb +80 -0
  130. data/lib/datadog_api_client/v2/models/update_rule_response_data.rb +110 -0
  131. data/lib/datadog_api_client/v2/models/user_attributes.rb +11 -1
  132. data/lib/datadog_api_client/v2/models/workflow_instance_create_meta.rb +80 -0
  133. data/lib/datadog_api_client/v2/models/workflow_instance_create_request.rb +80 -0
  134. data/lib/datadog_api_client/v2/models/workflow_instance_create_response.rb +80 -0
  135. data/lib/datadog_api_client/v2/models/workflow_instance_create_response_data.rb +80 -0
  136. data/lib/datadog_api_client/v2/models/workflow_instance_list_item.rb +80 -0
  137. data/lib/datadog_api_client/v2/models/workflow_list_instances_response.rb +92 -0
  138. data/lib/datadog_api_client/v2/models/workflow_list_instances_response_meta.rb +80 -0
  139. data/lib/datadog_api_client/v2/models/workflow_list_instances_response_meta_page.rb +80 -0
  140. data/lib/datadog_api_client/v2/models/worklflow_cancel_instance_response.rb +80 -0
  141. data/lib/datadog_api_client/v2/models/worklflow_cancel_instance_response_data.rb +80 -0
  142. data/lib/datadog_api_client/v2/models/worklflow_get_instance_response.rb +80 -0
  143. data/lib/datadog_api_client/v2/models/worklflow_get_instance_response_data.rb +80 -0
  144. data/lib/datadog_api_client/v2/models/worklflow_get_instance_response_data_attributes.rb +80 -0
  145. data/lib/datadog_api_client/version.rb +1 -1
  146. metadata +76 -2
@@ -21,6 +21,12 @@ module DatadogAPIClient::V2
21
21
  class ProjectedCostAttributes
22
22
  include BaseGenericModel
23
23
 
24
+ # The account name.
25
+ attr_accessor :account_name
26
+
27
+ # The account public ID.
28
+ attr_accessor :account_public_id
29
+
24
30
  # List of charges data reported for the requested month.
25
31
  attr_accessor :charges
26
32
 
@@ -43,6 +49,8 @@ module DatadogAPIClient::V2
43
49
  # @!visibility private
44
50
  def self.attribute_map
45
51
  {
52
+ :'account_name' => :'account_name',
53
+ :'account_public_id' => :'account_public_id',
46
54
  :'charges' => :'charges',
47
55
  :'date' => :'date',
48
56
  :'org_name' => :'org_name',
@@ -56,6 +64,8 @@ module DatadogAPIClient::V2
56
64
  # @!visibility private
57
65
  def self.openapi_types
58
66
  {
67
+ :'account_name' => :'String',
68
+ :'account_public_id' => :'String',
59
69
  :'charges' => :'Array<ChargebackBreakdown>',
60
70
  :'date' => :'Time',
61
71
  :'org_name' => :'String',
@@ -81,6 +91,14 @@ module DatadogAPIClient::V2
81
91
  h[k.to_sym] = v
82
92
  }
83
93
 
94
+ if attributes.key?(:'account_name')
95
+ self.account_name = attributes[:'account_name']
96
+ end
97
+
98
+ if attributes.key?(:'account_public_id')
99
+ self.account_public_id = attributes[:'account_public_id']
100
+ end
101
+
84
102
  if attributes.key?(:'charges')
85
103
  if (value = attributes[:'charges']).is_a?(Array)
86
104
  self.charges = value
@@ -114,6 +132,8 @@ module DatadogAPIClient::V2
114
132
  def ==(o)
115
133
  return true if self.equal?(o)
116
134
  self.class == o.class &&
135
+ account_name == o.account_name &&
136
+ account_public_id == o.account_public_id &&
117
137
  charges == o.charges &&
118
138
  date == o.date &&
119
139
  org_name == o.org_name &&
@@ -126,7 +146,7 @@ module DatadogAPIClient::V2
126
146
  # @return [Integer] Hash code
127
147
  # @!visibility private
128
148
  def hash
129
- [charges, date, org_name, projected_total_cost, public_id, region].hash
149
+ [account_name, account_public_id, charges, date, org_name, projected_total_cost, public_id, region].hash
130
150
  end
131
151
  end
132
152
  end
@@ -24,15 +24,11 @@ module DatadogAPIClient::V2
24
24
  # Relationship to multiple permissions objects.
25
25
  attr_accessor :permissions
26
26
 
27
- # Relationship to users.
28
- attr_accessor :users
29
-
30
27
  # Attribute mapping from ruby-style variable name to JSON key.
31
28
  # @!visibility private
32
29
  def self.attribute_map
33
30
  {
34
- :'permissions' => :'permissions',
35
- :'users' => :'users'
31
+ :'permissions' => :'permissions'
36
32
  }
37
33
  end
38
34
 
@@ -40,8 +36,7 @@ module DatadogAPIClient::V2
40
36
  # @!visibility private
41
37
  def self.openapi_types
42
38
  {
43
- :'permissions' => :'RelationshipToPermissions',
44
- :'users' => :'RelationshipToUsers'
39
+ :'permissions' => :'RelationshipToPermissions'
45
40
  }
46
41
  end
47
42
 
@@ -64,10 +59,6 @@ module DatadogAPIClient::V2
64
59
  if attributes.key?(:'permissions')
65
60
  self.permissions = attributes[:'permissions']
66
61
  end
67
-
68
- if attributes.key?(:'users')
69
- self.users = attributes[:'users']
70
- end
71
62
  end
72
63
 
73
64
  # Checks equality by comparing each attribute.
@@ -76,15 +67,14 @@ module DatadogAPIClient::V2
76
67
  def ==(o)
77
68
  return true if self.equal?(o)
78
69
  self.class == o.class &&
79
- permissions == o.permissions &&
80
- users == o.users
70
+ permissions == o.permissions
81
71
  end
82
72
 
83
73
  # Calculates hash code according to all attributes.
84
74
  # @return [Integer] Hash code
85
75
  # @!visibility private
86
76
  def hash
87
- [permissions, users].hash
77
+ [permissions].hash
88
78
  end
89
79
  end
90
80
  end
@@ -30,13 +30,17 @@ module DatadogAPIClient::V2
30
30
  # Name of the role.
31
31
  attr_accessor :name
32
32
 
33
+ # The user count.
34
+ attr_reader :user_count
35
+
33
36
  # Attribute mapping from ruby-style variable name to JSON key.
34
37
  # @!visibility private
35
38
  def self.attribute_map
36
39
  {
37
40
  :'created_at' => :'created_at',
38
41
  :'modified_at' => :'modified_at',
39
- :'name' => :'name'
42
+ :'name' => :'name',
43
+ :'user_count' => :'user_count'
40
44
  }
41
45
  end
42
46
 
@@ -46,7 +50,8 @@ module DatadogAPIClient::V2
46
50
  {
47
51
  :'created_at' => :'Time',
48
52
  :'modified_at' => :'Time',
49
- :'name' => :'String'
53
+ :'name' => :'String',
54
+ :'user_count' => :'Integer'
50
55
  }
51
56
  end
52
57
 
@@ -77,6 +82,28 @@ module DatadogAPIClient::V2
77
82
  if attributes.key?(:'name')
78
83
  self.name = attributes[:'name']
79
84
  end
85
+
86
+ if attributes.key?(:'user_count')
87
+ self.user_count = attributes[:'user_count']
88
+ end
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ # @!visibility private
94
+ def valid?
95
+ return false if !@user_count.nil? && @user_count > 2147483647
96
+ true
97
+ end
98
+
99
+ # Custom attribute writer method with validation
100
+ # @param user_count [Object] Object to be assigned
101
+ # @!visibility private
102
+ def user_count=(user_count)
103
+ if !user_count.nil? && user_count > 2147483647
104
+ fail ArgumentError, 'invalid value for "user_count", must be smaller than or equal to 2147483647.'
105
+ end
106
+ @user_count = user_count
80
107
  end
81
108
 
82
109
  # Checks equality by comparing each attribute.
@@ -87,14 +114,15 @@ module DatadogAPIClient::V2
87
114
  self.class == o.class &&
88
115
  created_at == o.created_at &&
89
116
  modified_at == o.modified_at &&
90
- name == o.name
117
+ name == o.name &&
118
+ user_count == o.user_count
91
119
  end
92
120
 
93
121
  # Calculates hash code according to all attributes.
94
122
  # @return [Integer] Hash code
95
123
  # @!visibility private
96
124
  def hash
97
- [created_at, modified_at, name].hash
125
+ [created_at, modified_at, name, user_count].hash
98
126
  end
99
127
  end
100
128
  end
@@ -45,7 +45,7 @@ module DatadogAPIClient::V2
45
45
  # Org ID of the RUM application.
46
46
  attr_reader :org_id
47
47
 
48
- # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`.
48
+ # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`.
49
49
  attr_reader :type
50
50
 
51
51
  # Timestamp in ms of the last update date.
@@ -24,7 +24,7 @@ module DatadogAPIClient::V2
24
24
  # Name of the RUM application.
25
25
  attr_reader :name
26
26
 
27
- # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`.
27
+ # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`.
28
28
  attr_accessor :type
29
29
 
30
30
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -42,7 +42,7 @@ module DatadogAPIClient::V2
42
42
  # Org ID of the RUM application.
43
43
  attr_reader :org_id
44
44
 
45
- # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`.
45
+ # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`.
46
46
  attr_reader :type
47
47
 
48
48
  # Timestamp in ms of the last update date.
@@ -24,7 +24,7 @@ module DatadogAPIClient::V2
24
24
  # Name of the RUM application.
25
25
  attr_accessor :name
26
26
 
27
- # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`.
27
+ # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`.
28
28
  attr_accessor :type
29
29
 
30
30
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,63 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Convert a rule from JSON to Terraform.
21
+ module SecurityMonitoringRuleConvertPayload
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
+ :'SecurityMonitoringStandardRulePayload',
30
+ :'SecurityMonitoringSignalRulePayload'
31
+ ]
32
+ end
33
+ # Builds the object
34
+ # @param data [Mixed] Data to be matched against the list of oneOf items
35
+ # @return [Object] Returns the model or the data itself
36
+ def build(data)
37
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
38
+ # Note:
39
+ # - We do not attempt to check whether exactly one item matches.
40
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
41
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
42
+ # - TODO: scalar values are de facto behaving as if they were nullable.
43
+ # - TODO: logging when debugging is set.
44
+ openapi_one_of.each do |klass|
45
+ begin
46
+ next if klass == :AnyType # "nullable: true"
47
+ typed_data = find_and_cast_into_type(klass, data)
48
+ next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
49
+ return typed_data if typed_data
50
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
51
+ end
52
+ end
53
+
54
+ if openapi_one_of.include?(:AnyType)
55
+ data
56
+ else
57
+ self._unparsed = true
58
+ DatadogAPIClient::UnparsedObject.new(data)
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,80 @@
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
+ # Result of the convert rule request containing Terraform content.
21
+ class SecurityMonitoringRuleConvertResponse
22
+ include BaseGenericModel
23
+
24
+ # Terraform string as a result of converting the rule from JSON.
25
+ attr_accessor :terraform_content
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ # @!visibility private
29
+ def self.attribute_map
30
+ {
31
+ :'terraform_content' => :'terraformContent'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ # @!visibility private
37
+ def self.openapi_types
38
+ {
39
+ :'terraform_content' => :'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::V2::SecurityMonitoringRuleConvertResponse` 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::V2::SecurityMonitoringRuleConvertResponse`. 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?(:'terraform_content')
60
+ self.terraform_content = attributes[:'terraform_content']
61
+ end
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param o [Object] Object to be compared
66
+ # @!visibility private
67
+ def ==(o)
68
+ return true if self.equal?(o)
69
+ self.class == o.class &&
70
+ terraform_content == o.terraform_content
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Integer] Hash code
75
+ # @!visibility private
76
+ def hash
77
+ [terraform_content].hash
78
+ end
79
+ end
80
+ end
@@ -27,5 +27,6 @@ module DatadogAPIClient::V2
27
27
  IMPOSSIBLE_TRAVEL = "impossible_travel".freeze
28
28
  HARDCODED = "hardcoded".freeze
29
29
  THIRD_PARTY = "third_party".freeze
30
+ ANOMALY_THRESHOLD = "anomaly_threshold".freeze
30
31
  end
31
32
  end
@@ -18,7 +18,7 @@ require 'time'
18
18
 
19
19
  module DatadogAPIClient::V2
20
20
  # A time window is specified to match when at least one of the cases matches true. This is a sliding window
21
- # and evaluates in real time.
21
+ # and evaluates in real time. For third party rules, this field is not used.
22
22
  class SecurityMonitoringRuleEvaluationWindow
23
23
  include BaseEnumModel
24
24
 
@@ -18,7 +18,7 @@ require 'time'
18
18
 
19
19
  module DatadogAPIClient::V2
20
20
  # Once a signal is generated, the signal will remain “open” if a case is matched at least once within
21
- # this keep alive window.
21
+ # this keep alive window. For third party rules, this field is not used.
22
22
  class SecurityMonitoringRuleKeepAlive
23
23
  include BaseEnumModel
24
24
 
@@ -35,7 +35,7 @@ module DatadogAPIClient::V2
35
35
  attr_accessor :detection_method
36
36
 
37
37
  # A time window is specified to match when at least one of the cases matches true. This is a sliding window
38
- # and evaluates in real time.
38
+ # and evaluates in real time. For third party rules, this field is not used.
39
39
  attr_accessor :evaluation_window
40
40
 
41
41
  # Hardcoded evaluator type.
@@ -45,7 +45,7 @@ module DatadogAPIClient::V2
45
45
  attr_accessor :impossible_travel_options
46
46
 
47
47
  # Once a signal is generated, the signal will remain “open” if a case is matched at least once within
48
- # this keep alive window.
48
+ # this keep alive window. For third party rules, this field is not used.
49
49
  attr_accessor :keep_alive
50
50
 
51
51
  # A signal will “close” regardless of the query being matched once the time exceeds the maximum duration.
@@ -0,0 +1,80 @@
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
+ # Request to update a scorecard rule.
21
+ class UpdateRuleRequest
22
+ include BaseGenericModel
23
+
24
+ # Data for the request to update a scorecard rule.
25
+ attr_accessor :data
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ # @!visibility private
29
+ def self.attribute_map
30
+ {
31
+ :'data' => :'data'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ # @!visibility private
37
+ def self.openapi_types
38
+ {
39
+ :'data' => :'UpdateRuleRequestData'
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::V2::UpdateRuleRequest` 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::V2::UpdateRuleRequest`. 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?(:'data')
60
+ self.data = attributes[:'data']
61
+ end
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param o [Object] Object to be compared
66
+ # @!visibility private
67
+ def ==(o)
68
+ return true if self.equal?(o)
69
+ self.class == o.class &&
70
+ data == o.data
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Integer] Hash code
75
+ # @!visibility private
76
+ def hash
77
+ [data].hash
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,90 @@
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
+ # Data for the request to update a scorecard rule.
21
+ class UpdateRuleRequestData
22
+ include BaseGenericModel
23
+
24
+ # Details of a rule.
25
+ attr_accessor :attributes
26
+
27
+ # The JSON:API type for scorecard rules.
28
+ attr_accessor :type
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ # @!visibility private
32
+ def self.attribute_map
33
+ {
34
+ :'attributes' => :'attributes',
35
+ :'type' => :'type'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'attributes' => :'RuleAttributes',
44
+ :'type' => :'RuleType'
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::V2::UpdateRuleRequestData` 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::V2::UpdateRuleRequestData`. 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?(:'attributes')
65
+ self.attributes = attributes[:'attributes']
66
+ end
67
+
68
+ if attributes.key?(:'type')
69
+ self.type = attributes[:'type']
70
+ end
71
+ end
72
+
73
+ # Checks equality by comparing each attribute.
74
+ # @param o [Object] Object to be compared
75
+ # @!visibility private
76
+ def ==(o)
77
+ return true if self.equal?(o)
78
+ self.class == o.class &&
79
+ attributes == o.attributes &&
80
+ type == o.type
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Integer] Hash code
85
+ # @!visibility private
86
+ def hash
87
+ [attributes, type].hash
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,80 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # The response from a rule update request.
21
+ class UpdateRuleResponse
22
+ include BaseGenericModel
23
+
24
+ # The data for a rule update response.
25
+ attr_accessor :data
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ # @!visibility private
29
+ def self.attribute_map
30
+ {
31
+ :'data' => :'data'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ # @!visibility private
37
+ def self.openapi_types
38
+ {
39
+ :'data' => :'UpdateRuleResponseData'
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::V2::UpdateRuleResponse` 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::V2::UpdateRuleResponse`. 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?(:'data')
60
+ self.data = attributes[:'data']
61
+ end
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param o [Object] Object to be compared
66
+ # @!visibility private
67
+ def ==(o)
68
+ return true if self.equal?(o)
69
+ self.class == o.class &&
70
+ data == o.data
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Integer] Hash code
75
+ # @!visibility private
76
+ def hash
77
+ [data].hash
78
+ end
79
+ end
80
+ end