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,280 @@
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
+ module BtTest
14
+ class Configuration
15
+ # Defines url scheme
16
+ attr_accessor :scheme
17
+
18
+ # Defines url host
19
+ attr_accessor :host
20
+
21
+ # Defines url base path
22
+ attr_accessor :base_path
23
+
24
+ # Define server configuration index
25
+ attr_accessor :server_index
26
+
27
+ # Define server operation configuration index
28
+ attr_accessor :server_operation_index
29
+
30
+ # Default server variables
31
+ attr_accessor :server_variables
32
+
33
+ # Default server operation variables
34
+ attr_accessor :server_operation_variables
35
+
36
+ # Defines API keys used with API Key authentications.
37
+ #
38
+ # @return [Hash] key: parameter name, value: parameter value (API key)
39
+ #
40
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
+ # config.api_key['api_key'] = 'xxx'
42
+ attr_accessor :api_key
43
+
44
+ # Defines API key prefixes used with API Key authentications.
45
+ #
46
+ # @return [Hash] key: parameter name, value: API key prefix
47
+ #
48
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
+ # config.api_key_prefix['api_key'] = 'Token'
50
+ attr_accessor :api_key_prefix
51
+
52
+ # Defines the username used with HTTP basic authentication.
53
+ #
54
+ # @return [String]
55
+ attr_accessor :username
56
+
57
+ # Defines the password used with HTTP basic authentication.
58
+ #
59
+ # @return [String]
60
+ attr_accessor :password
61
+
62
+ # Defines the access token (Bearer) used with OAuth2.
63
+ attr_accessor :access_token
64
+
65
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
66
+ # details will be logged with `logger.debug` (see the `logger` attribute).
67
+ # Default to false.
68
+ #
69
+ # @return [true, false]
70
+ attr_accessor :debugging
71
+
72
+ # Defines the logger used for debugging.
73
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
74
+ #
75
+ # @return [#debug]
76
+ attr_accessor :logger
77
+
78
+ # Defines the temporary folder to store downloaded files
79
+ # (for API endpoints that have file response).
80
+ # Default to use `Tempfile`.
81
+ #
82
+ # @return [String]
83
+ attr_accessor :temp_folder_path
84
+
85
+ # The time limit for HTTP request in seconds.
86
+ # Default to 0 (never times out).
87
+ attr_accessor :timeout
88
+
89
+ # Set this to false to skip client side validation in the operation.
90
+ # Default to true.
91
+ # @return [true, false]
92
+ attr_accessor :client_side_validation
93
+
94
+ ### TLS/SSL setting
95
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
96
+ # Default to true.
97
+ #
98
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
99
+ #
100
+ # @return [true, false]
101
+ attr_accessor :verify_ssl
102
+
103
+ ### TLS/SSL setting
104
+ # Set this to false to skip verifying SSL host name
105
+ # Default to true.
106
+ #
107
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
108
+ #
109
+ # @return [true, false]
110
+ attr_accessor :verify_ssl_host
111
+
112
+ ### TLS/SSL setting
113
+ # Set this to customize the certificate file to verify the peer.
114
+ #
115
+ # @return [String] the path to the certificate file
116
+ #
117
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
118
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
119
+ attr_accessor :ssl_ca_cert
120
+
121
+ ### TLS/SSL setting
122
+ # Client certificate file (for client certificate)
123
+ attr_accessor :cert_file
124
+
125
+ ### TLS/SSL setting
126
+ # Client private key file (for client certificate)
127
+ attr_accessor :key_file
128
+
129
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
130
+ # Default to nil.
131
+ #
132
+ # @see The params_encoding option of Ethon. Related source code:
133
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
134
+ attr_accessor :params_encoding
135
+
136
+
137
+ attr_accessor :inject_format
138
+
139
+ attr_accessor :force_ending_format
140
+
141
+ def initialize
142
+ @scheme = 'https'
143
+ @host = 'btapi.eu.ngrok.io'
144
+ @base_path = '/api/v1'
145
+ @server_index = 0
146
+ @server_operation_index = {}
147
+ @server_variables = {}
148
+ @server_operation_variables = {}
149
+ @api_key = {}
150
+ @api_key_prefix = {}
151
+ @client_side_validation = true
152
+ @verify_ssl = true
153
+ @verify_ssl_host = true
154
+ @cert_file = nil
155
+ @key_file = nil
156
+ @timeout = 0
157
+ @params_encoding = nil
158
+ @debugging = false
159
+ @inject_format = false
160
+ @force_ending_format = false
161
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
162
+
163
+ yield(self) if block_given?
164
+ end
165
+
166
+ # The default Configuration object.
167
+ def self.default
168
+ @@default ||= Configuration.new
169
+ end
170
+
171
+ def configure
172
+ yield(self) if block_given?
173
+ end
174
+
175
+ def scheme=(scheme)
176
+ # remove :// from scheme
177
+ @scheme = scheme.sub(/:\/\//, '')
178
+ end
179
+
180
+ def host=(host)
181
+ # remove http(s):// and anything after a slash
182
+ @host = host.sub(/https?:\/\//, '').split('/').first
183
+ end
184
+
185
+ def base_path=(base_path)
186
+ # Add leading and trailing slashes to base_path
187
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
188
+ @base_path = '' if @base_path == '/'
189
+ end
190
+
191
+ # Returns base URL for specified operation based on server settings
192
+ def base_url(operation = nil)
193
+ index = server_operation_index.fetch(operation, server_index)
194
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
195
+
196
+ server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
197
+ end
198
+
199
+ # Gets API key (with prefix if set).
200
+ # @param [String] param_name the parameter name of API key auth
201
+ def api_key_with_prefix(param_name, param_alias = nil)
202
+ key = @api_key[param_name]
203
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
204
+ if @api_key_prefix[param_name]
205
+ "#{@api_key_prefix[param_name]} #{key}"
206
+ else
207
+ key
208
+ end
209
+ end
210
+
211
+ # Gets Basic Auth token string
212
+ def basic_auth_token
213
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
214
+ end
215
+
216
+ # Returns Auth Settings hash for api client.
217
+ def auth_settings
218
+ {
219
+ 'bearerAuth' =>
220
+ {
221
+ type: 'bearer',
222
+ in: 'header',
223
+ format: 'Auth token',
224
+ key: 'Authorization',
225
+ value: "Bearer #{access_token}"
226
+ },
227
+ }
228
+ end
229
+
230
+ # Returns an array of Server setting
231
+ def server_settings
232
+ [
233
+ {
234
+ url: "https://btapi.eu.ngrok.io/api/v1",
235
+ description: "No description provided",
236
+ }
237
+ ]
238
+ end
239
+
240
+ def operation_server_settings
241
+ {
242
+ }
243
+ end
244
+
245
+ # Returns URL based on server settings
246
+ #
247
+ # @param index array index of the server settings
248
+ # @param variables hash of variable and the corresponding value
249
+ def server_url(index, variables = {}, servers = nil)
250
+ servers = server_settings if servers == nil
251
+
252
+ # check array index out of bound
253
+ if (index < 0 || index >= servers.size)
254
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
255
+ end
256
+
257
+ server = servers[index]
258
+ url = server[:url]
259
+
260
+ return url unless server.key? :variables
261
+
262
+ # go through variable and assign a value
263
+ server[:variables].each do |name, variable|
264
+ if variables.key?(name)
265
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
266
+ url.gsub! "{" + name.to_s + "}", variables[name]
267
+ else
268
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
269
+ end
270
+ else
271
+ # use default value
272
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
273
+ end
274
+ end
275
+
276
+ url
277
+ end
278
+
279
+ end
280
+ end
@@ -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
+ class CreateGoalRequest
18
+ # Description
19
+ attr_accessor :description
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'description' => :'description'
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
+ :'description' => :'String'
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::CreateGoalRequest` 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::CreateGoalRequest`. 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?(:'description')
62
+ self.description = attributes[:'description']
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
+ description == o.description
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
+ [description].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