datadog_api_client 2.46.0 → 2.47.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 (141) hide show
  1. checksums.yaml +4 -4
  2. data/.generator/schemas/v1/openapi.yaml +105 -7
  3. data/.generator/schemas/v2/openapi.yaml +1285 -324
  4. data/CHANGELOG.md +26 -0
  5. data/examples/v1/dashboards/CreateDashboard_3685886950.rb +36 -0
  6. data/examples/v1/dashboards/CreateDashboard_865807520.rb +36 -0
  7. data/examples/v1/dashboards/CreateDashboard_9836563.rb +118 -0
  8. data/examples/v2/apm/GetServiceList.rb +5 -0
  9. data/examples/v2/aws-integration/CreateAWSAccount.rb +11 -0
  10. data/examples/v2/aws-integration/CreateAWSAccount_1716720881.rb +11 -0
  11. data/examples/v2/aws-integration/UpdateAWSAccount.rb +11 -0
  12. data/examples/v2/csm-threats/CreateCSMThreatsAgentRule_1295653933.rb +3 -1
  13. data/examples/v2/csm-threats/CreateCSMThreatsAgentRule_1363354233.rb +1 -1
  14. data/examples/v2/deployment-gates/GetDeploymentGateRules.rb +11 -0
  15. data/examples/v2/events/CreateEvent.rb +1 -0
  16. data/examples/v2/observability-pipelines/CreatePipeline.rb +12 -4
  17. data/examples/v2/observability-pipelines/UpdatePipeline.rb +12 -4
  18. data/examples/v2/observability-pipelines/ValidatePipeline.rb +12 -4
  19. data/examples/v2/on-call/CreateUserNotificationChannel.rb +23 -0
  20. data/examples/v2/on-call/DeleteUserNotificationChannel.rb +11 -0
  21. data/examples/v2/on-call/GetUserNotificationChannel.rb +11 -0
  22. data/examples/v2/on-call/ListUserNotificationChannels.rb +8 -0
  23. data/examples/v2/security-monitoring/CreateCases.rb +2 -2
  24. data/examples/v2/security-monitoring/CreateCases_2385516013.rb +1 -1
  25. data/examples/v2/security-monitoring/CreateCases_2798851680.rb +2 -2
  26. data/examples/v2/security-monitoring/CreateJiraIssues.rb +14 -69
  27. data/examples/v2/security-monitoring/GetSecretsRules.rb +1 -1
  28. data/examples/v2/security-monitoring/GetSuppressionVersionHistory.rb +8 -0
  29. data/examples/v2/security-monitoring/ValidateSecurityMonitoringRule_2609327779.rb +54 -0
  30. data/lib/datadog_api_client/configuration.rb +4 -3
  31. data/lib/datadog_api_client/inflector.rb +43 -6
  32. data/lib/datadog_api_client/v1/models/formula_and_function_metric_query_definition.rb +13 -3
  33. data/lib/datadog_api_client/v1/models/formula_and_function_metric_semantic_mode.rb +27 -0
  34. data/lib/datadog_api_client/v1/models/geomap_widget_definition.rb +4 -5
  35. data/lib/datadog_api_client/v1/models/geomap_widget_definition_view.rb +1 -1
  36. data/lib/datadog_api_client/v1/models/geomap_widget_request.rb +37 -3
  37. data/lib/datadog_api_client/v1/models/geomap_widget_request_style.rb +105 -0
  38. data/lib/datadog_api_client/v1/models/monitor_search_response.rb +1 -1
  39. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +41 -1
  40. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +41 -1
  41. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +41 -1
  42. data/lib/datadog_api_client/v2/api/apm_api.rb +83 -0
  43. data/lib/datadog_api_client/v2/api/deployment_gates_api.rb +71 -0
  44. data/lib/datadog_api_client/v2/api/incidents_api.rb +0 -18
  45. data/lib/datadog_api_client/v2/api/on_call_api.rb +277 -0
  46. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +99 -11
  47. data/lib/datadog_api_client/v2/api/teams_api.rb +6 -0
  48. data/lib/datadog_api_client/v2/models/attach_case_request_data.rb +1 -1
  49. data/lib/datadog_api_client/v2/models/attach_jira_issue_request_data.rb +1 -11
  50. data/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_attributes.rb +1 -1
  51. data/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb +11 -1
  52. data/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb +11 -1
  53. data/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb +11 -1
  54. data/lib/datadog_api_client/v2/models/awsccm_config.rb +107 -0
  55. data/lib/datadog_api_client/v2/models/case_insights_items.rb +3 -3
  56. data/lib/datadog_api_client/v2/models/case_management_project_data.rb +1 -1
  57. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_policy_attributes.rb +11 -1
  58. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_policy_version.rb +2 -2
  59. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_action.rb +2 -2
  60. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_action_hash.rb +105 -0
  61. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_action_set.rb +1 -1
  62. data/lib/datadog_api_client/v2/models/{create_jira_issue_request_array_included.rb → cloud_workload_security_agent_rule_action_set_value.rb} +5 -5
  63. data/lib/datadog_api_client/v2/models/create_case_request_data.rb +1 -11
  64. data/lib/datadog_api_client/v2/models/create_case_request_data_attributes.rb +3 -3
  65. data/lib/datadog_api_client/v2/models/create_email_notification_channel_config.rb +167 -0
  66. data/lib/datadog_api_client/v2/models/create_jira_issue_request_array.rb +3 -15
  67. data/lib/datadog_api_client/v2/models/create_jira_issue_request_data.rb +1 -11
  68. data/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes.rb +43 -3
  69. data/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships.rb +35 -14
  70. data/lib/datadog_api_client/v2/models/create_notification_channel_attributes.rb +105 -0
  71. data/lib/datadog_api_client/v2/models/create_notification_channel_config.rb +63 -0
  72. data/lib/datadog_api_client/v2/models/create_notification_channel_data.rb +133 -0
  73. data/lib/datadog_api_client/v2/models/create_phone_notification_channel_config.rb +144 -0
  74. data/lib/datadog_api_client/v2/models/{create_jira_issue_request_data_relationships_case.rb → create_user_notification_channel_request.rb} +5 -5
  75. data/lib/datadog_api_client/v2/models/data_export_config.rb +145 -0
  76. data/lib/datadog_api_client/v2/models/deployment_gate_rules_response.rb +105 -0
  77. data/lib/datadog_api_client/v2/models/detach_case_request_data.rb +1 -11
  78. data/lib/datadog_api_client/v2/models/event_payload.rb +26 -1
  79. data/lib/datadog_api_client/v2/models/finding_case_response_data.rb +1 -1
  80. data/lib/datadog_api_client/v2/models/finding_data.rb +1 -1
  81. data/lib/datadog_api_client/v2/models/finding_jira_issue.rb +2 -2
  82. data/lib/datadog_api_client/v2/models/finding_jira_issue_result.rb +4 -4
  83. data/lib/datadog_api_client/v2/models/get_suppression_version_history_data.rb +125 -0
  84. data/lib/datadog_api_client/v2/models/get_suppression_version_history_data_type.rb +26 -0
  85. data/lib/datadog_api_client/v2/models/get_suppression_version_history_response.rb +105 -0
  86. data/lib/datadog_api_client/v2/models/library.rb +13 -1
  87. data/lib/datadog_api_client/v2/models/list_deployment_rule_response_data.rb +165 -0
  88. data/lib/datadog_api_client/v2/models/list_deployment_rules_data_type.rb +26 -0
  89. data/lib/datadog_api_client/v2/models/{create_jira_issue_request_data_attributes_fields.rb → list_deployment_rules_response_data_attributes.rb} +12 -10
  90. data/lib/datadog_api_client/v2/models/list_notification_channels_response.rb +107 -0
  91. data/lib/datadog_api_client/v2/models/notification_channel.rb +105 -0
  92. data/lib/datadog_api_client/v2/models/notification_channel_attributes.rb +115 -0
  93. data/lib/datadog_api_client/v2/models/notification_channel_config.rb +64 -0
  94. data/lib/datadog_api_client/v2/models/notification_channel_data.rb +143 -0
  95. data/lib/datadog_api_client/v2/models/notification_channel_email_config.rb +167 -0
  96. data/lib/datadog_api_client/v2/models/notification_channel_email_config_type.rb +26 -0
  97. data/lib/datadog_api_client/v2/models/notification_channel_email_format_type.rb +27 -0
  98. data/lib/datadog_api_client/v2/models/notification_channel_phone_config.rb +225 -0
  99. data/lib/datadog_api_client/v2/models/notification_channel_phone_config_type.rb +26 -0
  100. data/lib/datadog_api_client/v2/models/notification_channel_push_config.rb +165 -0
  101. data/lib/datadog_api_client/v2/models/notification_channel_push_config_type.rb +26 -0
  102. data/lib/datadog_api_client/v2/models/notification_channel_type.rb +26 -0
  103. data/lib/datadog_api_client/v2/models/observability_pipeline_add_env_vars_processor.rb +22 -24
  104. data/lib/datadog_api_client/v2/models/observability_pipeline_add_fields_processor.rb +22 -24
  105. data/lib/datadog_api_client/v2/models/observability_pipeline_config.rb +2 -2
  106. data/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_group.rb +211 -0
  107. data/lib/datadog_api_client/v2/models/observability_pipeline_custom_processor.rb +22 -24
  108. data/lib/datadog_api_client/v2/models/observability_pipeline_custom_processor_remap.rb +1 -12
  109. data/lib/datadog_api_client/v2/models/observability_pipeline_datadog_tags_processor.rb +22 -24
  110. data/lib/datadog_api_client/v2/models/observability_pipeline_dedupe_processor.rb +22 -24
  111. data/lib/datadog_api_client/v2/models/observability_pipeline_enrichment_table_processor.rb +22 -24
  112. data/lib/datadog_api_client/v2/models/observability_pipeline_filter_processor.rb +22 -24
  113. data/lib/datadog_api_client/v2/models/observability_pipeline_generate_metrics_processor.rb +24 -48
  114. data/lib/datadog_api_client/v2/models/observability_pipeline_ocsf_mapper_processor.rb +22 -24
  115. data/lib/datadog_api_client/v2/models/observability_pipeline_parse_grok_processor.rb +22 -24
  116. data/lib/datadog_api_client/v2/models/observability_pipeline_parse_json_processor.rb +22 -24
  117. data/lib/datadog_api_client/v2/models/observability_pipeline_quota_processor.rb +18 -31
  118. data/lib/datadog_api_client/v2/models/observability_pipeline_reduce_processor.rb +22 -24
  119. data/lib/datadog_api_client/v2/models/observability_pipeline_remove_fields_processor.rb +22 -24
  120. data/lib/datadog_api_client/v2/models/observability_pipeline_rename_fields_processor.rb +22 -24
  121. data/lib/datadog_api_client/v2/models/observability_pipeline_sample_processor.rb +22 -24
  122. data/lib/datadog_api_client/v2/models/observability_pipeline_sensitive_data_scanner_processor.rb +22 -24
  123. data/lib/datadog_api_client/v2/models/observability_pipeline_throttle_processor.rb +22 -24
  124. data/lib/datadog_api_client/v2/models/rule_versions.rb +1 -1
  125. data/lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options.rb +11 -1
  126. data/lib/datadog_api_client/v2/models/service_list.rb +105 -0
  127. data/lib/datadog_api_client/v2/models/{create_jira_issue_request_data_relationships_case_data.rb → service_list_data.rb} +17 -18
  128. data/lib/datadog_api_client/v2/models/service_list_data_attributes.rb +119 -0
  129. data/lib/datadog_api_client/v2/models/service_list_data_attributes_metadata_items.rb +115 -0
  130. data/lib/datadog_api_client/v2/models/service_list_data_type.rb +26 -0
  131. data/lib/datadog_api_client/v2/models/suppression_version_history.rb +133 -0
  132. data/lib/datadog_api_client/v2/models/suppression_versions.rb +117 -0
  133. data/lib/datadog_api_client/v2/models/{rule_version_update.rb → version_history_update.rb} +3 -3
  134. data/lib/datadog_api_client/v2/models/{rule_version_update_type.rb → version_history_update_type.rb} +1 -1
  135. data/lib/datadog_api_client/v2/models/vulnerability_attributes.rb +11 -1
  136. data/lib/datadog_api_client/v2/models/vulnerability_ecosystem.rb +6 -1
  137. data/lib/datadog_api_client/v2/models/vulnerability_tool.rb +1 -0
  138. data/lib/datadog_api_client/version.rb +1 -1
  139. metadata +55 -9
  140. data/examples/v2/security-monitoring/CreateJiraIssues_379590688.rb +0 -56
  141. data/examples/v2/security-monitoring/CreateJiraIssues_829823123.rb +0 -64
