plainrouter-sdk 0.1.0 → 0.2.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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/plainrouter/client.rb +73 -1
  4. data/lib/plainrouter/openapi/api/action_dry_run_api_api.rb +96 -0
  5. data/lib/plainrouter/openapi/api/action_proposal_api_api.rb +96 -0
  6. data/lib/plainrouter/openapi/api/action_read_api_api.rb +404 -0
  7. data/lib/plainrouter/openapi/api/event_api.rb +15 -15
  8. data/lib/plainrouter/openapi/api/operations_api.rb +24 -28
  9. data/lib/plainrouter/openapi/api/sandbox_api.rb +74 -17
  10. data/lib/plainrouter/openapi/api_client.rb +2 -2
  11. data/lib/plainrouter/openapi/api_error.rb +2 -2
  12. data/lib/plainrouter/openapi/api_model_base.rb +2 -2
  13. data/lib/plainrouter/openapi/configuration.rb +10 -3
  14. data/lib/plainrouter/openapi/models/action_batch_read.rb +164 -0
  15. data/lib/plainrouter/openapi/models/action_batch_read_data.rb +450 -0
  16. data/lib/plainrouter/openapi/models/action_current_disposition.rb +294 -0
  17. data/lib/plainrouter/openapi/models/action_decision_receipt_read.rb +244 -0
  18. data/lib/plainrouter/openapi/models/action_decision_receipt_read_chain_entry.rb +190 -0
  19. data/lib/plainrouter/openapi/models/action_detail_read.rb +164 -0
  20. data/lib/plainrouter/openapi/models/action_dry_run_read.rb +164 -0
  21. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run.rb +166 -0
  22. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner.rb +103 -0
  23. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner_any_of.rb +376 -0
  24. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner_any_of1.rb +268 -0
  25. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner_any_of_diff.rb +162 -0
  26. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner_any_of_target_entity.rb +199 -0
  27. data/lib/plainrouter/openapi/models/action_list_read.rb +192 -0
  28. data/lib/plainrouter/openapi/models/action_list_read_meta.rb +242 -0
  29. data/lib/plainrouter/openapi/models/action_policy_read.rb +164 -0
  30. data/lib/plainrouter/openapi/models/action_policy_read_data.rb +380 -0
  31. data/lib/plainrouter/openapi/models/action_proposal_input.rb +378 -0
  32. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner.rb +115 -0
  33. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of.rb +303 -0
  34. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of1.rb +303 -0
  35. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of10.rb +303 -0
  36. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of10_params.rb +356 -0
  37. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of11.rb +303 -0
  38. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of11_params.rb +173 -0
  39. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of12.rb +303 -0
  40. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of12_params.rb +188 -0
  41. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of13.rb +303 -0
  42. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of13_params.rb +259 -0
  43. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of2.rb +303 -0
  44. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of3.rb +303 -0
  45. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of4.rb +303 -0
  46. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of4_target_entity.rb +253 -0
  47. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of5.rb +303 -0
  48. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of6.rb +303 -0
  49. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of7.rb +303 -0
  50. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of8.rb +303 -0
  51. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of9.rb +303 -0
  52. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of_params.rb +173 -0
  53. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of_target_entity.rb +264 -0
  54. data/lib/plainrouter/openapi/models/action_proposal_input_evidence_inner.rb +262 -0
  55. data/lib/plainrouter/openapi/models/action_proposal_read.rb +164 -0
  56. data/lib/plainrouter/openapi/models/action_proposal_read_proposal.rb +452 -0
  57. data/lib/plainrouter/openapi/models/action_proposal_read_proposal_actions_inner.rb +386 -0
  58. data/lib/plainrouter/openapi/models/action_proposal_read_proposal_actions_inner_params.rb +103 -0
  59. data/lib/plainrouter/openapi/models/action_proposal_read_proposal_proposed_by.rb +202 -0
  60. data/lib/plainrouter/openapi/models/action_read_item.rb +516 -0
  61. data/lib/plainrouter/openapi/models/create_event200_response.rb +2 -2
  62. data/lib/plainrouter/openapi/models/create_event202_response.rb +218 -0
  63. data/lib/plainrouter/openapi/models/create_event202_response_warnings_inner.rb +240 -0
  64. data/lib/plainrouter/openapi/models/create_event_request.rb +2 -2
  65. data/lib/plainrouter/openapi/models/create_event_request_any_of.rb +2 -2
  66. data/lib/plainrouter/openapi/models/create_event_request_any_of1.rb +2 -2
  67. data/lib/plainrouter/openapi/models/create_event_request_any_of_event_time.rb +2 -2
  68. data/lib/plainrouter/openapi/models/create_event_request_any_of_value_data.rb +2 -2
  69. data/lib/plainrouter/openapi/models/delete_user_data200_response.rb +2 -2
  70. data/lib/plainrouter/openapi/models/delete_user_data_request.rb +35 -36
  71. data/lib/plainrouter/openapi/models/delivery_status.rb +2 -2
  72. data/lib/plainrouter/openapi/models/destination.rb +30 -3
  73. data/lib/plainrouter/openapi/models/destination_credential_source.rb +3 -4
  74. data/lib/plainrouter/openapi/models/destination_status.rb +2 -2
  75. data/lib/plainrouter/openapi/models/destination_type.rb +2 -2
  76. data/lib/plainrouter/openapi/models/emq_snapshot.rb +30 -3
  77. data/lib/plainrouter/openapi/models/error_message.rb +2 -2
  78. data/lib/plainrouter/openapi/models/event.rb +89 -45
  79. data/lib/plainrouter/openapi/models/get_emq_report200_response.rb +2 -2
  80. data/lib/plainrouter/openapi/models/get_emq_report200_response_snapshots_inner.rb +30 -3
  81. data/lib/plainrouter/openapi/models/get_event200_response.rb +2 -2
  82. data/lib/plainrouter/openapi/models/get_event200_response_deliveries_inner.rb +30 -3
  83. data/lib/plainrouter/openapi/models/get_event200_response_event.rb +31 -4
  84. data/lib/plainrouter/openapi/models/get_event200_response_event_consent.rb +2 -2
  85. data/lib/plainrouter/openapi/models/get_event200_response_event_deliveries_inner.rb +30 -3
  86. data/lib/plainrouter/openapi/models/get_event200_response_event_user_data_hashed.rb +104 -0
  87. data/lib/plainrouter/openapi/models/get_event200_response_lineage.rb +2 -2
  88. data/lib/plainrouter/openapi/models/get_event200_response_lineage_children_inner.rb +31 -4
  89. data/lib/plainrouter/openapi/models/get_event200_response_lineage_parent.rb +31 -4
  90. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response.rb +2 -2
  91. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner.rb +30 -3
  92. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_buckets_value.rb +2 -2
  93. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts.rb +2 -2
  94. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts_accepted.rb +2 -2
  95. data/lib/plainrouter/openapi/models/get_sandbox200_response.rb +2 -2
  96. data/lib/plainrouter/openapi/models/get_sandbox200_response_self_serve_key.rb +32 -6
  97. data/lib/plainrouter/openapi/models/{create_sandbox_key201_response.rb → get_sandbox200_response_self_serve_key_issued_key.rb} +6 -6
  98. data/lib/plainrouter/openapi/models/{create_sandbox_key201_response_use.rb → get_sandbox200_response_self_serve_key_issued_key_use.rb} +5 -5
  99. data/lib/plainrouter/openapi/models/get_sandbox200_response_try.rb +2 -2
  100. data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body.rb +2 -2
  101. data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body_value_data.rb +2 -2
  102. data/lib/plainrouter/openapi/models/ingestion_warning_code.rb +39 -0
  103. data/lib/plainrouter/openapi/models/jurisdiction_policy_class.rb +2 -2
  104. data/lib/plainrouter/openapi/models/list_events200_response.rb +2 -2
  105. data/lib/plainrouter/openapi/models/list_events200_response_events.rb +2 -2
  106. data/lib/plainrouter/openapi/models/list_events200_response_events_links_inner.rb +2 -2
  107. data/lib/plainrouter/openapi/models/list_events200_response_metrics.rb +2 -2
  108. data/lib/plainrouter/openapi/models/list_events_by_cursor200_response.rb +2 -2
  109. data/lib/plainrouter/openapi/models/list_events_by_cursor200_response_events.rb +2 -2
  110. data/lib/plainrouter/openapi/models/reconciliation_report.rb +31 -3
  111. data/lib/plainrouter/openapi/models/replay_deliveries202_response.rb +2 -2
  112. data/lib/plainrouter/openapi/models/replay_deliveries_request.rb +2 -2
  113. data/lib/plainrouter/openapi/models/send_test_purchase200_response.rb +2 -2
  114. data/lib/plainrouter/openapi/models/send_test_purchase422_response.rb +2 -2
  115. data/lib/plainrouter/openapi/models/send_test_purchase_request.rb +2 -2
  116. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response.rb +2 -2
  117. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response_destination.rb +30 -3
  118. data/lib/plainrouter/openapi/models/set_destination_test_mode_request.rb +2 -2
  119. data/lib/plainrouter/openapi/models/traffic_class.rb +2 -2
  120. data/lib/plainrouter/openapi/models/validate_sandbox_event200_response.rb +2 -2
  121. data/lib/plainrouter/openapi/models/validate_sandbox_event_request.rb +2 -2
  122. data/lib/plainrouter/openapi/models/validate_sandbox_event_request_value_data.rb +2 -2
  123. data/lib/plainrouter/openapi/models/validation_error.rb +2 -2
  124. data/lib/plainrouter/openapi/version.rb +3 -3
  125. data/lib/plainrouter/openapi.rb +58 -4
  126. data/lib/plainrouter/version.rb +1 -1
  127. metadata +64 -10
