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,220 @@
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
+ # Api_V1_TeamSerializer model
18
+ class Team
19
+ attr_accessor :data
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'data' => :'data'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'data' => :'TeamData'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BtTest::Team` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BtTest::Team`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'data')
62
+ self.data = attributes[:'data']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ data == o.data
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [data].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = BtTest.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,246 @@
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 TeamData
18
+ attr_accessor :id
19
+
20
+ attr_accessor :type
21
+
22
+ attr_accessor :attributes
23
+
24
+ attr_accessor :relationships
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'type' => :'type',
31
+ :'attributes' => :'attributes',
32
+ :'relationships' => :'relationships'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'id' => :'Integer',
45
+ :'type' => :'String',
46
+ :'attributes' => :'TeamDataAttributes',
47
+ :'relationships' => :'TeamDataRelationships'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BtTest::TeamData` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BtTest::TeamData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'id')
73
+ self.id = attributes[:'id']
74
+ end
75
+
76
+ if attributes.key?(:'type')
77
+ self.type = attributes[:'type']
78
+ end
79
+
80
+ if attributes.key?(:'attributes')
81
+ self.attributes = attributes[:'attributes']
82
+ end
83
+
84
+ if attributes.key?(:'relationships')
85
+ self.relationships = attributes[:'relationships']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ id == o.id &&
108
+ type == o.type &&
109
+ attributes == o.attributes &&
110
+ relationships == o.relationships
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [id, type, attributes, relationships].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
140
+ self.send("#{key}=", nil)
141
+ elsif type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :Time
162
+ Time.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :Boolean
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ # models (e.g. Pet) or oneOf
193
+ klass = BtTest.const_get(type)
194
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end