datadog_api_client 2.41.0 → 2.42.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 (117) hide show
  1. checksums.yaml +4 -4
  2. data/.generator/schemas/v1/openapi.yaml +69 -8
  3. data/.generator/schemas/v2/openapi.yaml +1568 -40
  4. data/CHANGELOG.md +15 -0
  5. data/examples/v2/actions-datastores/BulkWriteDatastoreItems.rb +24 -0
  6. data/examples/v2/actions-datastores/CreateDatastore.rb +15 -0
  7. data/examples/v2/actions-datastores/DeleteDatastore.rb +8 -0
  8. data/examples/v2/actions-datastores/DeleteDatastoreItem.rb +17 -0
  9. data/examples/v2/actions-datastores/GetDatastore.rb +8 -0
  10. data/examples/v2/actions-datastores/ListDatastoreItems.rb +8 -0
  11. data/examples/v2/actions-datastores/ListDatastores.rb +5 -0
  12. data/examples/v2/actions-datastores/UpdateDatastore.rb +18 -0
  13. data/examples/v2/actions-datastores/UpdateDatastoreItem.rb +18 -0
  14. data/examples/v2/aws-integration/CreateAWSAccount.rb +0 -3
  15. data/examples/v2/aws-integration/CreateAWSAccount_1716720881.rb +0 -3
  16. data/examples/v2/aws-integration/CreateNewAWSExternalID.rb +0 -3
  17. data/examples/v2/aws-integration/CreateNewAWSExternalID_364713854.rb +0 -3
  18. data/examples/v2/aws-integration/DeleteAWSAccount.rb +0 -3
  19. data/examples/v2/aws-integration/GetAWSAccount.rb +0 -3
  20. data/examples/v2/aws-integration/ListAWSAccounts.rb +0 -3
  21. data/examples/v2/aws-integration/ListAWSNamespaces.rb +0 -3
  22. data/examples/v2/aws-integration/ListAWSNamespaces_3031307873.rb +0 -3
  23. data/examples/v2/aws-integration/UpdateAWSAccount.rb +0 -3
  24. data/examples/v2/aws-logs-integration/ListAWSLogsServices.rb +0 -3
  25. data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2836340212.rb +52 -0
  26. data/examples/v2/incidents/CreateIncidentNotificationRule.rb +50 -0
  27. data/examples/v2/incidents/CreateIncidentNotificationRule_3029800608.rb +42 -0
  28. data/examples/v2/incidents/DeleteIncidentNotificationRule.rb +8 -0
  29. data/examples/v2/incidents/DeleteIncidentNotificationRule_4148107167.rb +11 -0
  30. data/examples/v2/incidents/GetIncidentNotificationRule.rb +8 -0
  31. data/examples/v2/incidents/GetIncidentNotificationRule_67441486.rb +11 -0
  32. data/examples/v2/incidents/ListIncidentNotificationRules.rb +8 -0
  33. data/examples/v2/incidents/UpdateIncidentNotificationRule.rb +51 -0
  34. data/examples/v2/incidents/UpdateIncidentNotificationRule_1207309457.rb +45 -0
  35. data/lib/datadog_api_client/configuration.rb +5 -8
  36. data/lib/datadog_api_client/inflector.rb +67 -0
  37. data/lib/datadog_api_client/v1/api/aws_integration_api.rb +27 -0
  38. data/lib/datadog_api_client/v1/api/aws_logs_integration_api.rb +9 -0
  39. data/lib/datadog_api_client/v1/models/gcp_account.rb +18 -4
  40. data/lib/datadog_api_client/v1/models/gcp_monitored_resource_config.rb +118 -0
  41. data/lib/datadog_api_client/v1/models/gcp_monitored_resource_config_type.rb +28 -0
  42. data/lib/datadog_api_client/v2/api/actions_datastores_api.rb +655 -0
  43. data/lib/datadog_api_client/v2/api/aws_integration_api.rb +0 -42
  44. data/lib/datadog_api_client/v2/api/aws_logs_integration_api.rb +0 -6
  45. data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +2 -0
  46. data/lib/datadog_api_client/v2/api/incidents_api.rb +367 -0
  47. data/lib/datadog_api_client/v2/api/org_connections_api.rb +8 -0
  48. data/lib/datadog_api_client/v2/models/bulk_put_apps_datastore_items_request.rb +105 -0
  49. data/lib/datadog_api_client/v2/models/bulk_put_apps_datastore_items_request_data.rb +133 -0
  50. data/lib/datadog_api_client/v2/models/bulk_put_apps_datastore_items_request_data_attributes.rb +139 -0
  51. data/lib/datadog_api_client/v2/models/ci_app_create_pipeline_event_request.rb +2 -2
  52. data/lib/datadog_api_client/v2/models/ci_app_create_pipeline_event_request_data_single_or_array.rb +63 -0
  53. data/lib/datadog_api_client/v2/models/create_apps_datastore_request.rb +105 -0
  54. data/lib/datadog_api_client/v2/models/create_apps_datastore_request_data.rb +143 -0
  55. data/lib/datadog_api_client/v2/models/create_apps_datastore_request_data_attributes.rb +180 -0
  56. data/lib/datadog_api_client/v2/models/create_apps_datastore_request_data_attributes_org_access.rb +28 -0
  57. data/lib/datadog_api_client/v2/models/create_apps_datastore_response.rb +105 -0
  58. data/lib/datadog_api_client/v2/models/create_apps_datastore_response_data.rb +133 -0
  59. data/lib/datadog_api_client/v2/models/create_incident_notification_rule_request.rb +123 -0
  60. data/lib/datadog_api_client/v2/models/datastore.rb +105 -0
  61. data/lib/datadog_api_client/v2/models/datastore_array.rb +125 -0
  62. data/lib/datadog_api_client/v2/models/datastore_data.rb +143 -0
  63. data/lib/datadog_api_client/v2/models/datastore_data_attributes.rb +205 -0
  64. data/lib/datadog_api_client/v2/models/datastore_data_type.rb +26 -0
  65. data/lib/datadog_api_client/v2/models/datastore_item_conflict_mode.rb +27 -0
  66. data/lib/datadog_api_client/v2/models/datastore_items_data_type.rb +26 -0
  67. data/lib/datadog_api_client/v2/models/datastore_primary_key_generation_strategy.rb +27 -0
  68. data/lib/datadog_api_client/v2/models/delete_apps_datastore_item_request.rb +105 -0
  69. data/lib/datadog_api_client/v2/models/delete_apps_datastore_item_request_data.rb +133 -0
  70. data/lib/datadog_api_client/v2/models/delete_apps_datastore_item_request_data_attributes.rb +137 -0
  71. data/lib/datadog_api_client/v2/models/delete_apps_datastore_item_response.rb +105 -0
  72. data/lib/datadog_api_client/v2/models/delete_apps_datastore_item_response_data.rb +133 -0
  73. data/lib/datadog_api_client/v2/models/dora_failure_request_attributes.rb +1 -1
  74. data/lib/datadog_api_client/v2/models/gcp_monitored_resource_config.rb +118 -0
  75. data/lib/datadog_api_client/v2/models/gcp_monitored_resource_config_type.rb +28 -0
  76. data/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb +17 -2
  77. data/lib/datadog_api_client/v2/models/incident_notification_rule.rb +135 -0
  78. data/lib/datadog_api_client/v2/models/incident_notification_rule_array.rb +147 -0
  79. data/lib/datadog_api_client/v2/models/incident_notification_rule_array_meta.rb +105 -0
  80. data/lib/datadog_api_client/v2/models/incident_notification_rule_array_meta_page.rb +125 -0
  81. data/lib/datadog_api_client/v2/models/incident_notification_rule_attributes.rb +265 -0
  82. data/lib/datadog_api_client/v2/models/incident_notification_rule_attributes_visibility.rb +28 -0
  83. data/lib/datadog_api_client/v2/models/incident_notification_rule_conditions_items.rb +146 -0
  84. data/lib/datadog_api_client/v2/models/incident_notification_rule_create_attributes.rb +201 -0
  85. data/lib/datadog_api_client/v2/models/incident_notification_rule_create_attributes_visibility.rb +28 -0
  86. data/lib/datadog_api_client/v2/models/incident_notification_rule_create_data.rb +154 -0
  87. data/lib/datadog_api_client/v2/models/incident_notification_rule_create_data_relationships.rb +115 -0
  88. data/lib/datadog_api_client/v2/models/incident_notification_rule_included_items.rb +64 -0
  89. data/lib/datadog_api_client/v2/models/incident_notification_rule_relationships.rb +135 -0
  90. data/lib/datadog_api_client/v2/models/incident_notification_rule_response_data.rb +164 -0
  91. data/lib/datadog_api_client/v2/models/incident_notification_rule_type.rb +26 -0
  92. data/lib/datadog_api_client/v2/models/incident_notification_rule_update_data.rb +175 -0
  93. data/lib/datadog_api_client/v2/models/incident_notification_template_object.rb +164 -0
  94. data/lib/datadog_api_client/v2/models/item_api_payload.rb +105 -0
  95. data/lib/datadog_api_client/v2/models/item_api_payload_array.rb +139 -0
  96. data/lib/datadog_api_client/v2/models/item_api_payload_data.rb +143 -0
  97. data/lib/datadog_api_client/v2/models/item_api_payload_data_attributes.rb +185 -0
  98. data/lib/datadog_api_client/v2/models/item_api_payload_meta.rb +115 -0
  99. data/lib/datadog_api_client/v2/models/item_api_payload_meta_page.rb +125 -0
  100. data/lib/datadog_api_client/v2/models/item_api_payload_meta_schema.rb +117 -0
  101. data/lib/datadog_api_client/v2/models/item_api_payload_meta_schema_field.rb +144 -0
  102. data/lib/datadog_api_client/v2/models/put_apps_datastore_item_response_array.rb +129 -0
  103. data/lib/datadog_api_client/v2/models/put_apps_datastore_item_response_data.rb +133 -0
  104. data/lib/datadog_api_client/v2/models/put_incident_notification_rule_request.rb +123 -0
  105. data/lib/datadog_api_client/v2/models/relationship_to_incident_notification_template.rb +123 -0
  106. data/lib/datadog_api_client/v2/models/relationship_to_incident_notification_template_data.rb +144 -0
  107. data/lib/datadog_api_client/v2/models/security_monitoring_rule_convert_response.rb +11 -1
  108. data/lib/datadog_api_client/v2/models/update_apps_datastore_item_request.rb +105 -0
  109. data/lib/datadog_api_client/v2/models/update_apps_datastore_item_request_data.rb +143 -0
  110. data/lib/datadog_api_client/v2/models/update_apps_datastore_item_request_data_attributes.rb +158 -0
  111. data/lib/datadog_api_client/v2/models/update_apps_datastore_item_request_data_attributes_item_changes.rb +105 -0
  112. data/lib/datadog_api_client/v2/models/update_apps_datastore_item_request_data_type.rb +26 -0
  113. data/lib/datadog_api_client/v2/models/update_apps_datastore_request.rb +105 -0
  114. data/lib/datadog_api_client/v2/models/update_apps_datastore_request_data.rb +143 -0
  115. data/lib/datadog_api_client/v2/models/update_apps_datastore_request_data_attributes.rb +115 -0
  116. data/lib/datadog_api_client/version.rb +1 -1
  117. metadata +87 -1