@@ -0,0 +1,107 @@
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 type for listing notification channels for a user
21
+ class ListNotificationChannelsResponse
22
+ include BaseGenericModel
23
+
24
+ #
25
+ attr_accessor :data
26
+
27
+ attr_accessor :additional_properties
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ # @!visibility private
31
+ def self.attribute_map
32
+ {
33
+ :'data' => :'data'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ # @!visibility private
39
+ def self.openapi_types
40
+ {
41
+ :'data' => :'Array<NotificationChannelData>'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param attributes [Hash] Model attributes in the form of hash
47
+ # @!visibility private
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListNotificationChannelsResponse` initialize method"
51
+ end
52
+
53
+ self.additional_properties = {}
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ self.additional_properties[k.to_sym] = v
58
+ else
59
+ h[k.to_sym] = v
60
+ end
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
+ # Returns the object in the form of hash, with additionalProperties support.
71
+ # @return [Hash] Returns the object in the form of hash
72
+ # @!visibility private
73
+ def to_hash
74
+ hash = {}
75
+ self.class.attribute_map.each_pair do |attr, param|
76
+ value = self.send(attr)
77
+ if value.nil?
78
+ is_nullable = self.class.openapi_nullable.include?(attr)
79
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
80
+ end
81
+
82
+ hash[param] = _to_hash(value)
83
+ end
84
+ self.additional_properties.each_pair do |attr, value|
85
+ hash[attr] = value
86
+ end
87
+ hash
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param o [Object] Object to be compared
92
+ # @!visibility private
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ data == o.data &&
97
+ additional_properties == o.additional_properties
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ # @!visibility private
103
+ def hash
104
+ [data, additional_properties].hash
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,105 @@
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 top-level wrapper for a user notification channel
21
+ class NotificationChannel
22
+ include BaseGenericModel
23
+
24
+ # Data for an on-call notification channel
25
+ attr_accessor :data
26
+
27
+ attr_accessor :additional_properties
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ # @!visibility private
31
+ def self.attribute_map
32
+ {
33
+ :'data' => :'data'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ # @!visibility private
39
+ def self.openapi_types
40
+ {
41
+ :'data' => :'NotificationChannelData'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param attributes [Hash] Model attributes in the form of hash
47
+ # @!visibility private
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NotificationChannel` initialize method"
51
+ end
52
+
53
+ self.additional_properties = {}
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ self.additional_properties[k.to_sym] = v
58
+ else
59
+ h[k.to_sym] = v
60
+ end
61
+ }
62
+
63
+ if attributes.key?(:'data')
64
+ self.data = attributes[:'data']
65
+ end
66
+ end
67
+
68
+ # Returns the object in the form of hash, with additionalProperties support.
69
+ # @return [Hash] Returns the object in the form of hash
70
+ # @!visibility private
71
+ def to_hash
72
+ hash = {}
73
+ self.class.attribute_map.each_pair do |attr, param|
74
+ value = self.send(attr)
75
+ if value.nil?
76
+ is_nullable = self.class.openapi_nullable.include?(attr)
77
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
78
+ end
79
+
80
+ hash[param] = _to_hash(value)
81
+ end
82
+ self.additional_properties.each_pair do |attr, value|
83
+ hash[attr] = value
84
+ end
85
+ hash
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param o [Object] Object to be compared
90
+ # @!visibility private
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ data == o.data &&
95
+ additional_properties == o.additional_properties
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Integer] Hash code
100
+ # @!visibility private
101
+ def hash
102
+ [data, additional_properties].hash
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,115 @@
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
+ # Attributes for an on-call notification channel.
21
+ class NotificationChannelAttributes
22
+ include BaseGenericModel
23
+
24
+ # Whether the notification channel is currently active.
25
+ attr_accessor :active
26
+
27
+ # Defines the configuration for an On-Call notification channel
28
+ attr_accessor :config
29
+
30
+ attr_accessor :additional_properties
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ # @!visibility private
34
+ def self.attribute_map
35
+ {
36
+ :'active' => :'active',
37
+ :'config' => :'config'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ # @!visibility private
43
+ def self.openapi_types
44
+ {
45
+ :'active' => :'Boolean',
46
+ :'config' => :'NotificationChannelConfig'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param attributes [Hash] Model attributes in the form of hash
52
+ # @!visibility private
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NotificationChannelAttributes` initialize method"
56
+ end
57
+
58
+ self.additional_properties = {}
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ self.additional_properties[k.to_sym] = v
63
+ else
64
+ h[k.to_sym] = v
65
+ end
66
+ }
67
+
68
+ if attributes.key?(:'active')
69
+ self.active = attributes[:'active']
70
+ end
71
+
72
+ if attributes.key?(:'config')
73
+ self.config = attributes[:'config']
74
+ end
75
+ end
76
+
77
+ # Returns the object in the form of hash, with additionalProperties support.
78
+ # @return [Hash] Returns the object in the form of hash
79
+ # @!visibility private
80
+ def to_hash
81
+ hash = {}
82
+ self.class.attribute_map.each_pair do |attr, param|
83
+ value = self.send(attr)
84
+ if value.nil?
85
+ is_nullable = self.class.openapi_nullable.include?(attr)
86
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
87
+ end
88
+
89
+ hash[param] = _to_hash(value)
90
+ end
91
+ self.additional_properties.each_pair do |attr, value|
92
+ hash[attr] = value
93
+ end
94
+ hash
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param o [Object] Object to be compared
99
+ # @!visibility private
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ active == o.active &&
104
+ config == o.config &&
105
+ additional_properties == o.additional_properties
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Integer] Hash code
110
+ # @!visibility private
111
+ def hash
112
+ [active, config, additional_properties].hash
113
+ end
114
+ end
115
+ end
@@ -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
+ # Defines the configuration for an On-Call notification channel
21
+ module NotificationChannelConfig
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
+ :'NotificationChannelPhoneConfig',
30
+ :'NotificationChannelEmailConfig',
31
+ :'NotificationChannelPushConfig'
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,143 @@
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 an on-call notification channel
21
+ class NotificationChannelData
22
+ include BaseGenericModel
23
+
24
+ # Attributes for an on-call notification channel.
25
+ attr_accessor :attributes
26
+
27
+ # Unique identifier for the channel
28
+ attr_accessor :id
29
+
30
+ # Indicates that the resource is of type 'notification_channels'.
31
+ attr_reader :type
32
+
33
+ attr_accessor :additional_properties
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ # @!visibility private
37
+ def self.attribute_map
38
+ {
39
+ :'attributes' => :'attributes',
40
+ :'id' => :'id',
41
+ :'type' => :'type'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ # @!visibility private
47
+ def self.openapi_types
48
+ {
49
+ :'attributes' => :'NotificationChannelAttributes',
50
+ :'id' => :'String',
51
+ :'type' => :'NotificationChannelType'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param attributes [Hash] Model attributes in the form of hash
57
+ # @!visibility private
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NotificationChannelData` initialize method"
61
+ end
62
+
63
+ self.additional_properties = {}
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ self.additional_properties[k.to_sym] = v
68
+ else
69
+ h[k.to_sym] = v
70
+ end
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
+ return false if @type.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param type [Object] Object to be assigned
96
+ # @!visibility private
97
+ def type=(type)
98
+ if type.nil?
99
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
100
+ end
101
+ @type = type
102
+ end
103
+
104
+ # Returns the object in the form of hash, with additionalProperties support.
105
+ # @return [Hash] Returns the object in the form of hash
106
+ # @!visibility private
107
+ def to_hash
108
+ hash = {}
109
+ self.class.attribute_map.each_pair do |attr, param|
110
+ value = self.send(attr)
111
+ if value.nil?
112
+ is_nullable = self.class.openapi_nullable.include?(attr)
113
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
114
+ end
115
+
116
+ hash[param] = _to_hash(value)
117
+ end
118
+ self.additional_properties.each_pair do |attr, value|
119
+ hash[attr] = value
120
+ end
121
+ hash
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param o [Object] Object to be compared
126
+ # @!visibility private
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ attributes == o.attributes &&
131
+ id == o.id &&
132
+ type == o.type &&
133
+ additional_properties == o.additional_properties
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ # @!visibility private
139
+ def hash
140
+ [attributes, id, type, additional_properties].hash
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,167 @@
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
+ # Email notification channel configuration
21
+ class NotificationChannelEmailConfig
22
+ include BaseGenericModel
23
+
24
+ # The e-mail address to be notified
25
+ attr_reader :address
26
+
27
+ # Preferred content formats for notifications.
28
+ attr_reader :formats
29
+
30
+ # Indicates that the notification channel is an e-mail address
31
+ attr_reader :type
32
+
33
+ attr_accessor :additional_properties
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ # @!visibility private
37
+ def self.attribute_map
38
+ {
39
+ :'address' => :'address',
40
+ :'formats' => :'formats',
41
+ :'type' => :'type'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ # @!visibility private
47
+ def self.openapi_types
48
+ {
49
+ :'address' => :'String',
50
+ :'formats' => :'Array<NotificationChannelEmailFormatType>',
51
+ :'type' => :'NotificationChannelEmailConfigType'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param attributes [Hash] Model attributes in the form of hash
57
+ # @!visibility private
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NotificationChannelEmailConfig` initialize method"
61
+ end
62
+
63
+ self.additional_properties = {}
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ self.additional_properties[k.to_sym] = v
68
+ else
69
+ h[k.to_sym] = v
70
+ end
71
+ }
72
+
73
+ if attributes.key?(:'address')
74
+ self.address = attributes[:'address']
75
+ end
76
+
77
+ if attributes.key?(:'formats')
78
+ if (value = attributes[:'formats']).is_a?(Array)
79
+ self.formats = value
80
+ end
81
+ end
82
+
83
+ if attributes.key?(:'type')
84
+ self.type = attributes[:'type']
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 @address.nil?
93
+ return false if @formats.nil?
94
+ return false if @type.nil?
95
+ true
96
+ end
97
+
98
+ # Custom attribute writer method with validation
99
+ # @param address [Object] Object to be assigned
100
+ # @!visibility private
101
+ def address=(address)
102
+ if address.nil?
103
+ fail ArgumentError, 'invalid value for "address", address cannot be nil.'
104
+ end
105
+ @address = address
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param formats [Object] Object to be assigned
110
+ # @!visibility private
111
+ def formats=(formats)
112
+ if formats.nil?
113
+ fail ArgumentError, 'invalid value for "formats", formats cannot be nil.'
114
+ end
115
+ @formats = formats
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param type [Object] Object to be assigned
120
+ # @!visibility private
121
+ def type=(type)
122
+ if type.nil?
123
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
124
+ end
125
+ @type = type
126
+ end
127
+
128
+ # Returns the object in the form of hash, with additionalProperties support.
129
+ # @return [Hash] Returns the object in the form of hash
130
+ # @!visibility private
131
+ def to_hash
132
+ hash = {}
133
+ self.class.attribute_map.each_pair do |attr, param|
134
+ value = self.send(attr)
135
+ if value.nil?
136
+ is_nullable = self.class.openapi_nullable.include?(attr)
137
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
138
+ end
139
+
140
+ hash[param] = _to_hash(value)
141
+ end
142
+ self.additional_properties.each_pair do |attr, value|
143
+ hash[attr] = value
144
+ end
145
+ hash
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param o [Object] Object to be compared
150
+ # @!visibility private
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ address == o.address &&
155
+ formats == o.formats &&
156
+ type == o.type &&
157
+ additional_properties == o.additional_properties
158
+ end
159
+
160
+ # Calculates hash code according to all attributes.
161
+ # @return [Integer] Hash code
162
+ # @!visibility private
163
+ def hash
164
+ [address, formats, type, additional_properties].hash
165
+ end
166
+ end
167
+ end