datadog_api_client 2.8.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +66 -5
  4. data/.generator/schemas/v2/openapi.yaml +860 -20
  5. data/.generator/src/generator/formatter.py +1 -0
  6. data/.generator/src/generator/templates/model_base.j2 +8 -4
  7. data/CHANGELOG.md +24 -0
  8. data/examples/v1/dashboards/CreateDashboard_2800096921.rb +62 -0
  9. data/examples/v1/dashboards/CreateDashboard_3195475781.rb +32 -0
  10. data/examples/v2/incidents/CreateIncidentIntegration.rb +31 -0
  11. data/examples/v2/incidents/DeleteIncidentIntegration.rb +14 -0
  12. data/examples/v2/incidents/GetIncidentIntegration.rb +14 -0
  13. data/examples/v2/incidents/ListIncidentIntegrations.rb +11 -0
  14. data/examples/v2/incidents/UpdateIncidentIntegration.rb +34 -0
  15. data/examples/v2/ip-allowlist/GetIPAllowlist.rb +5 -0
  16. data/examples/v2/ip-allowlist/UpdateIPAllowlist.rb +25 -0
  17. data/examples/v2/logs-metrics/CreateLogsMetric.rb +1 -1
  18. data/examples/v2/restriction-policies/DeleteRestrictionPolicy.rb +5 -0
  19. data/examples/v2/restriction-policies/GetRestrictionPolicy.rb +5 -0
  20. data/examples/v2/restriction-policies/UpdateRestrictionPolicy.rb +25 -0
  21. data/examples/v2/synthetics/GetOnDemandConcurrencyCap.rb +5 -0
  22. data/examples/v2/synthetics/GetOnDemandConcurrencyCap_2633566918.rb +5 -0
  23. data/examples/v2/synthetics/SetOnDemandConcurrencyCap.rb +7 -0
  24. data/examples/v2/synthetics/SetOnDemandConcurrencyCap_2850884405.rb +9 -0
  25. data/lib/datadog_api_client/configuration.rb +5 -0
  26. data/lib/datadog_api_client/inflector.rb +35 -0
  27. data/lib/datadog_api_client/v1/api/snapshots_api.rb +2 -2
  28. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  29. data/lib/datadog_api_client/v1/model_base.rb +7 -3
  30. data/lib/datadog_api_client/v1/models/application_key.rb +16 -16
  31. data/lib/datadog_api_client/v1/models/cancel_downtimes_by_scope_request.rb +1 -1
  32. data/lib/datadog_api_client/v1/models/downtime.rb +1 -1
  33. data/lib/datadog_api_client/v1/models/downtime_child.rb +1 -1
  34. data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
  35. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -0
  36. data/lib/datadog_api_client/v1/models/list_stream_source.rb +3 -0
  37. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -0
  38. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +21 -1
  39. data/lib/datadog_api_client/v1/models/usage_rum_sessions_hour.rb +12 -1
  40. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +21 -1
  41. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +21 -1
  42. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +21 -1
  43. data/lib/datadog_api_client/v2/api/incidents_api.rb +384 -0
  44. data/lib/datadog_api_client/v2/api/ip_allowlist_api.rb +153 -0
  45. data/lib/datadog_api_client/v2/api/logs_api.rb +1 -0
  46. data/lib/datadog_api_client/v2/api/restriction_policies_api.rb +236 -0
  47. data/lib/datadog_api_client/v2/api/synthetics_api.rb +153 -0
  48. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +1 -1
  49. data/lib/datadog_api_client/v2/model_base.rb +7 -3
  50. data/lib/datadog_api_client/v2/models/events_data_source.rb +1 -0
  51. data/lib/datadog_api_client/v2/models/incident_integration_metadata_attributes.rb +161 -0
  52. data/lib/datadog_api_client/v2/models/incident_integration_metadata_create_data.rb +123 -0
  53. data/lib/datadog_api_client/v2/models/incident_integration_metadata_create_request.rb +102 -0
  54. data/lib/datadog_api_client/v2/models/incident_integration_metadata_list_response.rb +126 -0
  55. data/lib/datadog_api_client/v2/models/incident_integration_metadata_metadata.rb +63 -0
  56. data/lib/datadog_api_client/v2/models/incident_integration_metadata_patch_data.rb +123 -0
  57. data/lib/datadog_api_client/v2/models/incident_integration_metadata_patch_request.rb +102 -0
  58. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response.rb +114 -0
  59. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_data.rb +133 -0
  60. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_included_item.rb +62 -0
  61. data/lib/datadog_api_client/v2/models/incident_update_data.rb +1 -1
  62. data/lib/datadog_api_client/v2/models/ip_allowlist_attributes.rb +103 -0
  63. data/lib/datadog_api_client/v2/models/ip_allowlist_data.rb +122 -0
  64. data/lib/datadog_api_client/v2/models/ip_allowlist_entry.rb +102 -0
  65. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_attributes.rb +121 -0
  66. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_data.rb +122 -0
  67. data/lib/datadog_api_client/v2/models/ip_allowlist_entry_type.rb +26 -0
  68. data/lib/datadog_api_client/v2/models/ip_allowlist_response.rb +91 -0
  69. data/lib/datadog_api_client/v2/models/ip_allowlist_type.rb +26 -0
  70. data/lib/datadog_api_client/v2/models/ip_allowlist_update_request.rb +102 -0
  71. data/lib/datadog_api_client/v2/models/jira_integration_metadata.rb +104 -0
  72. data/lib/datadog_api_client/v2/models/jira_integration_metadata_issues_item.rb +153 -0
  73. data/lib/datadog_api_client/v2/models/metrics_aggregator.rb +4 -0
  74. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap.rb +91 -0
  75. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_attributes.rb +91 -0
  76. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_response.rb +91 -0
  77. data/lib/datadog_api_client/v2/models/relationship_to_incident_integration_metadatas.rb +1 -1
  78. data/lib/datadog_api_client/v2/models/restriction_policy.rb +144 -0
  79. data/lib/datadog_api_client/v2/models/restriction_policy_attributes.rb +104 -0
  80. data/lib/datadog_api_client/v2/models/restriction_policy_binding.rb +127 -0
  81. data/lib/datadog_api_client/v2/models/restriction_policy_response.rb +102 -0
  82. data/lib/datadog_api_client/v2/models/restriction_policy_type.rb +26 -0
  83. data/lib/datadog_api_client/v2/models/restriction_policy_update_request.rb +102 -0
  84. data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +7 -7
  85. data/lib/datadog_api_client/v2/models/rum_application_list_attributes.rb +7 -7
  86. data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_read.rb +1 -0
  87. data/lib/datadog_api_client/v2/models/slack_integration_metadata.rb +104 -0
  88. data/lib/datadog_api_client/v2/models/slack_integration_metadata_channel_item.rb +154 -0
  89. data/lib/datadog_api_client/version.rb +1 -1
  90. metadata +53 -2
