datadog_api_client 2.37.0 → 2.38.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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +20 -1
  4. data/.generator/schemas/v2/openapi.yaml +1083 -74
  5. data/CHANGELOG.md +20 -0
  6. data/examples/v2/action-connection/GetAppKeyRegistration.rb +5 -0
  7. data/examples/v2/action-connection/ListAppKeyRegistrations.rb +5 -0
  8. data/examples/v2/action-connection/RegisterAppKey.rb +5 -0
  9. data/examples/v2/action-connection/UnregisterAppKey.rb +5 -0
  10. data/examples/v2/events/CreateEvent.rb +4 -2
  11. data/examples/v2/monitors/CreateMonitorUserTemplate.rb +37 -0
  12. data/examples/v2/monitors/DeleteMonitorUserTemplate.rb +8 -0
  13. data/examples/v2/monitors/GetMonitorUserTemplate.rb +11 -0
  14. data/examples/v2/monitors/ListMonitorUserTemplates.rb +8 -0
  15. data/examples/v2/monitors/UpdateMonitorUserTemplate.rb +41 -0
  16. data/examples/v2/monitors/ValidateExistingMonitorUserTemplate.rb +41 -0
  17. data/examples/v2/monitors/ValidateMonitorUserTemplate.rb +37 -0
  18. data/lib/datadog_api_client/configuration.rb +59 -0
  19. data/lib/datadog_api_client/inflector.rb +29 -0
  20. data/lib/datadog_api_client/v1/models/synthetics_mobile_test.rb +12 -1
  21. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +1 -1
  22. data/lib/datadog_api_client/v1/models/synthetics_test_request_dns_server_port.rb +63 -0
  23. data/lib/datadog_api_client/v2/api/action_connection_api.rb +263 -4
  24. data/lib/datadog_api_client/v2/api/app_builder_api.rb +8 -8
  25. data/lib/datadog_api_client/v2/api/events_api.rb +8 -4
  26. data/lib/datadog_api_client/v2/api/monitors_api.rb +512 -0
  27. data/lib/datadog_api_client/v2/api/workflow_automation_api.rb +8 -8
  28. data/lib/datadog_api_client/v2/models/alert_event_custom_attributes.rb +145 -0
  29. data/lib/datadog_api_client/v2/models/alert_event_custom_attributes_links_items.rb +152 -0
  30. data/lib/datadog_api_client/v2/models/alert_event_custom_attributes_links_items_category.rb +28 -0
  31. data/lib/datadog_api_client/v2/models/alert_event_custom_attributes_priority.rb +30 -0
  32. data/lib/datadog_api_client/v2/models/alert_event_custom_attributes_status.rb +28 -0
  33. data/lib/datadog_api_client/v2/models/app_key_registration_data.rb +133 -0
  34. data/lib/datadog_api_client/v2/models/app_key_registration_data_type.rb +26 -0
  35. data/lib/datadog_api_client/v2/models/change_event_custom_attributes.rb +19 -33
  36. data/lib/datadog_api_client/v2/models/change_event_custom_attributes_author.rb +10 -31
  37. data/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource.rb +15 -32
  38. data/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource_type.rb +1 -1
  39. data/lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items.rb +15 -32
  40. data/lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items_type.rb +1 -1
  41. data/lib/datadog_api_client/v2/models/event_category.rb +2 -1
  42. data/lib/datadog_api_client/v2/models/event_create_request.rb +32 -3
  43. data/lib/datadog_api_client/v2/models/event_create_request_payload.rb +20 -2
  44. data/lib/datadog_api_client/v2/models/event_create_response.rb +3 -3
  45. data/lib/datadog_api_client/v2/models/event_create_response_attributes.rb +2 -2
  46. data/lib/datadog_api_client/v2/models/event_create_response_attributes_attributes.rb +1 -1
  47. data/lib/datadog_api_client/v2/models/event_create_response_attributes_attributes_evt.rb +14 -4
  48. data/lib/datadog_api_client/v2/models/event_create_response_payload.rb +15 -5
  49. data/lib/datadog_api_client/v2/models/event_create_response_payload_links.rb +105 -0
  50. data/lib/datadog_api_client/v2/models/event_payload.rb +48 -36
  51. data/lib/datadog_api_client/v2/models/event_payload_attributes.rb +3 -2
  52. data/lib/datadog_api_client/v2/models/event_payload_integration_id.rb +26 -0
  53. data/lib/datadog_api_client/v2/models/get_app_key_registration_response.rb +105 -0
  54. data/lib/datadog_api_client/v2/models/incident_create_attributes.rb +11 -1
  55. data/lib/datadog_api_client/v2/models/incident_response_attributes.rb +11 -1
  56. data/lib/datadog_api_client/v2/models/job_definition_from_rule.rb +1 -26
  57. data/lib/datadog_api_client/v2/models/list_app_key_registrations_response.rb +117 -0
  58. data/lib/datadog_api_client/v2/models/list_app_key_registrations_response_meta.rb +115 -0
  59. data/lib/datadog_api_client/v2/models/monitor_user_template.rb +200 -0
  60. data/lib/datadog_api_client/v2/models/monitor_user_template_create_data.rb +144 -0
  61. data/lib/datadog_api_client/v2/models/monitor_user_template_create_request.rb +123 -0
  62. data/lib/datadog_api_client/v2/models/monitor_user_template_create_response.rb +105 -0
  63. data/lib/datadog_api_client/v2/models/monitor_user_template_list_response.rb +107 -0
  64. data/lib/datadog_api_client/v2/models/monitor_user_template_request_attributes.rb +172 -0
  65. data/lib/datadog_api_client/v2/models/monitor_user_template_resource_type.rb +26 -0
  66. data/lib/datadog_api_client/v2/models/monitor_user_template_response.rb +105 -0
  67. data/lib/datadog_api_client/v2/models/monitor_user_template_response_attributes.rb +188 -0
  68. data/lib/datadog_api_client/v2/models/monitor_user_template_response_data.rb +125 -0
  69. data/lib/datadog_api_client/v2/models/monitor_user_template_response_data_with_versions.rb +125 -0
  70. data/lib/datadog_api_client/v2/models/monitor_user_template_template_variables_items.rb +132 -0
  71. data/lib/datadog_api_client/v2/models/monitor_user_template_update_data.rb +165 -0
  72. data/lib/datadog_api_client/v2/models/monitor_user_template_update_request.rb +123 -0
  73. data/lib/datadog_api_client/v2/models/register_app_key_response.rb +105 -0
  74. data/lib/datadog_api_client/v2/models/simple_monitor_user_template.rb +188 -0
  75. data/lib/datadog_api_client/version.rb +1 -1
  76. metadata +41 -1
