bullet_train_test 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +123 -0
  4. data/Rakefile +10 -0
  5. data/bullet_train_test.gemspec +38 -0
  6. data/docs/ApiV1GoalSerializer.md +18 -0
  7. data/docs/ApiV1GoalSerializerData.md +24 -0
  8. data/docs/ApiV1GoalSerializerDataAttributes.md +26 -0
  9. data/docs/ApiV1GoalSerializerDataRelationships.md +18 -0
  10. data/docs/ApiV1ProjectSerializer.md +18 -0
  11. data/docs/ApiV1ProjectSerializerData.md +24 -0
  12. data/docs/ApiV1ProjectSerializerDataAttributes.md +32 -0
  13. data/docs/ApiV1ProjectsTagSerializer.md +18 -0
  14. data/docs/ApiV1ProjectsTagSerializerData.md +24 -0
  15. data/docs/ApiV1ProjectsTagSerializerDataAttributes.md +26 -0
  16. data/docs/ApiV1ProjectsTagSerializerDataRelationships.md +18 -0
  17. data/docs/ApiV1ProjectsTagSerializerDataRelationshipsTeam.md +18 -0
  18. data/docs/ApiV1ProjectsTagSerializerDataRelationshipsTeamData.md +20 -0
  19. data/docs/ApiV1TeamSerializer.md +18 -0
  20. data/docs/ApiV1TeamSerializerData.md +24 -0
  21. data/docs/ApiV1TeamSerializerDataAttributes.md +28 -0
  22. data/docs/ApiV1TeamSerializerDataRelationships.md +18 -0
  23. data/docs/ApiV1TeamSerializerDataRelationshipsScaffoldingAbsolutelyAbstractCreativeConcepts.md +18 -0
  24. data/docs/GoalsApi.md +205 -0
  25. data/docs/MeApi.md +66 -0
  26. data/docs/ProjectsApi.md +472 -0
  27. data/docs/TeamsApi.md +628 -0
  28. data/git_push.sh +57 -0
  29. data/lib/bullet_train_test/api/goals_api.rb +210 -0
  30. data/lib/bullet_train_test/api/me_api.rb +73 -0
  31. data/lib/bullet_train_test/api/projects_api.rb +466 -0
  32. data/lib/bullet_train_test/api/teams_api.rb +611 -0
  33. data/lib/bullet_train_test/api_client.rb +389 -0
  34. data/lib/bullet_train_test/api_error.rb +57 -0
  35. data/lib/bullet_train_test/configuration.rb +271 -0
  36. data/lib/bullet_train_test/models/api_v1_goal_serializer.rb +219 -0
  37. data/lib/bullet_train_test/models/api_v1_goal_serializer_data.rb +245 -0
  38. data/lib/bullet_train_test/models/api_v1_goal_serializer_data_attributes.rb +254 -0
  39. data/lib/bullet_train_test/models/api_v1_goal_serializer_data_relationships.rb +218 -0
  40. data/lib/bullet_train_test/models/api_v1_project_serializer.rb +219 -0
  41. data/lib/bullet_train_test/models/api_v1_project_serializer_data.rb +245 -0
  42. data/lib/bullet_train_test/models/api_v1_project_serializer_data_attributes.rb +281 -0
  43. data/lib/bullet_train_test/models/api_v1_projects_tag_serializer.rb +219 -0
  44. data/lib/bullet_train_test/models/api_v1_projects_tag_serializer_data.rb +245 -0
  45. data/lib/bullet_train_test/models/api_v1_projects_tag_serializer_data_attributes.rb +254 -0
  46. data/lib/bullet_train_test/models/api_v1_projects_tag_serializer_data_relationships.rb +218 -0
  47. data/lib/bullet_train_test/models/api_v1_projects_tag_serializer_data_relationships_team.rb +218 -0
  48. data/lib/bullet_train_test/models/api_v1_projects_tag_serializer_data_relationships_team_data.rb +227 -0
  49. data/lib/bullet_train_test/models/api_v1_team_serializer.rb +219 -0
  50. data/lib/bullet_train_test/models/api_v1_team_serializer_data.rb +245 -0
  51. data/lib/bullet_train_test/models/api_v1_team_serializer_data_attributes.rb +263 -0
  52. data/lib/bullet_train_test/models/api_v1_team_serializer_data_relationships.rb +218 -0
  53. data/lib/bullet_train_test/models/api_v1_team_serializer_data_relationships_scaffolding_absolutely_abstract_creative_concepts.rb +220 -0
  54. data/lib/bullet_train_test/version.rb +15 -0
  55. data/lib/bullet_train_test.rb +61 -0
  56. data/spec/api/goals_api_spec.rb +69 -0
  57. data/spec/api/me_api_spec.rb +44 -0
  58. data/spec/api/projects_api_spec.rb +115 -0
  59. data/spec/api/teams_api_spec.rb +144 -0
  60. data/spec/api_client_spec.rb +226 -0
  61. data/spec/configuration_spec.rb +42 -0
  62. data/spec/models/api_v1_goal_serializer_data_attributes_spec.rb +58 -0
  63. data/spec/models/api_v1_goal_serializer_data_relationships_spec.rb +34 -0
  64. data/spec/models/api_v1_goal_serializer_data_spec.rb +52 -0
  65. data/spec/models/api_v1_goal_serializer_spec.rb +34 -0
  66. data/spec/models/api_v1_project_serializer_data_attributes_spec.rb +76 -0
  67. data/spec/models/api_v1_project_serializer_data_spec.rb +52 -0
  68. data/spec/models/api_v1_project_serializer_spec.rb +34 -0
  69. data/spec/models/api_v1_projects_tag_serializer_data_attributes_spec.rb +58 -0
  70. data/spec/models/api_v1_projects_tag_serializer_data_relationships_spec.rb +34 -0
  71. data/spec/models/api_v1_projects_tag_serializer_data_relationships_team_data_spec.rb +40 -0
  72. data/spec/models/api_v1_projects_tag_serializer_data_relationships_team_spec.rb +34 -0
  73. data/spec/models/api_v1_projects_tag_serializer_data_spec.rb +52 -0
  74. data/spec/models/api_v1_projects_tag_serializer_spec.rb +34 -0
  75. data/spec/models/api_v1_team_serializer_data_attributes_spec.rb +64 -0
  76. data/spec/models/api_v1_team_serializer_data_relationships_scaffolding_absolutely_abstract_creative_concepts_spec.rb +34 -0
  77. data/spec/models/api_v1_team_serializer_data_relationships_spec.rb +34 -0
  78. data/spec/models/api_v1_team_serializer_data_spec.rb +52 -0
  79. data/spec/models/api_v1_team_serializer_spec.rb +34 -0
  80. data/spec/spec_helper.rb +111 -0
  81. metadata +187 -0