@@ -0,0 +1,154 @@
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
+ # Notification rule data for a create request.
21
+ class IncidentNotificationRuleCreateData
22
+ include BaseGenericModel
23
+
24
+ # The attributes for creating a notification rule.
25
+ attr_reader :attributes
26
+
27
+ # The definition of `NotificationRuleCreateDataRelationships` object.
28
+ attr_accessor :relationships
29
+
30
+ # Notification rules resource type.
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
+ :'relationships' => :'relationships',
41
+ :'type' => :'type'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ # @!visibility private
47
+ def self.openapi_types
48
+ {
49
+ :'attributes' => :'IncidentNotificationRuleCreateAttributes',
50
+ :'relationships' => :'IncidentNotificationRuleCreateDataRelationships',
51
+ :'type' => :'IncidentNotificationRuleType'
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::IncidentNotificationRuleCreateData` 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?(:'relationships')
78
+ self.relationships = attributes[:'relationships']
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 @attributes.nil?
91
+ return false if @type.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param attributes [Object] Object to be assigned
97
+ # @!visibility private
98
+ def attributes=(attributes)
99
+ if attributes.nil?
100
+ fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
101
+ end
102
+ @attributes = attributes
103
+ end
104
+
105
+ # Custom attribute writer method with validation
106
+ # @param type [Object] Object to be assigned
107
+ # @!visibility private
108
+ def type=(type)
109
+ if type.nil?
110
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
111
+ end
112
+ @type = type
113
+ end
114
+
115
+ # Returns the object in the form of hash, with additionalProperties support.
116
+ # @return [Hash] Returns the object in the form of hash
117
+ # @!visibility private
118
+ def to_hash
119
+ hash = {}
120
+ self.class.attribute_map.each_pair do |attr, param|
121
+ value = self.send(attr)
122
+ if value.nil?
123
+ is_nullable = self.class.openapi_nullable.include?(attr)
124
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
125
+ end
126
+
127
+ hash[param] = _to_hash(value)
128
+ end
129
+ self.additional_properties.each_pair do |attr, value|
130
+ hash[attr] = value
131
+ end
132
+ hash
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param o [Object] Object to be compared
137
+ # @!visibility private
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ attributes == o.attributes &&
142
+ relationships == o.relationships &&
143
+ type == o.type &&
144
+ additional_properties == o.additional_properties
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ # @!visibility private
150
+ def hash
151
+ [attributes, relationships, type, additional_properties].hash
152
+ end
153
+ end
154
+ 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
+ # The definition of `NotificationRuleCreateDataRelationships` object.
21
+ class IncidentNotificationRuleCreateDataRelationships
22
+ include BaseGenericModel
23
+
24
+ # Relationship to an incident type.
25
+ attr_accessor :incident_type
26
+
27
+ # A relationship reference to a notification template.
28
+ attr_accessor :notification_template
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
+ :'incident_type' => :'incident_type',
37
+ :'notification_template' => :'notification_template'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ # @!visibility private
43
+ def self.openapi_types
44
+ {
45
+ :'incident_type' => :'RelationshipToIncidentType',
46
+ :'notification_template' => :'RelationshipToIncidentNotificationTemplate'
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::IncidentNotificationRuleCreateDataRelationships` 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?(:'incident_type')
69
+ self.incident_type = attributes[:'incident_type']
70
+ end
71
+
72
+ if attributes.key?(:'notification_template')
73
+ self.notification_template = attributes[:'notification_template']
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
+ incident_type == o.incident_type &&
104
+ notification_template == o.notification_template &&
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
+ [incident_type, notification_template, 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
+ # Objects related to a notification rule.
21
+ module IncidentNotificationRuleIncludedItems
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
+ :'User',
30
+ :'IncidentTypeObject',
31
+ :'IncidentNotificationTemplateObject'
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,135 @@
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 notification rule's resource relationships.
21
+ class IncidentNotificationRuleRelationships
22
+ include BaseGenericModel
23
+
24
+ # Relationship to user.
25
+ attr_accessor :created_by_user
26
+
27
+ # Relationship to an incident type.
28
+ attr_accessor :incident_type
29
+
30
+ # Relationship to user.
31
+ attr_accessor :last_modified_by_user
32
+
33
+ # A relationship reference to a notification template.
34
+ attr_accessor :notification_template
35
+
36
+ attr_accessor :additional_properties
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ # @!visibility private
40
+ def self.attribute_map
41
+ {
42
+ :'created_by_user' => :'created_by_user',
43
+ :'incident_type' => :'incident_type',
44
+ :'last_modified_by_user' => :'last_modified_by_user',
45
+ :'notification_template' => :'notification_template'
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ # @!visibility private
51
+ def self.openapi_types
52
+ {
53
+ :'created_by_user' => :'RelationshipToUser',
54
+ :'incident_type' => :'RelationshipToIncidentType',
55
+ :'last_modified_by_user' => :'RelationshipToUser',
56
+ :'notification_template' => :'RelationshipToIncidentNotificationTemplate'
57
+ }
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param attributes [Hash] Model attributes in the form of hash
62
+ # @!visibility private
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationRuleRelationships` initialize method"
66
+ end
67
+
68
+ self.additional_properties = {}
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ self.additional_properties[k.to_sym] = v
73
+ else
74
+ h[k.to_sym] = v
75
+ end
76
+ }
77
+
78
+ if attributes.key?(:'created_by_user')
79
+ self.created_by_user = attributes[:'created_by_user']
80
+ end
81
+
82
+ if attributes.key?(:'incident_type')
83
+ self.incident_type = attributes[:'incident_type']
84
+ end
85
+
86
+ if attributes.key?(:'last_modified_by_user')
87
+ self.last_modified_by_user = attributes[:'last_modified_by_user']
88
+ end
89
+
90
+ if attributes.key?(:'notification_template')
91
+ self.notification_template = attributes[:'notification_template']
92
+ end
93
+ end
94
+
95
+ # Returns the object in the form of hash, with additionalProperties support.
96
+ # @return [Hash] Returns the object in the form of hash
97
+ # @!visibility private
98
+ def to_hash
99
+ hash = {}
100
+ self.class.attribute_map.each_pair do |attr, param|
101
+ value = self.send(attr)
102
+ if value.nil?
103
+ is_nullable = self.class.openapi_nullable.include?(attr)
104
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
105
+ end
106
+
107
+ hash[param] = _to_hash(value)
108
+ end
109
+ self.additional_properties.each_pair do |attr, value|
110
+ hash[attr] = value
111
+ end
112
+ hash
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param o [Object] Object to be compared
117
+ # @!visibility private
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ created_by_user == o.created_by_user &&
122
+ incident_type == o.incident_type &&
123
+ last_modified_by_user == o.last_modified_by_user &&
124
+ notification_template == o.notification_template &&
125
+ additional_properties == o.additional_properties
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ # @!visibility private
131
+ def hash
132
+ [created_by_user, incident_type, last_modified_by_user, notification_template, additional_properties].hash
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,164 @@
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
+ # Notification rule data from a response.
21
+ class IncidentNotificationRuleResponseData
22
+ include BaseGenericModel
23
+
24
+ # The notification rule's attributes.
25
+ attr_accessor :attributes
26
+
27
+ # The unique identifier of the notification rule.
28
+ attr_reader :id
29
+
30
+ # The notification rule's resource relationships.
31
+ attr_accessor :relationships
32
+
33
+ # Notification rules resource type.
34
+ attr_reader :type
35
+
36
+ attr_accessor :additional_properties
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ # @!visibility private
40
+ def self.attribute_map
41
+ {
42
+ :'attributes' => :'attributes',
43
+ :'id' => :'id',
44
+ :'relationships' => :'relationships',
45
+ :'type' => :'type'
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ # @!visibility private
51
+ def self.openapi_types
52
+ {
53
+ :'attributes' => :'IncidentNotificationRuleAttributes',
54
+ :'id' => :'UUID',
55
+ :'relationships' => :'IncidentNotificationRuleRelationships',
56
+ :'type' => :'IncidentNotificationRuleType'
57
+ }
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param attributes [Hash] Model attributes in the form of hash
62
+ # @!visibility private
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationRuleResponseData` initialize method"
66
+ end
67
+
68
+ self.additional_properties = {}
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ self.additional_properties[k.to_sym] = v
73
+ else
74
+ h[k.to_sym] = v
75
+ end
76
+ }
77
+
78
+ if attributes.key?(:'attributes')
79
+ self.attributes = attributes[:'attributes']
80
+ end
81
+
82
+ if attributes.key?(:'id')
83
+ self.id = attributes[:'id']
84
+ end
85
+
86
+ if attributes.key?(:'relationships')
87
+ self.relationships = attributes[:'relationships']
88
+ end
89
+
90
+ if attributes.key?(:'type')
91
+ self.type = attributes[:'type']
92
+ end
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ # @!visibility private
98
+ def valid?
99
+ return false if @id.nil?
100
+ return false if @type.nil?
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method with validation
105
+ # @param id [Object] Object to be assigned
106
+ # @!visibility private
107
+ def id=(id)
108
+ if id.nil?
109
+ fail ArgumentError, 'invalid value for "id", id cannot be nil.'
110
+ end
111
+ @id = id
112
+ end
113
+
114
+ # Custom attribute writer method with validation
115
+ # @param type [Object] Object to be assigned
116
+ # @!visibility private
117
+ def type=(type)
118
+ if type.nil?
119
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
120
+ end
121
+ @type = type
122
+ end
123
+
124
+ # Returns the object in the form of hash, with additionalProperties support.
125
+ # @return [Hash] Returns the object in the form of hash
126
+ # @!visibility private
127
+ def to_hash
128
+ hash = {}
129
+ self.class.attribute_map.each_pair do |attr, param|
130
+ value = self.send(attr)
131
+ if value.nil?
132
+ is_nullable = self.class.openapi_nullable.include?(attr)
133
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
134
+ end
135
+
136
+ hash[param] = _to_hash(value)
137
+ end
138
+ self.additional_properties.each_pair do |attr, value|
139
+ hash[attr] = value
140
+ end
141
+ hash
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param o [Object] Object to be compared
146
+ # @!visibility private
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ attributes == o.attributes &&
151
+ id == o.id &&
152
+ relationships == o.relationships &&
153
+ type == o.type &&
154
+ additional_properties == o.additional_properties
155
+ end
156
+
157
+ # Calculates hash code according to all attributes.
158
+ # @return [Integer] Hash code
159
+ # @!visibility private
160
+ def hash
161
+ [attributes, id, relationships, type, additional_properties].hash
162
+ end
163
+ end
164
+ 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
+ # Notification rules resource type.
21
+ class IncidentNotificationRuleType
22
+ include BaseEnumModel
23
+
24
+ INCIDENT_NOTIFICATION_RULES = "incident_notification_rules".freeze
25
+ end
26
+ end