datadog_api_client 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +6 -6
  3. data/.generator/conftest.py +2 -1
  4. data/.generator/schemas/v1/openapi.yaml +284 -902
  5. data/.generator/schemas/v2/openapi.yaml +343 -672
  6. data/.generator/src/generator/formatter.py +1 -1
  7. data/.generator/src/generator/templates/example.j2 +5 -0
  8. data/.github/workflows/test.yml +1 -1
  9. data/.github/workflows/test_integration.yml +5 -0
  10. data/CHANGELOG.md +42 -0
  11. data/README.md +13 -13
  12. data/examples/v1/dashboards/CreateDashboard_1094917386.rb +37 -0
  13. data/examples/v1/dashboards/CreateDashboard_1307120899.rb +61 -0
  14. data/examples/v1/monitors/ValidateExistingMonitor.rb +1 -0
  15. data/examples/v1/monitors/ValidateMonitor.rb +1 -0
  16. data/examples/v1/monitors/ValidateMonitor_4247196452.rb +38 -0
  17. data/examples/v1/pagerduty-integration/DeletePagerDutyIntegrationService.rb +2 -2
  18. data/examples/v1/synthetics/CreateGlobalVariable.rb +1 -0
  19. data/examples/v1/synthetics/CreateGlobalVariable_1068962881.rb +23 -0
  20. data/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.rb +10 -0
  21. data/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.rb +6 -0
  22. data/examples/v1/synthetics/EditGlobalVariable.rb +1 -0
  23. data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -0
  24. data/examples/v1/usage-metering/GetDailyCustomReports.rb +0 -3
  25. data/examples/v1/usage-metering/GetMonthlyCustomReports.rb +0 -3
  26. data/examples/v1/usage-metering/GetSpecifiedDailyCustomReports.rb +0 -3
  27. data/examples/v1/usage-metering/GetSpecifiedMonthlyCustomReports.rb +0 -3
  28. data/examples/v1/usage-metering/GetUsageAttribution.rb +0 -3
  29. data/examples/v2/audit/ListAuditLogs_1275402458.rb +8 -0
  30. data/examples/v2/audit/SearchAuditLogs_3215529662.rb +22 -0
  31. data/examples/v2/events/ListEvents_1527584014.rb +13 -0
  32. data/examples/v2/events/SearchEvents_3856995058.rb +25 -0
  33. data/examples/v2/incidents/ListIncidents_2665616954.rb +11 -0
  34. data/examples/v2/logs/ListLogsGet_738202670.rb +8 -0
  35. data/examples/v2/logs/ListLogs_3138392594.rb +25 -0
  36. data/examples/v2/metrics/SubmitMetrics_1762007427.rb +23 -0
  37. data/examples/v2/processes/ListProcesses_797840471.rb +8 -0
  38. data/examples/v2/roles/UpdateRole.rb +13 -0
  39. data/examples/v2/rum/CreateRUMApplication.rb +15 -0
  40. data/examples/v2/rum/DeleteRUMApplication.rb +8 -0
  41. data/examples/v2/rum/GetRUMApplication.rb +8 -0
  42. data/examples/v2/rum/GetRUMApplications.rb +5 -0
  43. data/examples/v2/rum/ListRUMEvents_2680821282.rb +8 -0
  44. data/examples/v2/rum/SearchRUMEvents_574690310.rb +21 -0
  45. data/examples/v2/rum/UpdateRUMApplication.rb +16 -0
  46. data/examples/v2/security-monitoring/ListSecurityMonitoringSignals_3960412991.rb +8 -0
  47. data/examples/v2/security-monitoring/SearchSecurityMonitoringSignals_1309350146.rb +20 -0
  48. data/examples/v2/usage-metering/GetHourlyUsage.rb +5 -0
  49. data/lib/datadog_api_client/configuration.rb +0 -5
  50. data/lib/datadog_api_client/inflector.rb +16 -0
  51. data/lib/datadog_api_client/v1/api/metrics_api.rb +1 -1
  52. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +42 -62
  53. data/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +1 -0
  54. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +1 -0
  55. data/lib/datadog_api_client/v1/models/list_stream_source.rb +1 -0
  56. data/lib/datadog_api_client/v1/models/metric_content_encoding.rb +1 -0
  57. data/lib/datadog_api_client/v1/models/monitor_options.rb +28 -1
  58. data/lib/datadog_api_client/v1/models/monitor_summary_widget_definition.rb +13 -1
  59. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +2 -0
  60. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +21 -1
  61. data/lib/datadog_api_client/v1/models/on_missing_data_option.rb +33 -0
  62. data/lib/datadog_api_client/v1/models/synthetics_basic_auth.rb +2 -1
  63. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest.rb +155 -0
  64. data/lib/datadog_api_client/v1/models/synthetics_basic_auth_digest_type.rb +26 -0
  65. data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options.rb +11 -12
  66. data/lib/datadog_api_client/v1/models/synthetics_global_variable_parse_test_options_type.rb +1 -0
  67. data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +31 -1
  68. data/lib/datadog_api_client/v1/models/synthetics_test_process_status.rb +0 -1
  69. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +15 -1
  70. data/lib/datadog_api_client/v1/models/usage_attribution_sort.rb +2 -0
  71. data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +2 -0
  72. data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +21 -1
  73. data/lib/datadog_api_client/v1/models/usage_billable_summary_hour.rb +11 -1
  74. data/lib/datadog_api_client/v1/models/usage_cloud_security_posture_management_hour.rb +12 -1
  75. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
  76. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +21 -1
  77. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
  78. data/lib/datadog_api_client/v1/models/widget_monitor_summary_sort.rb +2 -0
  79. data/lib/datadog_api_client/v2/api/events_api.rb +1 -1
  80. data/lib/datadog_api_client/v2/api/logs_api.rb +1 -1
  81. data/lib/datadog_api_client/v2/api/metrics_api.rb +1 -1
  82. data/lib/datadog_api_client/v2/api/rum_api.rb +329 -0
  83. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +3 -3
  84. data/lib/datadog_api_client/v2/models/content_encoding.rb +1 -0
  85. data/lib/datadog_api_client/v2/models/metric_content_encoding.rb +2 -0
  86. data/lib/datadog_api_client/v2/models/role_update_data.rb +11 -1
  87. data/lib/datadog_api_client/v2/models/rum_application.rb +166 -0
  88. data/lib/datadog_api_client/v2/models/rum_application_attributes.rb +279 -0
  89. data/lib/datadog_api_client/v2/models/rum_application_create.rb +145 -0
  90. data/lib/datadog_api_client/v2/models/rum_application_create_attributes.rb +132 -0
  91. data/lib/datadog_api_client/v2/models/rum_application_create_request.rb +122 -0
  92. data/lib/datadog_api_client/v2/models/rum_application_create_type.rb +26 -0
  93. data/lib/datadog_api_client/v2/models/rum_application_response.rb +111 -0
  94. data/lib/datadog_api_client/v2/models/rum_application_type.rb +26 -0
  95. data/lib/datadog_api_client/v2/models/rum_application_update.rb +155 -0
  96. data/lib/datadog_api_client/v2/models/rum_application_update_attributes.rb +121 -0
  97. data/lib/datadog_api_client/v2/models/rum_application_update_request.rb +122 -0
  98. data/lib/datadog_api_client/v2/models/rum_application_update_type.rb +26 -0
  99. data/lib/datadog_api_client/v2/models/rum_applications_response.rb +113 -0
  100. data/lib/datadog_api_client/version.rb +1 -1
  101. data/lib/datadog_api_client.rb +6 -4
  102. metadata +41 -3
  103. data/lib/datadog_api_client/v2.rb +0 -595