@@ -0,0 +1,114 @@
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 with an incident integration metadata.
21
+ class IncidentIntegrationMetadataResponse
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Incident integration metadata from a response.
29
+ attr_reader :data
30
+
31
+ # Included related resources that the user requested.
32
+ attr_accessor :included
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'data' => :'data',
39
+ :'included' => :'included'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ # @!visibility private
45
+ def self.openapi_types
46
+ {
47
+ :'data' => :'IncidentIntegrationMetadataResponseData',
48
+ :'included' => :'Array<IncidentIntegrationMetadataResponseIncludedItem>'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param attributes [Hash] Model attributes in the form of hash
54
+ # @!visibility private
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentIntegrationMetadataResponse` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IncidentIntegrationMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'data')
69
+ self.data = attributes[:'data']
70
+ end
71
+
72
+ if attributes.key?(:'included')
73
+ if (value = attributes[:'included']).is_a?(Array)
74
+ self.included = value
75
+ end
76
+ end
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ # @!visibility private
82
+ def valid?
83
+ return false if @data.nil?
84
+ true
85
+ end
86
+
87
+ # Custom attribute writer method with validation
88
+ # @param data [Object] Object to be assigned
89
+ # @!visibility private
90
+ def data=(data)
91
+ if data.nil?
92
+ fail ArgumentError, 'invalid value for "data", data cannot be nil.'
93
+ end
94
+ @data = data
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
+ data == o.data &&
104
+ included == o.included
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ # @!visibility private
110
+ def hash
111
+ [data, included].hash
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,133 @@
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
+ # Incident integration metadata from a response.
21
+ class IncidentIntegrationMetadataResponseData
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Incident integration metadata's attributes for a create request.
29
+ attr_accessor :attributes
30
+
31
+ # The incident integration metadata's ID.
32
+ attr_reader :id
33
+
34
+ # Integration metadata resource type.
35
+ attr_reader :type
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ # @!visibility private
39
+ def self.attribute_map
40
+ {
41
+ :'attributes' => :'attributes',
42
+ :'id' => :'id',
43
+ :'type' => :'type'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ # @!visibility private
49
+ def self.openapi_types
50
+ {
51
+ :'attributes' => :'IncidentIntegrationMetadataAttributes',
52
+ :'id' => :'String',
53
+ :'type' => :'IncidentIntegrationMetadataType'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param attributes [Hash] Model attributes in the form of hash
59
+ # @!visibility private
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentIntegrationMetadataResponseData` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IncidentIntegrationMetadataResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
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 @id.nil?
91
+ return false if @type.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param id [Object] Object to be assigned
97
+ # @!visibility private
98
+ def id=(id)
99
+ if id.nil?
100
+ fail ArgumentError, 'invalid value for "id", id cannot be nil.'
101
+ end
102
+ @id = id
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
+ # 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
+ attributes == o.attributes &&
122
+ id == o.id &&
123
+ type == o.type
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ # @!visibility private
129
+ def hash
130
+ [attributes, id, type].hash
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,62 @@
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
+ # An object related to an incident integration metadata that is included in the response.
21
+ module IncidentIntegrationMetadataResponseIncludedItem
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
+ ]
31
+ end
32
+ # Builds the object
33
+ # @param data [Mixed] Data to be matched against the list of oneOf items
34
+ # @return [Object] Returns the model or the data itself
35
+ def build(data)
36
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
37
+ # Note:
38
+ # - We do not attempt to check whether exactly one item matches.
39
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
40
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
41
+ # - TODO: scalar values are de facto behaving as if they were nullable.
42
+ # - TODO: logging when debugging is set.
43
+ openapi_one_of.each do |klass|
44
+ begin
45
+ next if klass == :AnyType # "nullable: true"
46
+ typed_data = find_and_cast_into_type(klass, data)
47
+ next if typed_data._unparsed
48
+ return typed_data if typed_data
49
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
50
+ end
51
+ end
52
+
53
+ if openapi_one_of.include?(:AnyType)
54
+ data
55
+ else
56
+ self._unparsed = true
57
+ DatadogAPIClient::UnparsedObject.new(data)
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -28,7 +28,7 @@ module DatadogAPIClient::V2
28
28
  # The incident's attributes for an update request.
