bt_test 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +187 -0
  4. data/Rakefile +10 -0
  5. data/bt_test.gemspec +38 -0
  6. data/docs/CreateGoalRequest.md +18 -0
  7. data/docs/CreateProjectRequest.md +26 -0
  8. data/docs/CreateProjectsTagRequest.md +18 -0
  9. data/docs/CreateScaffoldingAbsolutelyAbstractCreativeConceptRequest.md +20 -0
  10. data/docs/CreateTeamRequest.md +20 -0
  11. data/docs/CreateWebhooksOutgoingEndpointRequest.md +22 -0
  12. data/docs/Goal.md +18 -0
  13. data/docs/GoalData.md +24 -0
  14. data/docs/GoalDataAttributes.md +24 -0
  15. data/docs/GoalDataRelationships.md +18 -0
  16. data/docs/Me.md +18 -0
  17. data/docs/MeData.md +24 -0
  18. data/docs/MeDataAttributes.md +38 -0
  19. data/docs/MeDataRelationships.md +20 -0
  20. data/docs/PlatformApi.md +2834 -0
  21. data/docs/Project.md +18 -0
  22. data/docs/ProjectData.md +24 -0
  23. data/docs/ProjectDataAttributes.md +24 -0
  24. data/docs/ProjectDataRelationships.md +26 -0
  25. data/docs/ProjectDataRelationshipsTags.md +18 -0
  26. data/docs/ProjectsTag.md +18 -0
  27. data/docs/ProjectsTagData.md +24 -0
  28. data/docs/ProjectsTagDataAttributes.md +22 -0
  29. data/docs/ProjectsTagDataRelationships.md +20 -0
  30. data/docs/ProjectsTagDataRelationshipsTeam.md +18 -0
  31. data/docs/ProjectsTagDataRelationshipsTeamData.md +20 -0
  32. data/docs/ScaffoldingAbsolutelyAbstractCreativeConcept.md +18 -0
  33. data/docs/ScaffoldingAbsolutelyAbstractCreativeConceptData.md +24 -0
  34. data/docs/ScaffoldingAbsolutelyAbstractCreativeConceptDataAttributes.md +28 -0
  35. data/docs/ScaffoldingAbsolutelyAbstractCreativeConceptDataRelationships.md +20 -0
  36. data/docs/ScaffoldingCompletelyConcreteTangibleThing.md +18 -0
  37. data/docs/ScaffoldingCompletelyConcreteTangibleThingData.md +24 -0
  38. data/docs/ScaffoldingCompletelyConcreteTangibleThingDataAttributes.md +46 -0
  39. data/docs/ScaffoldingCompletelyConcreteTangibleThingDataRelationships.md +18 -0
  40. data/docs/Team.md +18 -0
  41. data/docs/TeamData.md +24 -0
  42. data/docs/TeamDataAttributes.md +28 -0
  43. data/docs/TeamDataRelationships.md +18 -0
  44. data/docs/UpdateScaffoldingCompletelyConcreteTangibleThingRequest.md +46 -0
  45. data/docs/WebhooksOutgoingDelivery.md +18 -0
  46. data/docs/WebhooksOutgoingDeliveryAttempt.md +18 -0
  47. data/docs/WebhooksOutgoingDeliveryAttemptData.md +24 -0
  48. data/docs/WebhooksOutgoingDeliveryAttemptDataAttributes.md +34 -0
  49. data/docs/WebhooksOutgoingDeliveryAttemptDataRelationships.md +18 -0
  50. data/docs/WebhooksOutgoingDeliveryData.md +24 -0
  51. data/docs/WebhooksOutgoingDeliveryDataAttributes.md +30 -0
  52. data/docs/WebhooksOutgoingDeliveryDataRelationships.md +18 -0
  53. data/docs/WebhooksOutgoingEndpoint.md +18 -0
  54. data/docs/WebhooksOutgoingEndpointData.md +24 -0
  55. data/docs/WebhooksOutgoingEndpointDataAttributes.md +28 -0
  56. data/docs/WebhooksOutgoingEndpointDataRelationships.md +18 -0
  57. data/git_push.sh +57 -0
  58. data/lib/bt_test/api/platform_api.rb +2523 -0
  59. data/lib/bt_test/api_client.rb +392 -0
  60. data/lib/bt_test/api_error.rb +57 -0
  61. data/lib/bt_test/configuration.rb +280 -0
  62. data/lib/bt_test/models/create_goal_request.rb +220 -0
  63. data/lib/bt_test/models/create_project_request.rb +262 -0
  64. data/lib/bt_test/models/create_projects_tag_request.rb +220 -0
  65. data/lib/bt_test/models/create_scaffolding_absolutely_abstract_creative_concept_request.rb +230 -0
  66. data/lib/bt_test/models/create_team_request.rb +230 -0
  67. data/lib/bt_test/models/create_webhooks_outgoing_endpoint_request.rb +242 -0
  68. data/lib/bt_test/models/goal.rb +220 -0
  69. data/lib/bt_test/models/goal_data.rb +246 -0
  70. data/lib/bt_test/models/goal_data_attributes.rb +246 -0
  71. data/lib/bt_test/models/goal_data_relationships.rb +219 -0
  72. data/lib/bt_test/models/me.rb +220 -0
  73. data/lib/bt_test/models/me_data.rb +246 -0
  74. data/lib/bt_test/models/me_data_attributes.rb +309 -0
  75. data/lib/bt_test/models/me_data_relationships.rb +228 -0
  76. data/lib/bt_test/models/project.rb +220 -0
  77. data/lib/bt_test/models/project_data.rb +246 -0
  78. data/lib/bt_test/models/project_data_attributes.rb +246 -0
  79. data/lib/bt_test/models/project_data_relationships.rb +255 -0
  80. data/lib/bt_test/models/project_data_relationships_tags.rb +221 -0
  81. data/lib/bt_test/models/projects_tag.rb +220 -0
  82. data/lib/bt_test/models/projects_tag_data.rb +246 -0
  83. data/lib/bt_test/models/projects_tag_data_attributes.rb +237 -0
  84. data/lib/bt_test/models/projects_tag_data_relationships.rb +228 -0
  85. data/lib/bt_test/models/projects_tag_data_relationships_team.rb +219 -0
  86. data/lib/bt_test/models/projects_tag_data_relationships_team_data.rb +228 -0
  87. data/lib/bt_test/models/scaffolding_absolutely_abstract_creative_concept.rb +220 -0
  88. data/lib/bt_test/models/scaffolding_absolutely_abstract_creative_concept_data.rb +246 -0
  89. data/lib/bt_test/models/scaffolding_absolutely_abstract_creative_concept_data_attributes.rb +264 -0
  90. data/lib/bt_test/models/scaffolding_absolutely_abstract_creative_concept_data_relationships.rb +228 -0
  91. data/lib/bt_test/models/scaffolding_completely_concrete_tangible_thing.rb +220 -0
  92. data/lib/bt_test/models/scaffolding_completely_concrete_tangible_thing_data.rb +246 -0
  93. data/lib/bt_test/models/scaffolding_completely_concrete_tangible_thing_data_attributes.rb +345 -0
  94. data/lib/bt_test/models/scaffolding_completely_concrete_tangible_thing_data_relationships.rb +219 -0
  95. data/lib/bt_test/models/team.rb +220 -0
  96. data/lib/bt_test/models/team_data.rb +246 -0
  97. data/lib/bt_test/models/team_data_attributes.rb +264 -0
  98. data/lib/bt_test/models/team_data_relationships.rb +219 -0
  99. data/lib/bt_test/models/update_scaffolding_completely_concrete_tangible_thing_request.rb +366 -0
  100. data/lib/bt_test/models/webhooks_outgoing_delivery.rb +220 -0
  101. data/lib/bt_test/models/webhooks_outgoing_delivery_attempt.rb +220 -0
  102. data/lib/bt_test/models/webhooks_outgoing_delivery_attempt_data.rb +246 -0
  103. data/lib/bt_test/models/webhooks_outgoing_delivery_attempt_data_attributes.rb +291 -0
  104. data/lib/bt_test/models/webhooks_outgoing_delivery_attempt_data_relationships.rb +219 -0
  105. data/lib/bt_test/models/webhooks_outgoing_delivery_data.rb +246 -0
  106. data/lib/bt_test/models/webhooks_outgoing_delivery_data_attributes.rb +273 -0
  107. data/lib/bt_test/models/webhooks_outgoing_delivery_data_relationships.rb +219 -0
  108. data/lib/bt_test/models/webhooks_outgoing_endpoint.rb +220 -0
  109. data/lib/bt_test/models/webhooks_outgoing_endpoint_data.rb +246 -0
  110. data/lib/bt_test/models/webhooks_outgoing_endpoint_data_attributes.rb +264 -0
  111. data/lib/bt_test/models/webhooks_outgoing_endpoint_data_relationships.rb +219 -0
  112. data/lib/bt_test/version.rb +15 -0
  113. data/lib/bt_test.rb +90 -0
  114. data/spec/api/platform_api_spec.rb +493 -0
  115. data/spec/api_client_spec.rb +226 -0
  116. data/spec/configuration_spec.rb +42 -0
  117. data/spec/models/create_goal_request_spec.rb +34 -0
  118. data/spec/models/create_project_request_spec.rb +58 -0
  119. data/spec/models/create_projects_tag_request_spec.rb +34 -0
  120. data/spec/models/create_scaffolding_absolutely_abstract_creative_concept_request_spec.rb +40 -0
  121. data/spec/models/create_team_request_spec.rb +40 -0
  122. data/spec/models/create_webhooks_outgoing_endpoint_request_spec.rb +46 -0
  123. data/spec/models/goal_data_attributes_spec.rb +52 -0
  124. data/spec/models/goal_data_relationships_spec.rb +34 -0
  125. data/spec/models/goal_data_spec.rb +52 -0
  126. data/spec/models/goal_spec.rb +34 -0
  127. data/spec/models/me_data_attributes_spec.rb +94 -0
  128. data/spec/models/me_data_relationships_spec.rb +40 -0
  129. data/spec/models/me_data_spec.rb +52 -0
  130. data/spec/models/me_spec.rb +34 -0
  131. data/spec/models/project_data_attributes_spec.rb +52 -0
  132. data/spec/models/project_data_relationships_spec.rb +58 -0
  133. data/spec/models/project_data_relationships_tags_spec.rb +34 -0
  134. data/spec/models/project_data_spec.rb +52 -0
  135. data/spec/models/project_spec.rb +34 -0
  136. data/spec/models/projects_tag_data_attributes_spec.rb +46 -0
  137. data/spec/models/projects_tag_data_relationships_spec.rb +40 -0
  138. data/spec/models/projects_tag_data_relationships_team_data_spec.rb +40 -0
  139. data/spec/models/projects_tag_data_relationships_team_spec.rb +34 -0
  140. data/spec/models/projects_tag_data_spec.rb +52 -0
  141. data/spec/models/projects_tag_spec.rb +34 -0
  142. data/spec/models/scaffolding_absolutely_abstract_creative_concept_data_attributes_spec.rb +64 -0
  143. data/spec/models/scaffolding_absolutely_abstract_creative_concept_data_relationships_spec.rb +40 -0
  144. data/spec/models/scaffolding_absolutely_abstract_creative_concept_data_spec.rb +52 -0
  145. data/spec/models/scaffolding_absolutely_abstract_creative_concept_spec.rb +34 -0
  146. data/spec/models/scaffolding_completely_concrete_tangible_thing_data_attributes_spec.rb +118 -0
  147. data/spec/models/scaffolding_completely_concrete_tangible_thing_data_relationships_spec.rb +34 -0
  148. data/spec/models/scaffolding_completely_concrete_tangible_thing_data_spec.rb +52 -0
  149. data/spec/models/scaffolding_completely_concrete_tangible_thing_spec.rb +34 -0
  150. data/spec/models/team_data_attributes_spec.rb +64 -0
  151. data/spec/models/team_data_relationships_spec.rb +34 -0
  152. data/spec/models/team_data_spec.rb +52 -0
  153. data/spec/models/team_spec.rb +34 -0
  154. data/spec/models/update_scaffolding_completely_concrete_tangible_thing_request_spec.rb +118 -0
  155. data/spec/models/webhooks_outgoing_delivery_attempt_data_attributes_spec.rb +82 -0
  156. data/spec/models/webhooks_outgoing_delivery_attempt_data_relationships_spec.rb +34 -0
  157. data/spec/models/webhooks_outgoing_delivery_attempt_data_spec.rb +52 -0
  158. data/spec/models/webhooks_outgoing_delivery_attempt_spec.rb +34 -0
  159. data/spec/models/webhooks_outgoing_delivery_data_attributes_spec.rb +70 -0
  160. data/spec/models/webhooks_outgoing_delivery_data_relationships_spec.rb +34 -0
  161. data/spec/models/webhooks_outgoing_delivery_data_spec.rb +52 -0
  162. data/spec/models/webhooks_outgoing_delivery_spec.rb +34 -0
  163. data/spec/models/webhooks_outgoing_endpoint_data_attributes_spec.rb +64 -0
  164. data/spec/models/webhooks_outgoing_endpoint_data_relationships_spec.rb +34 -0
  165. data/spec/models/webhooks_outgoing_endpoint_data_spec.rb +52 -0
  166. data/spec/models/webhooks_outgoing_endpoint_spec.rb +34 -0
  167. data/spec/spec_helper.rb +111 -0
  168. metadata +303 -0