@@ -0,0 +1,303 @@
1
+ =begin
2
+ #Plainrouter Conversion API
3
+
4
+ #Plainrouter public Signals Conversion API.
5
+
6
+ The version of the OpenAPI document: 0.5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class ActionProposalInputActionsInnerAnyOf9 < ApiModelBase
18
+ attr_accessor :type
19
+
20
+ attr_accessor :target_entity
21
+
22
+ attr_accessor :params
23
+
24
+ attr_accessor :rationale
25
+
26
+ attr_accessor :idempotency_key
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'type' => :'type',
54
+ :'target_entity' => :'target_entity',
55
+ :'params' => :'params',
56
+ :'rationale' => :'rationale',
57
+ :'idempotency_key' => :'idempotency_key'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'type' => :'String',
75
+ :'target_entity' => :'ActionProposalInputActionsInnerAnyOf4TargetEntity',
76
+ :'params' => :'Object',
77
+ :'rationale' => :'String',
78
+ :'idempotency_key' => :'String'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf9` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf9`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'type')
105
+ self.type = attributes[:'type']
106
+ else
107
+ self.type = nil
108
+ end
109
+
110
+ if attributes.key?(:'target_entity')
111
+ self.target_entity = attributes[:'target_entity']
112
+ else
113
+ self.target_entity = nil
114
+ end
115
+
116
+ if attributes.key?(:'params')
117
+ self.params = attributes[:'params']
118
+ else
119
+ self.params = nil
120
+ end
121
+
122
+ if attributes.key?(:'rationale')
123
+ self.rationale = attributes[:'rationale']
124
+ else
125
+ self.rationale = nil
126
+ end
127
+
128
+ if attributes.key?(:'idempotency_key')
129
+ self.idempotency_key = attributes[:'idempotency_key']
130
+ end
131
+ end
132
+
133
+ # Show invalid properties with the reasons. Usually used together with valid?
134
+ # @return Array for valid properties with the reasons
135
+ def list_invalid_properties
136
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
137
+ invalid_properties = Array.new
138
+ if @type.nil?
139
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
140
+ end
141
+
142
+ if @target_entity.nil?
143
+ invalid_properties.push('invalid value for "target_entity", target_entity cannot be nil.')
144
+ end
145
+
146
+ if @params.nil?
147
+ invalid_properties.push('invalid value for "params", params cannot be nil.')
148
+ end
149
+
150
+ if @rationale.nil?
151
+ invalid_properties.push('invalid value for "rationale", rationale cannot be nil.')
152
+ end
153
+
154
+ if @rationale.to_s.length > 2000
155
+ invalid_properties.push('invalid value for "rationale", the character length must be smaller than or equal to 2000.')
156
+ end
157
+
158
+ if !@idempotency_key.nil? && @idempotency_key.to_s.length > 255
159
+ invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 255.')
160
+ end
161
+
162
+ invalid_properties
163
+ end
164
+
165
+ # Check to see if the all the properties in the model are valid
166
+ # @return true if the model is valid
167
+ def valid?
168
+ warn '[DEPRECATED] the `valid?` method is obsolete'
169
+ return false if @type.nil?
170
+ type_validator = EnumAttributeValidator.new('String', ["create_ad"])
171
+ return false unless type_validator.valid?(@type)
172
+ return false if @target_entity.nil?
173
+ return false if @params.nil?
174
+ return false if @rationale.nil?
175
+ return false if @rationale.to_s.length > 2000
176
+ return false if !@idempotency_key.nil? && @idempotency_key.to_s.length > 255
177
+ true
178
+ end
179
+
180
+ # Custom attribute writer method checking allowed values (enum).
181
+ # @param [Object] type Object to be assigned
182
+ def type=(type)
183
+ validator = EnumAttributeValidator.new('String', ["create_ad"])
184
+ unless validator.valid?(type)
185
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
186
+ end
187
+ @type = type
188
+ end
189
+
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] target_entity Value to be assigned
192
+ def target_entity=(target_entity)
193
+ if target_entity.nil?
194
+ fail ArgumentError, 'target_entity cannot be nil'
195
+ end
196
+
197
+ @target_entity = target_entity
198
+ end
199
+
200
+ # Custom attribute writer method with validation
201
+ # @param [Object] params Value to be assigned
202
+ def params=(params)
203
+ if params.nil?
204
+ fail ArgumentError, 'params cannot be nil'
205
+ end
206
+
207
+ @params = params
208
+ end
209
+
210
+ # Custom attribute writer method with validation
211
+ # @param [Object] rationale Value to be assigned
212
+ def rationale=(rationale)
213
+ if rationale.nil?
214
+ fail ArgumentError, 'rationale cannot be nil'
215
+ end
216
+
217
+ if rationale.to_s.length > 2000
218
+ fail ArgumentError, 'invalid value for "rationale", the character length must be smaller than or equal to 2000.'
219
+ end
220
+
221
+ @rationale = rationale
222
+ end
223
+
224
+ # Custom attribute writer method with validation
225
+ # @param [Object] idempotency_key Value to be assigned
226
+ def idempotency_key=(idempotency_key)
227
+ if idempotency_key.nil?
228
+ fail ArgumentError, 'idempotency_key cannot be nil'
229
+ end
230
+
231
+ if idempotency_key.to_s.length > 255
232
+ fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 255.'
233
+ end
234
+
235
+ @idempotency_key = idempotency_key
236
+ end
237
+
238
+ # Checks equality by comparing each attribute.
239
+ # @param [Object] Object to be compared
240
+ def ==(o)
241
+ return true if self.equal?(o)
242
+ self.class == o.class &&
243
+ type == o.type &&
244
+ target_entity == o.target_entity &&
245
+ params == o.params &&
246
+ rationale == o.rationale &&
247
+ idempotency_key == o.idempotency_key
248
+ end
249
+
250
+ # @see the `==` method
251
+ # @param [Object] Object to be compared
252
+ def eql?(o)
253
+ self == o
254
+ end
255
+
256
+ # Calculates hash code according to all attributes.
257
+ # @return [Integer] Hash code
258
+ def hash
259
+ [type, target_entity, params, rationale, idempotency_key].hash
260
+ end
261
+
262
+ # Builds the object from hash
263
+ # @param [Hash] attributes Model attributes in the form of hash
264
+ # @return [Object] Returns the model itself
265
+ def self.build_from_hash(attributes)
266
+ return nil unless attributes.is_a?(Hash)
267
+ attributes = attributes.transform_keys(&:to_sym)
268
+ transformed_hash = {}
269
+ openapi_types.each_pair do |key, type|
270
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
271
+ transformed_hash["#{key}"] = nil
272
+ elsif type =~ /\AArray<(.*)>/i
273
+ # check to ensure the input is an array given that the attribute
274
+ # is documented as an array but the input is not
275
+ if attributes[attribute_map[key]].is_a?(Array)
276
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
277
+ end
278
+ elsif !attributes[attribute_map[key]].nil?
279
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
280
+ end
281
+ end
282
+ new(transformed_hash)
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = self.send(attr)
291
+ if value.nil?
292
+ is_nullable = self.class.openapi_nullable.include?(attr)
293
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
294
+ end
295
+
296
+ hash[param] = _to_hash(value)
297
+ end
298
+ hash
299
+ end
300
+
301
+ end
302
+
303
+ end
@@ -0,0 +1,173 @@
1
+ =begin
2
+ #Plainrouter Conversion API
3
+
4
+ #Plainrouter public Signals Conversion API.
5
+
6
+ The version of the OpenAPI document: 0.5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class ActionProposalInputActionsInnerAnyOfParams < ApiModelBase
18
+ attr_accessor :new_daily_budget_minor
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'new_daily_budget_minor' => :'new_daily_budget_minor'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'new_daily_budget_minor' => :'Integer'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOfParams` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOfParams`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'new_daily_budget_minor')
67
+ self.new_daily_budget_minor = attributes[:'new_daily_budget_minor']
68
+ else
69
+ self.new_daily_budget_minor = nil
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if @new_daily_budget_minor.nil?
79
+ invalid_properties.push('invalid value for "new_daily_budget_minor", new_daily_budget_minor cannot be nil.')
80
+ end
81
+
82
+ if @new_daily_budget_minor < 1
83
+ invalid_properties.push('invalid value for "new_daily_budget_minor", must be greater than or equal to 1.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if @new_daily_budget_minor.nil?
94
+ return false if @new_daily_budget_minor < 1
95
+ true
96
+ end
97
+
98
+ # Custom attribute writer method with validation
99
+ # @param [Object] new_daily_budget_minor Value to be assigned
100
+ def new_daily_budget_minor=(new_daily_budget_minor)
101
+ if new_daily_budget_minor.nil?
102
+ fail ArgumentError, 'new_daily_budget_minor cannot be nil'
103
+ end
104
+
105
+ if new_daily_budget_minor < 1
106
+ fail ArgumentError, 'invalid value for "new_daily_budget_minor", must be greater than or equal to 1.'
107
+ end
108
+
109
+ @new_daily_budget_minor = new_daily_budget_minor
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ new_daily_budget_minor == o.new_daily_budget_minor
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [new_daily_budget_minor].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ end
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
151
+ end
152
+ new(transformed_hash)
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ if value.nil?
162
+ is_nullable = self.class.openapi_nullable.include?(attr)
163
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
164
+ end
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ end
172
+
173
+ end