29
29
  attr_accessor :attributes
30
30
 
31
- # The team's ID.
31
+ # The incident's ID.
32
32
  attr_reader :id
33
33
 
34
34
  # The incident's relationships for an update request.
@@ -0,0 +1,103 @@
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 of the IP allowlist.
21
+ class IPAllowlistAttributes
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Whether the IP allowlist logic is enabled or not.
29
+ attr_accessor :enabled
30
+
31
+ # Array of entries in the IP allowlist.
32
+ attr_accessor :entries
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'enabled' => :'enabled',
39
+ :'entries' => :'entries'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ # @!visibility private
45
+ def self.openapi_types
46
+ {
47
+ :'enabled' => :'Boolean',
48
+ :'entries' => :'Array<IPAllowlistEntry>'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param attributes [Hash] Model attributes in the form of hash
54
+ # @!visibility private
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IPAllowlistAttributes` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IPAllowlistAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'enabled')
69
+ self.enabled = attributes[:'enabled']
70
+ end
71
+
72
+ if attributes.key?(:'entries')
73
+ if (value = attributes[:'entries']).is_a?(Array)
74
+ self.entries = value
75
+ end
76
+ end
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ # @!visibility private
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param o [Object] Object to be compared
88
+ # @!visibility private
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ enabled == o.enabled &&
93
+ entries == o.entries
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Integer] Hash code
98
+ # @!visibility private
99
+ def hash
100
+ [enabled, entries].hash
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,122 @@
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
+ # IP allowlist data.
21
+ class IPAllowlistData
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Attributes of the IP allowlist.
29
+ attr_accessor :attributes
30
+
31
+ # The unique identifier of the org.
32
+ attr_accessor :id
33
+
34
+ # IP allowlist type.
35
+ attr_reader :type
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ # @!visibility private
39
+ def self.attribute_map
40
+ {
41
+ :'attributes' => :'attributes',
42
+ :'id' => :'id',
43
+ :'type' => :'type'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ # @!visibility private
49
+ def self.openapi_types
50
+ {
51
+ :'attributes' => :'IPAllowlistAttributes',
52
+ :'id' => :'String',
53
+ :'type' => :'IPAllowlistType'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param attributes [Hash] Model attributes in the form of hash
59
+ # @!visibility private
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IPAllowlistData` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IPAllowlistData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
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
+ # Checks equality by comparing each attribute.
105
+ # @param o [Object] Object to be compared
106
+ # @!visibility private
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ attributes == o.attributes &&
111
+ id == o.id &&
112
+ type == o.type
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Integer] Hash code
117
+ # @!visibility private
118
+ def hash
119
+ [attributes, id, type].hash
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,102 @@
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
+ # IP allowlist entry object.
21
+ class IPAllowlistEntry
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Data of the IP allowlist entry object.
29
+ attr_reader :data
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'data' => :'data'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'data' => :'IPAllowlistEntryData'
44
+ }
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param attributes [Hash] Model attributes in the form of hash
49
+ # @!visibility private
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IPAllowlistEntry` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::IPAllowlistEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
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
+ # Checks equality by comparing each attribute.
87
+ # @param o [Object] Object to be compared
88
+ # @!visibility private
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ data == o.data
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ # @!visibility private
98
+ def hash
99
+ [data].hash
100
+ end
101
+ end
102
+ end