datadog_api_client 2.20.0 → 2.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/conftest.py +5 -0
  4. data/.generator/schemas/v1/openapi.yaml +333 -128
  5. data/.generator/schemas/v2/openapi.yaml +2450 -131
  6. data/CHANGELOG.md +28 -0
  7. data/examples/v1/gcp-integration/CreateGCPIntegration.rb +3 -0
  8. data/examples/v1/gcp-integration/UpdateGCPIntegration_3544259255.rb +25 -0
  9. data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +29 -0
  10. data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -0
  11. data/examples/v2/case-management/ArchiveCase.rb +14 -0
  12. data/examples/v2/case-management/AssignCase.rb +20 -0
  13. data/examples/v2/case-management/CreateCase.rb +33 -0
  14. data/examples/v2/case-management/CreateProject.rb +15 -0
  15. data/examples/v2/case-management/DeleteProject.rb +5 -0
  16. data/examples/v2/case-management/GetCase.rb +8 -0
  17. data/examples/v2/case-management/GetProject.rb +5 -0
  18. data/examples/v2/case-management/GetProjects.rb +5 -0
  19. data/examples/v2/case-management/SearchCases.rb +5 -0
  20. data/examples/v2/case-management/SearchCases_3433960044.rb +5 -0
  21. data/examples/v2/case-management/UnarchiveCase.rb +14 -0
  22. data/examples/v2/case-management/UnassignCase.rb +14 -0
  23. data/examples/v2/case-management/UpdatePriority.rb +17 -0
  24. data/examples/v2/case-management/UpdateStatus.rb +17 -0
  25. data/examples/v2/cloud-workload-security/CreateCSMThreatsAgentRule.rb +17 -0
  26. data/examples/v2/cloud-workload-security/DeleteCSMThreatsAgentRule.rb +8 -0
  27. data/examples/v2/cloud-workload-security/DownloadCSMThreatsPolicy.rb +5 -0
  28. data/examples/v2/cloud-workload-security/GetCSMThreatsAgentRule.rb +8 -0
  29. data/examples/v2/cloud-workload-security/ListCSMThreatsAgentRules.rb +5 -0
  30. data/examples/v2/cloud-workload-security/UpdateCSMThreatsAgentRule.rb +20 -0
  31. data/examples/v2/dora-metrics/CreateDORAIncident.rb +6 -3
  32. data/examples/v2/gcp-integration/CreateGCPSTSAccount_194782945.rb +18 -0
  33. data/examples/v2/gcp-integration/UpdateGCPSTSAccount_2241994060.rb +21 -0
  34. data/examples/v2/logs-custom-destinations/CreateLogsCustomDestination.rb +31 -0
  35. data/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1091442807.rb +31 -0
  36. data/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1288180912.rb +27 -0
  37. data/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_141236188.rb +32 -0
  38. data/examples/v2/logs-custom-destinations/CreateLogsCustomDestination_2184123765.rb +31 -0
  39. data/examples/v2/logs-custom-destinations/DeleteLogsCustomDestination.rb +8 -0
  40. data/examples/v2/logs-custom-destinations/GetLogsCustomDestination.rb +8 -0
  41. data/examples/v2/logs-custom-destinations/ListLogsCustomDestinations.rb +5 -0
  42. data/examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb +18 -0
  43. data/examples/v2/metrics/ListMetricAssets.rb +5 -0
  44. data/lib/datadog_api_client/inflector.rb +112 -0
  45. data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -3
  46. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +5 -5
  47. data/lib/datadog_api_client/v1/models/gcp_account.rb +14 -1
  48. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +6 -0
  49. data/lib/datadog_api_client/v1/models/monitor_formula_and_function_events_data_source.rb +1 -0
  50. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +8 -0
  51. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +84 -4
  52. data/lib/datadog_api_client/v1/models/synthetics_api_step_subtype.rb +1 -0
  53. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +11 -1
  54. data/lib/datadog_api_client/v1/models/usage_attribution_body.rb +1 -1
  55. data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +2 -0
  56. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +2 -0
  57. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +81 -1
  58. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +83 -3
  59. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +182 -102
  60. data/lib/datadog_api_client/v2/api/case_management_api.rb +942 -0
  61. data/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb +2 -2
  62. data/lib/datadog_api_client/v2/api/cloud_workload_security_api.rb +392 -0
  63. data/lib/datadog_api_client/v2/api/incident_services_api.rb +15 -0
  64. data/lib/datadog_api_client/v2/api/logs_custom_destinations_api.rb +355 -0
  65. data/lib/datadog_api_client/v2/api/metrics_api.rb +69 -1
  66. data/lib/datadog_api_client/v2/api/service_definition_api.rb +2 -1
  67. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +3 -3
  68. data/lib/datadog_api_client/v2/models/case.rb +150 -0
  69. data/lib/datadog_api_client/v2/models/case3rd_party_ticket_status.rb +28 -0
  70. data/lib/datadog_api_client/v2/models/case_assign.rb +119 -0
  71. data/lib/datadog_api_client/v2/models/case_assign_attributes.rb +98 -0
  72. data/lib/datadog_api_client/v2/models/case_assign_request.rb +98 -0
  73. data/lib/datadog_api_client/v2/models/case_attributes.rb +202 -0
  74. data/lib/datadog_api_client/v2/models/case_create.rb +129 -0
  75. data/lib/datadog_api_client/v2/models/case_create_attributes.rb +139 -0
  76. data/lib/datadog_api_client/v2/models/case_create_relationships.rb +116 -0
  77. data/lib/datadog_api_client/v2/models/case_create_request.rb +98 -0
  78. data/lib/datadog_api_client/v2/models/case_empty.rb +98 -0
  79. data/lib/datadog_api_client/v2/models/case_empty_request.rb +98 -0
  80. data/lib/datadog_api_client/v2/models/case_priority.rb +31 -0
  81. data/lib/datadog_api_client/v2/models/case_relationships.rb +120 -0
  82. data/lib/datadog_api_client/v2/models/case_resource_type.rb +26 -0
  83. data/lib/datadog_api_client/v2/models/case_response.rb +80 -0
  84. data/lib/datadog_api_client/v2/models/case_sortable_field.rb +28 -0
  85. data/lib/datadog_api_client/v2/models/case_status.rb +28 -0
  86. data/lib/datadog_api_client/v2/models/case_type.rb +26 -0
  87. data/lib/datadog_api_client/v2/models/case_update_priority.rb +119 -0
  88. data/lib/datadog_api_client/v2/models/case_update_priority_attributes.rb +98 -0
  89. data/lib/datadog_api_client/v2/models/case_update_priority_request.rb +98 -0
  90. data/lib/datadog_api_client/v2/models/case_update_status.rb +119 -0
  91. data/lib/datadog_api_client/v2/models/case_update_status_attributes.rb +98 -0
  92. data/lib/datadog_api_client/v2/models/case_update_status_request.rb +98 -0
  93. data/lib/datadog_api_client/v2/models/cases_response.rb +92 -0
  94. data/lib/datadog_api_client/v2/models/cases_response_meta.rb +80 -0
  95. data/lib/datadog_api_client/v2/models/cases_response_meta_pagination.rb +100 -0
  96. data/lib/datadog_api_client/v2/models/ci_app_aggregate_sort.rb +1 -1
  97. data/lib/datadog_api_client/v2/models/ci_app_pipelines_group_by.rb +1 -1
  98. data/lib/datadog_api_client/v2/models/ci_app_tests_group_by.rb +1 -1
  99. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_action.rb +90 -0
  100. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_attributes.rb +21 -1
  101. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_kill.rb +80 -0
  102. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_update_data.rb +11 -1
  103. data/lib/datadog_api_client/v2/models/custom_destination_attribute_tags_restriction_list_type.rb +31 -0
  104. data/lib/datadog_api_client/v2/models/custom_destination_create_request.rb +80 -0
  105. data/lib/datadog_api_client/v2/models/custom_destination_create_request_attributes.rb +193 -0
  106. data/lib/datadog_api_client/v2/models/custom_destination_create_request_definition.rb +119 -0
  107. data/lib/datadog_api_client/v2/models/custom_destination_elasticsearch_destination_auth.rb +119 -0
  108. data/lib/datadog_api_client/v2/models/custom_destination_forward_destination.rb +64 -0
  109. data/lib/datadog_api_client/v2/models/custom_destination_forward_destination_elasticsearch.rb +181 -0
  110. data/lib/datadog_api_client/v2/models/custom_destination_forward_destination_elasticsearch_type.rb +26 -0
  111. data/lib/datadog_api_client/v2/models/custom_destination_forward_destination_http.rb +141 -0
  112. data/lib/datadog_api_client/v2/models/custom_destination_forward_destination_http_type.rb +26 -0
  113. data/lib/datadog_api_client/v2/models/custom_destination_forward_destination_splunk.rb +141 -0
  114. data/lib/datadog_api_client/v2/models/custom_destination_forward_destination_splunk_type.rb +26 -0
  115. data/lib/datadog_api_client/v2/models/custom_destination_http_destination_auth.rb +63 -0
  116. data/lib/datadog_api_client/v2/models/custom_destination_http_destination_auth_basic.rb +140 -0
  117. data/lib/datadog_api_client/v2/models/custom_destination_http_destination_auth_basic_type.rb +26 -0
  118. data/lib/datadog_api_client/v2/models/custom_destination_http_destination_auth_custom_header.rb +140 -0
  119. data/lib/datadog_api_client/v2/models/custom_destination_http_destination_auth_custom_header_type.rb +26 -0
  120. data/lib/datadog_api_client/v2/models/custom_destination_response.rb +80 -0
  121. data/lib/datadog_api_client/v2/models/custom_destination_response_attributes.rb +171 -0
  122. data/lib/datadog_api_client/v2/models/custom_destination_response_definition.rb +100 -0
  123. data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination.rb +64 -0
  124. data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_elasticsearch.rb +181 -0
  125. data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_elasticsearch_type.rb +26 -0
  126. data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_http.rb +141 -0
  127. data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_http_type.rb +26 -0
  128. data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_splunk.rb +120 -0
  129. data/lib/datadog_api_client/v2/models/custom_destination_response_forward_destination_splunk_type.rb +26 -0
  130. data/lib/datadog_api_client/v2/models/custom_destination_response_http_destination_auth.rb +63 -0
  131. data/lib/datadog_api_client/v2/models/custom_destination_response_http_destination_auth_basic.rb +98 -0
  132. data/lib/datadog_api_client/v2/models/custom_destination_response_http_destination_auth_basic_type.rb +26 -0
  133. data/lib/datadog_api_client/v2/models/custom_destination_response_http_destination_auth_custom_header.rb +119 -0
  134. data/lib/datadog_api_client/v2/models/custom_destination_response_http_destination_auth_custom_header_type.rb +26 -0
  135. data/lib/datadog_api_client/v2/models/custom_destination_type.rb +26 -0
  136. data/lib/datadog_api_client/v2/models/custom_destination_update_request.rb +80 -0
  137. data/lib/datadog_api_client/v2/models/custom_destination_update_request_attributes.rb +169 -0
  138. data/lib/datadog_api_client/v2/models/custom_destination_update_request_definition.rb +129 -0
  139. data/lib/datadog_api_client/v2/models/custom_destinations_response.rb +82 -0
  140. data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +21 -20
  141. data/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb +14 -1
  142. data/lib/datadog_api_client/v2/models/jira_issue.rb +90 -0
  143. data/lib/datadog_api_client/v2/models/jira_issue_result.rb +110 -0
  144. data/lib/datadog_api_client/v2/models/logs_archive_integration_gcs.rb +1 -12
  145. data/lib/datadog_api_client/v2/models/metric_asset_attributes.rb +80 -0
  146. data/lib/datadog_api_client/v2/models/metric_asset_dashboard_relationship.rb +90 -0
  147. data/lib/datadog_api_client/v2/models/metric_asset_dashboard_relationships.rb +82 -0
  148. data/lib/datadog_api_client/v2/models/metric_asset_monitor_relationship.rb +90 -0
  149. data/lib/datadog_api_client/v2/models/metric_asset_monitor_relationships.rb +82 -0
  150. data/lib/datadog_api_client/v2/models/metric_asset_notebook_relationship.rb +90 -0
  151. data/lib/datadog_api_client/v2/models/metric_asset_notebook_relationships.rb +82 -0
  152. data/lib/datadog_api_client/v2/models/metric_asset_response_data.rb +129 -0
  153. data/lib/datadog_api_client/v2/models/metric_asset_response_included.rb +65 -0
  154. data/lib/datadog_api_client/v2/models/metric_asset_response_relationships.rb +110 -0
  155. data/lib/datadog_api_client/v2/models/metric_asset_slo_relationship.rb +90 -0
  156. data/lib/datadog_api_client/v2/models/metric_asset_slo_relationships.rb +82 -0
  157. data/lib/datadog_api_client/v2/models/metric_assets_response.rb +92 -0
  158. data/lib/datadog_api_client/v2/models/metric_dashboard_asset.rb +129 -0
  159. data/lib/datadog_api_client/v2/models/metric_dashboard_attributes.rb +112 -0
  160. data/lib/datadog_api_client/v2/models/metric_dashboard_type.rb +26 -0
  161. data/lib/datadog_api_client/v2/models/metric_monitor_asset.rb +129 -0
  162. data/lib/datadog_api_client/v2/models/metric_monitor_type.rb +26 -0
  163. data/lib/datadog_api_client/v2/models/metric_notebook_asset.rb +129 -0
  164. data/lib/datadog_api_client/v2/models/metric_notebook_type.rb +26 -0
  165. data/lib/datadog_api_client/v2/models/metric_slo_asset.rb +129 -0
  166. data/lib/datadog_api_client/v2/models/metric_slo_type.rb +26 -0
  167. data/lib/datadog_api_client/v2/models/nullable_user_relationship.rb +88 -0
  168. data/lib/datadog_api_client/v2/models/nullable_user_relationship_data.rb +119 -0
  169. data/lib/datadog_api_client/v2/models/project.rb +150 -0
  170. data/lib/datadog_api_client/v2/models/project_attributes.rb +90 -0
  171. data/lib/datadog_api_client/v2/models/project_create.rb +119 -0
  172. data/lib/datadog_api_client/v2/models/project_create_attributes.rb +119 -0
  173. data/lib/datadog_api_client/v2/models/project_create_request.rb +98 -0
  174. data/lib/datadog_api_client/v2/models/project_relationship.rb +98 -0
  175. data/lib/datadog_api_client/v2/models/project_relationship_data.rb +119 -0
  176. data/lib/datadog_api_client/v2/models/project_relationships.rb +90 -0
  177. data/lib/datadog_api_client/v2/models/project_resource_type.rb +26 -0
  178. data/lib/datadog_api_client/v2/models/project_response.rb +80 -0
  179. data/lib/datadog_api_client/v2/models/projects_response.rb +82 -0
  180. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_standard_pattern_attributes.rb +1 -1
  181. data/lib/datadog_api_client/v2/models/service_now_ticket.rb +90 -0
  182. data/lib/datadog_api_client/v2/models/service_now_ticket_result.rb +80 -0
  183. data/lib/datadog_api_client/v2/models/user_relationship_data.rb +119 -0
  184. data/lib/datadog_api_client/v2/models/user_resource_type.rb +26 -0
  185. data/lib/datadog_api_client/v2/models/user_team_included.rb +62 -0
  186. data/lib/datadog_api_client/v2/models/user_team_response.rb +16 -4
  187. data/lib/datadog_api_client/v2/models/users_relationship.rb +100 -0
  188. data/lib/datadog_api_client/version.rb +1 -1
  189. metadata +147 -2