@@ -0,0 +1,271 @@
1
+ =begin
2
+ #Bullet Train 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: 5.3.0
10
+
11
+ =end
12
+
13
+ module BulletTrainTest
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
+ attr_accessor :inject_format
137
+
138
+ attr_accessor :force_ending_format
139
+
140
+ def initialize
141
+ @scheme = 'https'
142
+ @host = 'bullettrainapi.eu.ngrok.io'
143
+ @base_path = '/api/v1'
144
+ @server_index = 0
145
+ @server_operation_index = {}
146
+ @server_variables = {}
147
+ @server_operation_variables = {}
148
+ @api_key = {}
149
+ @api_key_prefix = {}
150
+ @client_side_validation = true
151
+ @verify_ssl = true
152
+ @verify_ssl_host = true
153
+ @params_encoding = nil
154
+ @cert_file = nil
155
+ @key_file = nil
156
+ @timeout = 0
157
+ @debugging = false
158
+ @inject_format = false
159
+ @force_ending_format = false
160
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
161
+
162
+ yield(self) if block_given?
163
+ end
164
+
165
+ # The default Configuration object.
166
+ def self.default
167
+ @@default ||= Configuration.new
168
+ end
169
+
170
+ def configure
171
+ yield(self) if block_given?
172
+ end
173
+
174
+ def scheme=(scheme)
175
+ # remove :// from scheme
176
+ @scheme = scheme.sub(/:\/\//, '')
177
+ end
178
+
179
+ def host=(host)
180
+ # remove http(s):// and anything after a slash
181
+ @host = host.sub(/https?:\/\//, '').split('/').first
182
+ end
183
+
184
+ def base_path=(base_path)
185
+ # Add leading and trailing slashes to base_path
186
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
187
+ @base_path = '' if @base_path == '/'
188
+ end
189
+
190
+ # Returns base URL for specified operation based on server settings
191
+ def base_url(operation = nil)
192
+ index = server_operation_index.fetch(operation, server_index)
193
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
194
+
195
+ server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
196
+ end
197
+
198
+ # Gets API key (with prefix if set).
199
+ # @param [String] param_name the parameter name of API key auth
200
+ def api_key_with_prefix(param_name, param_alias = nil)
201
+ key = @api_key[param_name]
202
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
203
+ if @api_key_prefix[param_name]
204
+ "#{@api_key_prefix[param_name]} #{key}"
205
+ else
206
+ key
207
+ end
208
+ end
209
+
210
+ # Gets Basic Auth token string
211
+ def basic_auth_token
212
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
213
+ end
214
+
215
+ # Returns Auth Settings hash for api client.
216
+ def auth_settings
217
+ {
218
+ }
219
+ end
220
+
221
+ # Returns an array of Server setting
222
+ def server_settings
223
+ [
224
+ {
225
+ url: "https://bullettrainapi.eu.ngrok.io/api/v1",
226
+ description: "No description provided",
227
+ }
228
+ ]
229
+ end
230
+
231
+ def operation_server_settings
232
+ {
233
+ }
234
+ end
235
+
236
+ # Returns URL based on server settings
237
+ #
238
+ # @param index array index of the server settings
239
+ # @param variables hash of variable and the corresponding value
240
+ def server_url(index, variables = {}, servers = nil)
241
+ servers = server_settings if servers == nil
242
+
243
+ # check array index out of bound
244
+ if (index < 0 || index >= servers.size)
245
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
246
+ end
247
+
248
+ server = servers[index]
249
+ url = server[:url]
250
+
251
+ return url unless server.key? :variables
252
+
253
+ # go through variable and assign a value
254
+ server[:variables].each do |name, variable|
255
+ if variables.key?(name)
256
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
257
+ url.gsub! "{" + name.to_s + "}", variables[name]
258
+ else
259
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
260
+ end
261
+ else
262
+ # use default value
263
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
264
+ end
265
+ end
266
+
267
+ url
268
+ end
269
+
270
+ end
271
+ end
@@ -0,0 +1,219 @@
1
+ =begin
2
+ #Bullet Train 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: 5.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module BulletTrainTest
17
+ # Api_V1_GoalSerializer model
18
+ class ApiV1GoalSerializer
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' => :'ApiV1GoalSerializerData'
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 `BulletTrainTest::ApiV1GoalSerializer` 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 `BulletTrainTest::ApiV1GoalSerializer`. 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
+ 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 = BulletTrainTest.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