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,153 @@
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
+ # Item in the Jira integration metadata issue array.
21
+ class JiraIntegrationMetadataIssuesItem
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # URL of issue's Jira account.
29
+ attr_reader :account
30
+
31
+ # Jira issue's issue key.
32
+ attr_accessor :issue_key
33
+
34
+ # Jira issue's issue type.
35
+ attr_accessor :issuetype_id
36
+
37
+ # Jira issue's project keys.
38
+ attr_reader :project_key
39
+
40
+ # URL redirecting to the Jira issue.
41
+ attr_accessor :redirect_url
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ # @!visibility private
45
+ def self.attribute_map
46
+ {
47
+ :'account' => :'account',
48
+ :'issue_key' => :'issue_key',
49
+ :'issuetype_id' => :'issuetype_id',
50
+ :'project_key' => :'project_key',
51
+ :'redirect_url' => :'redirect_url'
52
+ }
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ # @!visibility private
57
+ def self.openapi_types
58
+ {
59
+ :'account' => :'String',
60
+ :'issue_key' => :'String',
61
+ :'issuetype_id' => :'String',
62
+ :'project_key' => :'String',
63
+ :'redirect_url' => :'String'
64
+ }
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param attributes [Hash] Model attributes in the form of hash
69
+ # @!visibility private
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::JiraIntegrationMetadataIssuesItem` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::JiraIntegrationMetadataIssuesItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'account')
84
+ self.account = attributes[:'account']
85
+ end
86
+
87
+ if attributes.key?(:'issue_key')
88
+ self.issue_key = attributes[:'issue_key']
89
+ end
90
+
91
+ if attributes.key?(:'issuetype_id')
92
+ self.issuetype_id = attributes[:'issuetype_id']
93
+ end
94
+
95
+ if attributes.key?(:'project_key')
96
+ self.project_key = attributes[:'project_key']
97
+ end
98
+
99
+ if attributes.key?(:'redirect_url')
100
+ self.redirect_url = attributes[:'redirect_url']
101
+ end
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ # @!visibility private
107
+ def valid?
108
+ return false if @account.nil?
109
+ return false if @project_key.nil?
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param account [Object] Object to be assigned
115
+ # @!visibility private
116
+ def account=(account)
117
+ if account.nil?
118
+ fail ArgumentError, 'invalid value for "account", account cannot be nil.'
119
+ end
120
+ @account = account
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param project_key [Object] Object to be assigned
125
+ # @!visibility private
126
+ def project_key=(project_key)
127
+ if project_key.nil?
128
+ fail ArgumentError, 'invalid value for "project_key", project_key cannot be nil.'
129
+ end
130
+ @project_key = project_key
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param o [Object] Object to be compared
135
+ # @!visibility private
136
+ def ==(o)
137
+ return true if self.equal?(o)
138
+ self.class == o.class &&
139
+ account == o.account &&
140
+ issue_key == o.issue_key &&
141
+ issuetype_id == o.issuetype_id &&
142
+ project_key == o.project_key &&
143
+ redirect_url == o.redirect_url
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ # @!visibility private
149
+ def hash
150
+ [account, issue_key, issuetype_id, project_key, redirect_url].hash
151
+ end
152
+ end
153
+ end
@@ -26,5 +26,9 @@ module DatadogAPIClient::V2
26
26
  MAX = "max".freeze
27
27
  SUM = "sum".freeze
28
28
  LAST = "last".freeze
29
+ PERCENTILE = "percentile".freeze
30
+ MEAN = "mean".freeze
31
+ L2NORM = "l2norm".freeze
32
+ AREA = "area".freeze
29
33
  end
30
34
  end
@@ -0,0 +1,91 @@
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
+ # On-demand concurrency cap.
21
+ class OnDemandConcurrencyCap
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # On-demand concurrency cap attributes.
29
+ attr_accessor :attributes
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'attributes' => :'attributes'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'attributes' => :'OnDemandConcurrencyCapAttributes'
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::OnDemandConcurrencyCap` 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::OnDemandConcurrencyCap`. 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?(:'attributes')
64
+ self.attributes = attributes[:'attributes']
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
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param o [Object] Object to be compared
77
+ # @!visibility private
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ attributes == o.attributes
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Integer] Hash code
86
+ # @!visibility private
87
+ def hash
88
+ [attributes].hash
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,91 @@
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
+ # On-demand concurrency cap attributes.
21
+ class OnDemandConcurrencyCapAttributes
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Value of the on-demand concurrency cap.
29
+ attr_accessor :on_demand_concurrency_cap
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'on_demand_concurrency_cap' => :'on_demand_concurrency_cap'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'on_demand_concurrency_cap' => :'Float'
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::OnDemandConcurrencyCapAttributes` 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::OnDemandConcurrencyCapAttributes`. 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?(:'on_demand_concurrency_cap')
64
+ self.on_demand_concurrency_cap = attributes[:'on_demand_concurrency_cap']
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
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param o [Object] Object to be compared
77
+ # @!visibility private
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ on_demand_concurrency_cap == o.on_demand_concurrency_cap
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Integer] Hash code
86
+ # @!visibility private
87
+ def hash
88
+ [on_demand_concurrency_cap].hash
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,91 @@
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
+ # On-demand concurrency cap response.
21
+ class OnDemandConcurrencyCapResponse
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # On-demand concurrency cap.
29
+ attr_accessor :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' => :'OnDemandConcurrencyCap'
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::OnDemandConcurrencyCapResponse` 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::OnDemandConcurrencyCapResponse`. 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
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param o [Object] Object to be compared
77
+ # @!visibility private
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ data == o.data
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Integer] Hash code
86
+ # @!visibility private
87
+ def hash
88
+ [data].hash
89
+ end
90
+ end
91
+ end
@@ -25,7 +25,7 @@ module DatadogAPIClient::V2
25
25
  # @!visibility private
26
26
  attr_accessor :_unparsed
27
27
 
28
- # The integration metadata relationship array
28
+ # Integration metadata relationship array
29
29
  attr_reader :data
30
30
 
31
31
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -0,0 +1,144 @@
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
+ # Restriction policy object.
21
+ class RestrictionPolicy
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # Restriction policy attributes.
29
+ attr_reader :attributes
30
+
31
+ # The identifier, always equivalent to the value specified in the `resource_id` path parameter.
32
+ attr_reader :id
33
+
34
+ # Restriction policy 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' => :'RestrictionPolicyAttributes',
52
+ :'id' => :'String',
53
+ :'type' => :'RestrictionPolicyType'
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::RestrictionPolicy` 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::RestrictionPolicy`. 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 @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
+ # Checks equality by comparing each attribute.
127
+ # @param o [Object] Object to be compared
128
+ # @!visibility private
129
+ def ==(o)
130
+ return true if self.equal?(o)
131
+ self.class == o.class &&
132
+ attributes == o.attributes &&
133
+ id == o.id &&
134
+ type == o.type
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ # @!visibility private
140
+ def hash
141
+ [attributes, id, type].hash
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,104 @@
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
+ # Restriction policy attributes.
21
+ class RestrictionPolicyAttributes
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # An array of bindings.
29
+ attr_reader :bindings
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ # @!visibility private
33
+ def self.attribute_map
34
+ {
35
+ :'bindings' => :'bindings'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'bindings' => :'Array<RestrictionPolicyBinding>'
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::RestrictionPolicyAttributes` 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::RestrictionPolicyAttributes`. 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?(:'bindings')
64
+ if (value = attributes[:'bindings']).is_a?(Array)
65
+ self.bindings = value
66
+ end
67
+ end
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ # @!visibility private
73
+ def valid?
74
+ return false if @bindings.nil?
75
+ true
76
+ end
77
+
78
+ # Custom attribute writer method with validation
79
+ # @param bindings [Object] Object to be assigned
80
+ # @!visibility private
81
+ def bindings=(bindings)
82
+ if bindings.nil?
83
+ fail ArgumentError, 'invalid value for "bindings", bindings cannot be nil.'
84
+ end
85
+ @bindings = bindings
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
+ bindings == o.bindings
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Integer] Hash code
99
+ # @!visibility private
100
+ def hash
101
+ [bindings].hash
102
+ end
103
+ end
104
+ end