@@ -0,0 +1,64 @@
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 custom destination's location to forward logs.
21
+ module CustomDestinationForwardDestination
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
+ :'CustomDestinationForwardDestinationHttp',
30
+ :'CustomDestinationForwardDestinationSplunk',
31
+ :'CustomDestinationForwardDestinationElasticsearch'
32
+ ]
33
+ end
34
+ # Builds the object
35
+ # @param data [Mixed] Data to be matched against the list of oneOf items
36
+ # @return [Object] Returns the model or the data itself
37
+ def build(data)
38
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
39
+ # Note:
40
+ # - We do not attempt to check whether exactly one item matches.
41
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
42
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
43
+ # - TODO: scalar values are de facto behaving as if they were nullable.
44
+ # - TODO: logging when debugging is set.
45
+ openapi_one_of.each do |klass|
46
+ begin
47
+ next if klass == :AnyType # "nullable: true"
48
+ typed_data = find_and_cast_into_type(klass, data)
49
+ next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
50
+ return typed_data if typed_data
51
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
52
+ end
53
+ end
54
+
55
+ if openapi_one_of.include?(:AnyType)
56
+ data
57
+ else
58
+ self._unparsed = true
59
+ DatadogAPIClient::UnparsedObject.new(data)
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,181 @@
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 Elasticsearch destination.
21
+ class CustomDestinationForwardDestinationElasticsearch
22
+ include BaseGenericModel
23
+
24
+ # Basic access authentication.
25
+ attr_reader :auth
26
+
27
+ # The destination for which logs will be forwarded to.
28
+ # Must have HTTPS scheme and forwarding back to Datadog is not allowed.
29
+ attr_reader :endpoint
30
+
31
+ # Name of the Elasticsearch index (must follow [Elasticsearch's criteria](https://www.elastic.co/guide/en/elasticsearch/reference/8.11/indices-create-index.html#indices-create-api-path-params)).
32
+ attr_reader :index_name
33
+
34
+ # Date pattern with US locale and UTC timezone to be appended to the index name after adding `-`
35
+ # (that is, `${index_name}-${indexPattern}`).
36
+ # You can customize the index rotation naming pattern by choosing one of these options:
37
+ # - Hourly: `yyyy-MM-dd-HH` (as an example, it would render: `2022-10-19-09`)
38
+ # - Daily: `yyyy-MM-dd` (as an example, it would render: `2022-10-19`)
39
+ # - Weekly: `yyyy-'W'ww` (as an example, it would render: `2022-W42`)
40
+ # - Monthly: `yyyy-MM` (as an example, it would render: `2022-10`)
41
+ #
42
+ # If this field is missing or is blank, it means that the index name will always be the same
43
+ # (that is, no rotation).
44
+ attr_accessor :index_rotation
45
+
46
+ # Type of the Elasticsearch destination.
47
+ attr_reader :type
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ # @!visibility private
51
+ def self.attribute_map
52
+ {
53
+ :'auth' => :'auth',
54
+ :'endpoint' => :'endpoint',
55
+ :'index_name' => :'index_name',
56
+ :'index_rotation' => :'index_rotation',
57
+ :'type' => :'type'
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ # @!visibility private
63
+ def self.openapi_types
64
+ {
65
+ :'auth' => :'CustomDestinationElasticsearchDestinationAuth',
66
+ :'endpoint' => :'String',
67
+ :'index_name' => :'String',
68
+ :'index_rotation' => :'String',
69
+ :'type' => :'CustomDestinationForwardDestinationElasticsearchType'
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::V2::CustomDestinationForwardDestinationElasticsearch` 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::V2::CustomDestinationForwardDestinationElasticsearch`. 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?(:'auth')
90
+ self.auth = attributes[:'auth']
91
+ end
92
+
93
+ if attributes.key?(:'endpoint')
94
+ self.endpoint = attributes[:'endpoint']
95
+ end
96
+
97
+ if attributes.key?(:'index_name')
98
+ self.index_name = attributes[:'index_name']
99
+ end
100
+
101
+ if attributes.key?(:'index_rotation')
102
+ self.index_rotation = attributes[:'index_rotation']
103
+ end
104
+
105
+ if attributes.key?(:'type')
106
+ self.type = attributes[:'type']
107
+ end
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ # @!visibility private
113
+ def valid?
114
+ return false if @auth.nil?
115
+ return false if @endpoint.nil?
116
+ return false if @index_name.nil?
117
+ return false if @type.nil?
118
+ true
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param auth [Object] Object to be assigned
123
+ # @!visibility private
124
+ def auth=(auth)
125
+ if auth.nil?
126
+ fail ArgumentError, 'invalid value for "auth", auth cannot be nil.'
127
+ end
128
+ @auth = auth
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param endpoint [Object] Object to be assigned
133
+ # @!visibility private
134
+ def endpoint=(endpoint)
135
+ if endpoint.nil?
136
+ fail ArgumentError, 'invalid value for "endpoint", endpoint cannot be nil.'
137
+ end
138
+ @endpoint = endpoint
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param index_name [Object] Object to be assigned
143
+ # @!visibility private
144
+ def index_name=(index_name)
145
+ if index_name.nil?
146
+ fail ArgumentError, 'invalid value for "index_name", index_name cannot be nil.'
147
+ end
148
+ @index_name = index_name
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param type [Object] Object to be assigned
153
+ # @!visibility private
154
+ def type=(type)
155
+ if type.nil?
156
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
157
+ end
158
+ @type = type
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param o [Object] Object to be compared
163
+ # @!visibility private
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ auth == o.auth &&
168
+ endpoint == o.endpoint &&
169
+ index_name == o.index_name &&
170
+ index_rotation == o.index_rotation &&
171
+ type == o.type
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ # @!visibility private
177
+ def hash
178
+ [auth, endpoint, index_name, index_rotation, type].hash
179
+ end
180
+ end
181
+ 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
+ # Type of the Elasticsearch destination.
21
+ class CustomDestinationForwardDestinationElasticsearchType
22
+ include BaseEnumModel
23
+
24
+ ELASTICSEARCH = "elasticsearch".freeze
25
+ end
26
+ end
@@ -0,0 +1,141 @@
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 HTTP destination.
21
+ class CustomDestinationForwardDestinationHttp
22
+ include BaseGenericModel
23
+
24
+ # Authentication method of the HTTP requests.
25
+ attr_reader :auth
26
+
27
+ # The destination for which logs will be forwarded to.
28
+ # Must have HTTPS scheme and forwarding back to Datadog is not allowed.
29
+ attr_reader :endpoint
30
+
31
+ # Type of the HTTP destination.
32
+ attr_reader :type
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'auth' => :'auth',
39
+ :'endpoint' => :'endpoint',
40
+ :'type' => :'type'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ # @!visibility private
46
+ def self.openapi_types
47
+ {
48
+ :'auth' => :'CustomDestinationHttpDestinationAuth',
49
+ :'endpoint' => :'String',
50
+ :'type' => :'CustomDestinationForwardDestinationHttpType'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param attributes [Hash] Model attributes in the form of hash
56
+ # @!visibility private
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CustomDestinationForwardDestinationHttp` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CustomDestinationForwardDestinationHttp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'auth')
71
+ self.auth = attributes[:'auth']
72
+ end
73
+
74
+ if attributes.key?(:'endpoint')
75
+ self.endpoint = attributes[:'endpoint']
76
+ end
77
+
78
+ if attributes.key?(:'type')
79
+ self.type = attributes[:'type']
80
+ end
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ # @!visibility private
86
+ def valid?
87
+ return false if @auth.nil?
88
+ return false if @endpoint.nil?
89
+ return false if @type.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param auth [Object] Object to be assigned
95
+ # @!visibility private
96
+ def auth=(auth)
97
+ if auth.nil?
98
+ fail ArgumentError, 'invalid value for "auth", auth cannot be nil.'
99
+ end
100
+ @auth = auth
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param endpoint [Object] Object to be assigned
105
+ # @!visibility private
106
+ def endpoint=(endpoint)
107
+ if endpoint.nil?
108
+ fail ArgumentError, 'invalid value for "endpoint", endpoint cannot be nil.'
109
+ end
110
+ @endpoint = endpoint
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param type [Object] Object to be assigned
115
+ # @!visibility private
116
+ def type=(type)
117
+ if type.nil?
118
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
119
+ end
120
+ @type = type
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param o [Object] Object to be compared
125
+ # @!visibility private
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ auth == o.auth &&
130
+ endpoint == o.endpoint &&
131
+ type == o.type
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ # @!visibility private
137
+ def hash
138
+ [auth, endpoint, type].hash
139
+ end
140
+ end
141
+ 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
+ # Type of the HTTP destination.
21
+ class CustomDestinationForwardDestinationHttpType
22
+ include BaseEnumModel
23
+
24
+ HTTP = "http".freeze
25
+ end
26
+ end
@@ -0,0 +1,141 @@
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 Splunk HTTP Event Collector (HEC) destination.
21
+ class CustomDestinationForwardDestinationSplunk
22
+ include BaseGenericModel
23
+
24
+ # Access token of the Splunk HTTP Event Collector. This field is not returned by the API.
25
+ attr_reader :access_token
26
+
27
+ # The destination for which logs will be forwarded to.
28
+ # Must have HTTPS scheme and forwarding back to Datadog is not allowed.
29
+ attr_reader :endpoint
30
+
31
+ # Type of the Splunk HTTP Event Collector (HEC) destination.
32
+ attr_reader :type
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'access_token' => :'access_token',
39
+ :'endpoint' => :'endpoint',
40
+ :'type' => :'type'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ # @!visibility private
46
+ def self.openapi_types
47
+ {
48
+ :'access_token' => :'String',
49
+ :'endpoint' => :'String',
50
+ :'type' => :'CustomDestinationForwardDestinationSplunkType'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param attributes [Hash] Model attributes in the form of hash
56
+ # @!visibility private
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'access_token')
71
+ self.access_token = attributes[:'access_token']
72
+ end
73
+
74
+ if attributes.key?(:'endpoint')
75
+ self.endpoint = attributes[:'endpoint']
76
+ end
77
+
78
+ if attributes.key?(:'type')
79
+ self.type = attributes[:'type']
80
+ end
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ # @!visibility private
86
+ def valid?
87
+ return false if @access_token.nil?
88
+ return false if @endpoint.nil?
89
+ return false if @type.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param access_token [Object] Object to be assigned
95
+ # @!visibility private
96
+ def access_token=(access_token)
97
+ if access_token.nil?
98
+ fail ArgumentError, 'invalid value for "access_token", access_token cannot be nil.'
99
+ end
100
+ @access_token = access_token
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param endpoint [Object] Object to be assigned
105
+ # @!visibility private
106
+ def endpoint=(endpoint)
107
+ if endpoint.nil?
108
+ fail ArgumentError, 'invalid value for "endpoint", endpoint cannot be nil.'
109
+ end
110
+ @endpoint = endpoint
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param type [Object] Object to be assigned
115
+ # @!visibility private
116
+ def type=(type)
117
+ if type.nil?
118
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
119
+ end
120
+ @type = type
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param o [Object] Object to be compared
125
+ # @!visibility private
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ access_token == o.access_token &&
130
+ endpoint == o.endpoint &&
131
+ type == o.type
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ # @!visibility private
137
+ def hash
138
+ [access_token, endpoint, type].hash
139
+ end
140
+ end
141
+ 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
+ # Type of the Splunk HTTP Event Collector (HEC) destination.
21
+ class CustomDestinationForwardDestinationSplunkType
22
+ include BaseEnumModel
23
+
24
+ SPLUNK_HEC = "splunk_hec".freeze
25
+ end
26
+ end
@@ -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
+ # Authentication method of the HTTP requests.
21
+ module CustomDestinationHttpDestinationAuth
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
+ :'CustomDestinationHttpDestinationAuthBasic',
30
+ :'CustomDestinationHttpDestinationAuthCustomHeader'
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