@@ -0,0 +1,125 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Monitor user template list response data.
21
+ class MonitorUserTemplateResponseData
22
+ include BaseGenericModel
23
+
24
+ # Attributes for a monitor user template.
25
+ attr_accessor :attributes
26
+
27
+ # The unique identifier.
28
+ attr_accessor :id
29
+
30
+ # Monitor user template resource type.
31
+ attr_accessor :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' => :'MonitorUserTemplateResponseAttributes',
50
+ :'id' => :'String',
51
+ :'type' => :'MonitorUserTemplateResourceType'
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::MonitorUserTemplateResponseData` 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
+ # Returns the object in the form of hash, with additionalProperties support.
87
+ # @return [Hash] Returns the object in the form of hash
88
+ # @!visibility private
89
+ def to_hash
90
+ hash = {}
91
+ self.class.attribute_map.each_pair do |attr, param|
92
+ value = self.send(attr)
93
+ if value.nil?
94
+ is_nullable = self.class.openapi_nullable.include?(attr)
95
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
96
+ end
97
+
98
+ hash[param] = _to_hash(value)
99
+ end
100
+ self.additional_properties.each_pair do |attr, value|
101
+ hash[attr] = value
102
+ end
103
+ hash
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param o [Object] Object to be compared
108
+ # @!visibility private
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ attributes == o.attributes &&
113
+ id == o.id &&
114
+ type == o.type &&
115
+ additional_properties == o.additional_properties
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ # @!visibility private
121
+ def hash
122
+ [attributes, id, type, additional_properties].hash
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,125 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Monitor user template data.
21
+ class MonitorUserTemplateResponseDataWithVersions
22
+ include BaseGenericModel
23
+
24
+ # A monitor user template object.
25
+ attr_accessor :attributes
26
+
27
+ # The unique identifier.
28
+ attr_accessor :id
29
+
30
+ # Monitor user template resource type.
31
+ attr_accessor :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' => :'MonitorUserTemplate',
50
+ :'id' => :'String',
51
+ :'type' => :'MonitorUserTemplateResourceType'
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::MonitorUserTemplateResponseDataWithVersions` 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
+ # Returns the object in the form of hash, with additionalProperties support.
87
+ # @return [Hash] Returns the object in the form of hash
88
+ # @!visibility private
89
+ def to_hash
90
+ hash = {}
91
+ self.class.attribute_map.each_pair do |attr, param|
92
+ value = self.send(attr)
93
+ if value.nil?
94
+ is_nullable = self.class.openapi_nullable.include?(attr)
95
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
96
+ end
97
+
98
+ hash[param] = _to_hash(value)
99
+ end
100
+ self.additional_properties.each_pair do |attr, value|
101
+ hash[attr] = value
102
+ end
103
+ hash
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param o [Object] Object to be compared
108
+ # @!visibility private
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ attributes == o.attributes &&
113
+ id == o.id &&
114
+ type == o.type &&
115
+ additional_properties == o.additional_properties
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ # @!visibility private
121
+ def hash
122
+ [attributes, id, type, additional_properties].hash
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,132 @@
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
+ # List of objects representing template variables on the monitor which can have selectable values.
21
+ class MonitorUserTemplateTemplateVariablesItems
22
+ include BaseGenericModel
23
+
24
+ # Available values for the variable.
25
+ attr_accessor :available_values
26
+
27
+ # Default values of the template variable.
28
+ attr_accessor :defaults
29
+
30
+ # The name of the template variable.
31
+ attr_reader :name
32
+
33
+ # The tag key associated with the variable. This works the same as dashboard template variables.
34
+ attr_accessor :tag_key
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ # @!visibility private
38
+ def self.attribute_map
39
+ {
40
+ :'available_values' => :'available_values',
41
+ :'defaults' => :'defaults',
42
+ :'name' => :'name',
43
+ :'tag_key' => :'tag_key'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ # @!visibility private
49
+ def self.openapi_types
50
+ {
51
+ :'available_values' => :'Array<String>',
52
+ :'defaults' => :'Array<String>',
53
+ :'name' => :'String',
54
+ :'tag_key' => :'String'
55
+ }
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param attributes [Hash] Model attributes in the form of hash
60
+ # @!visibility private
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateTemplateVariablesItems` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MonitorUserTemplateTemplateVariablesItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'available_values')
75
+ if (value = attributes[:'available_values']).is_a?(Array)
76
+ self.available_values = value
77
+ end
78
+ end
79
+
80
+ if attributes.key?(:'defaults')
81
+ if (value = attributes[:'defaults']).is_a?(Array)
82
+ self.defaults = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'name')
87
+ self.name = attributes[:'name']
88
+ end
89
+
90
+ if attributes.key?(:'tag_key')
91
+ self.tag_key = attributes[:'tag_key']
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 @name.nil?
100
+ true
101
+ end
102
+
103
+ # Custom attribute writer method with validation
104
+ # @param name [Object] Object to be assigned
105
+ # @!visibility private
106
+ def name=(name)
107
+ if name.nil?
108
+ fail ArgumentError, 'invalid value for "name", name cannot be nil.'
109
+ end
110
+ @name = name
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param o [Object] Object to be compared
115
+ # @!visibility private
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ available_values == o.available_values &&
120
+ defaults == o.defaults &&
121
+ name == o.name &&
122
+ tag_key == o.tag_key
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ # @!visibility private
128
+ def hash
129
+ [available_values, defaults, name, tag_key].hash
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,165 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Monitor user template data.
21
+ class MonitorUserTemplateUpdateData
22
+ include BaseGenericModel
23
+
24
+ # Attributes for a monitor user template.
25
+ attr_reader :attributes
26
+
27
+ # The unique identifier.
28
+ attr_reader :id
29
+
30
+ # Monitor user template 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
+ :'id' => :'id',
41
+ :'type' => :'type'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ # @!visibility private
47
+ def self.openapi_types
48
+ {
49
+ :'attributes' => :'MonitorUserTemplateRequestAttributes',
50
+ :'id' => :'String',
51
+ :'type' => :'MonitorUserTemplateResourceType'
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::MonitorUserTemplateUpdateData` 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 @attributes.nil?
91
+ return false if @id.nil?
92
+ return false if @type.nil?
93
+ true
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param attributes [Object] Object to be assigned
98
+ # @!visibility private
99
+ def attributes=(attributes)
100
+ if attributes.nil?
101
+ fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
102
+ end
103
+ @attributes = attributes
104
+ end
105
+
106
+ # Custom attribute writer method with validation
107
+ # @param id [Object] Object to be assigned
108
+ # @!visibility private
109
+ def id=(id)
110
+ if id.nil?
111
+ fail ArgumentError, 'invalid value for "id", id cannot be nil.'
112
+ end
113
+ @id = id
114
+ end
115
+
116
+ # Custom attribute writer method with validation
117
+ # @param type [Object] Object to be assigned
118
+ # @!visibility private
119
+ def type=(type)
120
+ if type.nil?
121
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
122
+ end
123
+ @type = type
124
+ end
125
+
126
+ # Returns the object in the form of hash, with additionalProperties support.
127
+ # @return [Hash] Returns the object in the form of hash
128
+ # @!visibility private
129
+ def to_hash
130
+ hash = {}
131
+ self.class.attribute_map.each_pair do |attr, param|
132
+ value = self.send(attr)
133
+ if value.nil?
134
+ is_nullable = self.class.openapi_nullable.include?(attr)
135
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
136
+ end
137
+
138
+ hash[param] = _to_hash(value)
139
+ end
140
+ self.additional_properties.each_pair do |attr, value|
141
+ hash[attr] = value
142
+ end
143
+ hash
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param o [Object] Object to be compared
148
+ # @!visibility private
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ attributes == o.attributes &&
153
+ id == o.id &&
154
+ type == o.type &&
155
+ additional_properties == o.additional_properties
156
+ end
157
+
158
+ # Calculates hash code according to all attributes.
159
+ # @return [Integer] Hash code
160
+ # @!visibility private
161
+ def hash
162
+ [attributes, id, type, additional_properties].hash
163
+ end
164
+ end
165
+ end
@@ -0,0 +1,123 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Request for creating a new monitor user template version.
21
+ class MonitorUserTemplateUpdateRequest
22
+ include BaseGenericModel
23
+
24
+ # Monitor user template data.
25
+ attr_reader :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' => :'MonitorUserTemplateUpdateData'
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::MonitorUserTemplateUpdateRequest` 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
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ # @!visibility private
71
+ def valid?
72
+ return false if @data.nil?
73
+ true
74
+ end
75
+
76
+ # Custom attribute writer method with validation
77
+ # @param data [Object] Object to be assigned
78
+ # @!visibility private
79
+ def data=(data)
80
+ if data.nil?
81
+ fail ArgumentError, 'invalid value for "data", data cannot be nil.'
82
+ end
83
+ @data = data
84
+ end
85
+
86
+ # Returns the object in the form of hash, with additionalProperties support.
87
+ # @return [Hash] Returns the object in the form of hash
88
+ # @!visibility private
89
+ def to_hash
90
+ hash = {}
91
+ self.class.attribute_map.each_pair do |attr, param|
92
+ value = self.send(attr)
93
+ if value.nil?
94
+ is_nullable = self.class.openapi_nullable.include?(attr)
95
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
96
+ end
97
+
98
+ hash[param] = _to_hash(value)
99
+ end
100
+ self.additional_properties.each_pair do |attr, value|
101
+ hash[attr] = value
102
+ end
103
+ hash
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param o [Object] Object to be compared
108
+ # @!visibility private
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ data == o.data &&
113
+ additional_properties == o.additional_properties
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ # @!visibility private
119
+ def hash
120
+ [data, additional_properties].hash
121
+ end
122
+ end
123
+ end