@@ -342,7 +342,7 @@ module DatadogAPIClient::V2
342
342
  return_type = opts[:debug_return_type] || 'SecurityMonitoringSignalTriageUpdateResponse'
343
343
 
344
344
  # auth_names
345
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
345
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
346
346
 
347
347
  new_options = opts.merge(
348
348
  :operation => :edit_security_monitoring_signal_assignee,
@@ -414,7 +414,7 @@ module DatadogAPIClient::V2
414
414
  return_type = opts[:debug_return_type] || 'SecurityMonitoringSignalTriageUpdateResponse'
415
415
 
416
416
  # auth_names
417
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
417
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
418
418
 
419
419
  new_options = opts.merge(
420
420
  :operation => :edit_security_monitoring_signal_incidents,
@@ -486,7 +486,7 @@ module DatadogAPIClient::V2
486
486
  return_type = opts[:debug_return_type] || 'SecurityMonitoringSignalTriageUpdateResponse'
487
487
 
488
488
  # auth_names
489
- auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
489
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
490
490
 
491
491
  new_options = opts.merge(
492
492
  :operation => :edit_security_monitoring_signal_state,
@@ -21,6 +21,7 @@ module DatadogAPIClient::V2
21
21
  class ContentEncoding
22
22
  include BaseEnumModel
23
23
 
24
+ IDENTITY = "identity".freeze
24
25
  GZIP = "gzip".freeze
25
26
  DEFLATE = "deflate".freeze
26
27
  end
@@ -22,5 +22,7 @@ module DatadogAPIClient::V2
22
22
  include BaseEnumModel
23
23
 
24
24
  DEFLATE = "deflate".freeze
25
+ ZSTD1 = "zstd1".freeze
26
+ GZIP = "gzip".freeze
25
27
  end
26
28
  end
@@ -31,6 +31,9 @@ module DatadogAPIClient::V2
31
31
  # The unique identifier of the role.
32
32
  attr_accessor :id
33
33
 
34
+ # Relationships of the role object.
35
+ attr_accessor :relationships
36
+
34
37
  # Roles type.
35
38
  attr_accessor :type
36
39
 
@@ -40,6 +43,7 @@ module DatadogAPIClient::V2
40
43
  {
41
44
  :'attributes' => :'attributes',
42
45
  :'id' => :'id',
46
+ :'relationships' => :'relationships',
43
47
  :'type' => :'type'
44
48
  }
45
49
  end
@@ -56,6 +60,7 @@ module DatadogAPIClient::V2
56
60
  {
57
61
  :'attributes' => :'RoleUpdateAttributes',
58
62
  :'id' => :'String',
63
+ :'relationships' => :'RoleRelationships',
59
64
  :'type' => :'RolesType'
60
65
  }
61
66
  end
@@ -91,6 +96,10 @@ module DatadogAPIClient::V2
91
96
  self.id = attributes[:'id']
92
97
  end
93
98
 
99
+ if attributes.key?(:'relationships')
100
+ self.relationships = attributes[:'relationships']
101
+ end
102
+
94
103
  if attributes.key?(:'type')
95
104
  self.type = attributes[:'type']
96
105
  else
@@ -146,6 +155,7 @@ module DatadogAPIClient::V2
146
155
  self.class == o.class &&
147
156
  attributes == o.attributes &&
148
157
  id == o.id &&
158
+ relationships == o.relationships &&
149
159
  type == o.type
150
160
  end
151
161
 
@@ -160,7 +170,7 @@ module DatadogAPIClient::V2
160
170
  # @return [Integer] Hash code
161
171
  # @!visibility private
162
172
  def hash
163
- [attributes, id, type].hash
173
+ [attributes, id, relationships, type].hash
164
174
  end
165
175
  end
166
176
  end
@@ -0,0 +1,166 @@
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
+ # RUM application.
21
+ class RUMApplication
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # RUM application attributes.
29
+ attr_accessor :attributes
30
+
31
+ # RUM application ID.
32
+ attr_accessor :id
33
+
34
+ # RUM application response type.
35
+ attr_accessor :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
+ # Returns all the JSON keys this model knows about
48
+ # @!visibility private
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ # @!visibility private
55
+ def self.openapi_types
56
+ {
57
+ :'attributes' => :'RUMApplicationAttributes',
58
+ :'id' => :'String',
59
+ :'type' => :'RUMApplicationType'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ # @!visibility private
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param attributes [Hash] Model attributes in the form of hash
72
+ # @!visibility private
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RUMApplication` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::RUMApplication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'attributes')
87
+ self.attributes = attributes[:'attributes']
88
+ end
89
+
90
+ if attributes.key?(:'id')
91
+ self.id = attributes[:'id']
92
+ end
93
+
94
+ if attributes.key?(:'type')
95
+ self.type = attributes[:'type']
96
+ else
97
+ self.type = 'rum_application'
98
+ end
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ # @!visibility private
104
+ def valid?
105
+ return false if @attributes.nil?
106
+ return false if @id.nil?
107
+ return false if @type.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param attributes [Object] Object to be assigned
113
+ # @!visibility private
114
+ def attributes=(attributes)
115
+ if attributes.nil?
116
+ fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
117
+ end
118
+ @attributes = attributes
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param id [Object] Object to be assigned
123
+ # @!visibility private
124
+ def id=(id)
125
+ if id.nil?
126
+ fail ArgumentError, 'invalid value for "id", id cannot be nil.'
127
+ end
128
+ @id = id
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param type [Object] Object to be assigned
133
+ # @!visibility private
134
+ def type=(type)
135
+ if type.nil?
136
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
137
+ end
138
+ @type = type
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param o [Object] Object to be compared
143
+ # @!visibility private
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ attributes == o.attributes &&
148
+ id == o.id &&
149
+ type == o.type
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param o [Object] Object to be compared
154
+ # @!visibility private
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ # @!visibility private
162
+ def hash
163
+ [attributes, id, type].hash
164
+ end
165
+ end
166
+ end
@@ -0,0 +1,279 @@
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
+ # RUM application attributes.
21
+ class RUMApplicationAttributes
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # ID of the RUM application.
29
+ attr_accessor :application_id
30
+
31
+ # Timestamp in ms of the creation date.
32
+ attr_accessor :created_at
33
+
34
+ # Handle of the creator user.
35
+ attr_accessor :created_by_handle
36
+
37
+ # Client token of the RUM application.
38
+ attr_accessor :hash
39
+
40
+ # Name of the RUM application.
41
+ attr_accessor :name
42
+
43
+ # Org ID of the RUM application.
44
+ attr_accessor :org_id
45
+
46
+ # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`.
47
+ attr_accessor :type
48
+
49
+ # Timestamp in ms of the last update date.
50
+ attr_accessor :updated_at
51
+
52
+ # Handle of the updater user.
53
+ attr_accessor :updated_by_handle
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ # @!visibility private
57
+ def self.attribute_map
58
+ {
59
+ :'application_id' => :'application_id',
60
+ :'created_at' => :'created_at',
61
+ :'created_by_handle' => :'created_by_handle',
62
+ :'hash' => :'hash',
63
+ :'name' => :'name',
64
+ :'org_id' => :'org_id',
65
+ :'type' => :'type',
66
+ :'updated_at' => :'updated_at',
67
+ :'updated_by_handle' => :'updated_by_handle'
68
+ }
69
+ end
70
+
71
+ # Returns all the JSON keys this model knows about
72
+ # @!visibility private
73
+ def self.acceptable_attributes
74
+ attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ # @!visibility private
79
+ def self.openapi_types
80
+ {
81
+ :'application_id' => :'String',
82
+ :'created_at' => :'Integer',
83
+ :'created_by_handle' => :'String',
84
+ :'hash' => :'String',
85
+ :'name' => :'String',
86
+ :'org_id' => :'Integer',
87
+ :'type' => :'String',
88
+ :'updated_at' => :'Integer',
89
+ :'updated_by_handle' => :'String'
90
+ }
91
+ end
92
+
93
+ # List of attributes with nullable: true
94
+ # @!visibility private
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param attributes [Hash] Model attributes in the form of hash
102
+ # @!visibility private
103
+ def initialize(attributes = {})
104
+ if (!attributes.is_a?(Hash))
105
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RUMApplicationAttributes` initialize method"
106
+ end
107
+
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!self.class.attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::RUMApplicationAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'application_id')
117
+ self.application_id = attributes[:'application_id']
118
+ end
119
+
120
+ if attributes.key?(:'created_at')
121
+ self.created_at = attributes[:'created_at']
122
+ end
123
+
124
+ if attributes.key?(:'created_by_handle')
125
+ self.created_by_handle = attributes[:'created_by_handle']
126
+ end
127
+
128
+ if attributes.key?(:'hash')
129
+ self.hash = attributes[:'hash']
130
+ end
131
+
132
+ if attributes.key?(:'name')
133
+ self.name = attributes[:'name']
134
+ end
135
+
136
+ if attributes.key?(:'org_id')
137
+ self.org_id = attributes[:'org_id']
138
+ end
139
+
140
+ if attributes.key?(:'type')
141
+ self.type = attributes[:'type']
142
+ end
143
+
144
+ if attributes.key?(:'updated_at')
145
+ self.updated_at = attributes[:'updated_at']
146
+ end
147
+
148
+ if attributes.key?(:'updated_by_handle')
149
+ self.updated_by_handle = attributes[:'updated_by_handle']
150
+ end
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ # @!visibility private
156
+ def valid?
157
+ return false if @application_id.nil?
158
+ return false if @created_at.nil?
159
+ return false if @created_by_handle.nil?
160
+ return false if @name.nil?
161
+ return false if @org_id.nil?
162
+ return false if @type.nil?
163
+ return false if @updated_at.nil?
164
+ return false if @updated_by_handle.nil?
165
+ true
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param application_id [Object] Object to be assigned
170
+ # @!visibility private
171
+ def application_id=(application_id)
172
+ if application_id.nil?
173
+ fail ArgumentError, 'invalid value for "application_id", application_id cannot be nil.'
174
+ end
175
+ @application_id = application_id
176
+ end
177
+
178
+ # Custom attribute writer method with validation
179
+ # @param created_at [Object] Object to be assigned
180
+ # @!visibility private
181
+ def created_at=(created_at)
182
+ if created_at.nil?
183
+ fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.'
184
+ end
185
+ @created_at = created_at
186
+ end
187
+
188
+ # Custom attribute writer method with validation
189
+ # @param created_by_handle [Object] Object to be assigned
190
+ # @!visibility private
191
+ def created_by_handle=(created_by_handle)
192
+ if created_by_handle.nil?
193
+ fail ArgumentError, 'invalid value for "created_by_handle", created_by_handle cannot be nil.'
194
+ end
195
+ @created_by_handle = created_by_handle
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param name [Object] Object to be assigned
200
+ # @!visibility private
201
+ def name=(name)
202
+ if name.nil?
203
+ fail ArgumentError, 'invalid value for "name", name cannot be nil.'
204
+ end
205
+ @name = name
206
+ end
207
+
208
+ # Custom attribute writer method with validation
209
+ # @param org_id [Object] Object to be assigned
210
+ # @!visibility private
211
+ def org_id=(org_id)
212
+ if org_id.nil?
213
+ fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.'
214
+ end
215
+ @org_id = org_id
216
+ end
217
+
218
+ # Custom attribute writer method with validation
219
+ # @param type [Object] Object to be assigned
220
+ # @!visibility private
221
+ def type=(type)
222
+ if type.nil?
223
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
224
+ end
225
+ @type = type
226
+ end
227
+
228
+ # Custom attribute writer method with validation
229
+ # @param updated_at [Object] Object to be assigned
230
+ # @!visibility private
231
+ def updated_at=(updated_at)
232
+ if updated_at.nil?
233
+ fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.'
234
+ end
235
+ @updated_at = updated_at
236
+ end
237
+
238
+ # Custom attribute writer method with validation
239
+ # @param updated_by_handle [Object] Object to be assigned
240
+ # @!visibility private
241
+ def updated_by_handle=(updated_by_handle)
242
+ if updated_by_handle.nil?
243
+ fail ArgumentError, 'invalid value for "updated_by_handle", updated_by_handle cannot be nil.'
244
+ end
245
+ @updated_by_handle = updated_by_handle
246
+ end
247
+
248
+ # Checks equality by comparing each attribute.
249
+ # @param o [Object] Object to be compared
250
+ # @!visibility private
251
+ def ==(o)
252
+ return true if self.equal?(o)
253
+ self.class == o.class &&
254
+ application_id == o.application_id &&
255
+ created_at == o.created_at &&
256
+ created_by_handle == o.created_by_handle &&
257
+ hash == o.hash &&
258
+ name == o.name &&
259
+ org_id == o.org_id &&
260
+ type == o.type &&
261
+ updated_at == o.updated_at &&
262
+ updated_by_handle == o.updated_by_handle
263
+ end
264
+
265
+ # @see the `==` method
266
+ # @param o [Object] Object to be compared
267
+ # @!visibility private
268
+ def eql?(o)
269
+ self == o
270
+ end
271
+
272
+ # Calculates hash code according to all attributes.
273
+ # @return [Integer] Hash code
274
+ # @!visibility private
275
+ def hash
276
+ [application_id, created_at, created_by_handle, hash, name, org_id, type, updated_at, updated_by_handle].hash
277
+ end
278
+ end
279
+ end
@@ -0,0 +1,145 @@
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
+ # RUM application creation.
21
+ class RUMApplicationCreate
22
+ include BaseGenericModel
23
+
24
+ # Whether the object has unparsed attributes
25
+ # @!visibility private
26
+ attr_accessor :_unparsed
27
+
28
+ # RUM application creation attributes.
29
+ attr_accessor :attributes
30
+
31
+ # RUM application creation type.
32
+ attr_accessor :type
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ # @!visibility private
36
+ def self.attribute_map
37
+ {
38
+ :'attributes' => :'attributes',
39
+ :'type' => :'type'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ # @!visibility private
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ # @!visibility private
51
+ def self.openapi_types
52
+ {
53
+ :'attributes' => :'RUMApplicationCreateAttributes',
54
+ :'type' => :'RUMApplicationCreateType'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ # @!visibility private
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param attributes [Hash] Model attributes in the form of hash
67
+ # @!visibility private
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RUMApplicationCreate` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::RUMApplicationCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'attributes')
82
+ self.attributes = attributes[:'attributes']
83
+ end
84
+
85
+ if attributes.key?(:'type')
86
+ self.type = attributes[:'type']
87
+ else
88
+ self.type = 'rum_application_create'
89
+ end
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ # @!visibility private
95
+ def valid?
96
+ return false if @attributes.nil?
97
+ return false if @type.nil?
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param attributes [Object] Object to be assigned
103
+ # @!visibility private
104
+ def attributes=(attributes)
105
+ if attributes.nil?
106
+ fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
107
+ end
108
+ @attributes = attributes
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param type [Object] Object to be assigned
113
+ # @!visibility private
114
+ def type=(type)
115
+ if type.nil?
116
+ fail ArgumentError, 'invalid value for "type", type cannot be nil.'
117
+ end
118
+ @type = type
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param o [Object] Object to be compared
123
+ # @!visibility private
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ attributes == o.attributes &&
128
+ type == o.type
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param o [Object] Object to be compared
133
+ # @!visibility private
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ # @!visibility private
141
+ def hash
142
+ [attributes, type].hash
143
+ end
144
+ end
145
+ end