@@ -0,0 +1,291 @@
1
+ =begin
2
+ #BT Test
3
+
4
+ #You can update this description in `config/locales/en/application.en.yml`.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module BtTest
17
+ class WebhooksOutgoingDeliveryAttemptDataAttributes
18
+ attr_accessor :id
19
+
20
+ attr_accessor :delivery_id
21
+
22
+ attr_accessor :response_code
23
+
24
+ attr_accessor :response_body
25
+
26
+ attr_accessor :response_message
27
+
28
+ attr_accessor :error_message
29
+
30
+ attr_accessor :attempt_number
31
+
32
+ attr_accessor :created_at
33
+
34
+ attr_accessor :updated_at
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'id' => :'id',
40
+ :'delivery_id' => :'delivery_id',
41
+ :'response_code' => :'response_code',
42
+ :'response_body' => :'response_body',
43
+ :'response_message' => :'response_message',
44
+ :'error_message' => :'error_message',
45
+ :'attempt_number' => :'attempt_number',
46
+ :'created_at' => :'created_at',
47
+ :'updated_at' => :'updated_at'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'id' => :'Integer',
60
+ :'delivery_id' => :'Integer',
61
+ :'response_code' => :'Integer',
62
+ :'response_body' => :'String',
63
+ :'response_message' => :'String',
64
+ :'error_message' => :'String',
65
+ :'attempt_number' => :'Integer',
66
+ :'created_at' => :'Time',
67
+ :'updated_at' => :'Time'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BtTest::WebhooksOutgoingDeliveryAttemptDataAttributes` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BtTest::WebhooksOutgoingDeliveryAttemptDataAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'id')
93
+ self.id = attributes[:'id']
94
+ end
95
+
96
+ if attributes.key?(:'delivery_id')
97
+ self.delivery_id = attributes[:'delivery_id']
98
+ end
99
+
100
+ if attributes.key?(:'response_code')
101
+ self.response_code = attributes[:'response_code']
102
+ end
103
+
104
+ if attributes.key?(:'response_body')
105
+ self.response_body = attributes[:'response_body']
106
+ end
107
+
108
+ if attributes.key?(:'response_message')
109
+ self.response_message = attributes[:'response_message']
110
+ end
111
+
112
+ if attributes.key?(:'error_message')
113
+ self.error_message = attributes[:'error_message']
114
+ end
115
+
116
+ if attributes.key?(:'attempt_number')
117
+ self.attempt_number = attributes[:'attempt_number']
118
+ end
119
+
120
+ if attributes.key?(:'created_at')
121
+ self.created_at = attributes[:'created_at']
122
+ end
123
+
124
+ if attributes.key?(:'updated_at')
125
+ self.updated_at = attributes[:'updated_at']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ invalid_properties = Array.new
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ true
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ id == o.id &&
148
+ delivery_id == o.delivery_id &&
149
+ response_code == o.response_code &&
150
+ response_body == o.response_body &&
151
+ response_message == o.response_message &&
152
+ error_message == o.error_message &&
153
+ attempt_number == o.attempt_number &&
154
+ created_at == o.created_at &&
155
+ updated_at == o.updated_at
156
+ end
157
+
158
+ # @see the `==` method
159
+ # @param [Object] Object to be compared
160
+ def eql?(o)
161
+ self == o
162
+ end
163
+
164
+ # Calculates hash code according to all attributes.
165
+ # @return [Integer] Hash code
166
+ def hash
167
+ [id, delivery_id, response_code, response_body, response_message, error_message, attempt_number, created_at, updated_at].hash
168
+ end
169
+
170
+ # Builds the object from hash
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ # @return [Object] Returns the model itself
173
+ def self.build_from_hash(attributes)
174
+ new.build_from_hash(attributes)
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ self.class.openapi_types.each_pair do |key, type|
184
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
185
+ self.send("#{key}=", nil)
186
+ elsif type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
190
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
191
+ end
192
+ elsif !attributes[self.class.attribute_map[key]].nil?
193
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
194
+ end
195
+ end
196
+
197
+ self
198
+ end
199
+
200
+ # Deserializes the data based on type
201
+ # @param string type Data type
202
+ # @param string value Value to be deserialized
203
+ # @return [Object] Deserialized data
204
+ def _deserialize(type, value)
205
+ case type.to_sym
206
+ when :Time
207
+ Time.parse(value)
208
+ when :Date
209
+ Date.parse(value)
210
+ when :String
211
+ value.to_s
212
+ when :Integer
213
+ value.to_i
214
+ when :Float
215
+ value.to_f
216
+ when :Boolean
217
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
218
+ true
219
+ else
220
+ false
221
+ end
222
+ when :Object
223
+ # generic object (usually a Hash), return directly
224
+ value
225
+ when /\AArray<(?<inner_type>.+)>\z/
226
+ inner_type = Regexp.last_match[:inner_type]
227
+ value.map { |v| _deserialize(inner_type, v) }
228
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
229
+ k_type = Regexp.last_match[:k_type]
230
+ v_type = Regexp.last_match[:v_type]
231
+ {}.tap do |hash|
232
+ value.each do |k, v|
233
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
+ end
235
+ end
236
+ else # model
237
+ # models (e.g. Pet) or oneOf
238
+ klass = BtTest.const_get(type)
239
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end
288
+
289
+ end
290
+
291
+ end
@@ -0,0 +1,219 @@
1
+ =begin
2
+ #BT Test
3
+
4
+ #You can update this description in `config/locales/en/application.en.yml`.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module BtTest
17
+ class WebhooksOutgoingDeliveryAttemptDataRelationships
18
+ attr_accessor :delivery
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'delivery' => :'delivery'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'delivery' => :'ProjectsTagDataRelationshipsTeam'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BtTest::WebhooksOutgoingDeliveryAttemptDataRelationships` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BtTest::WebhooksOutgoingDeliveryAttemptDataRelationships`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'delivery')
61
+ self.delivery = attributes[:'delivery']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ delivery == o.delivery
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [delivery].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ attributes = attributes.transform_keys(&:to_sym)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
+ self.send("#{key}=", nil)
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = BtTest.const_get(type)
167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end