quake_timesheets_client 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28dba9dc7e3df7c1eb507daca0c76c92ae3ee2022436ee3cca755ffacf4acf61
4
- data.tar.gz: 4e90cdd673cc3e978ba0c2846a2b8fe3e0b99c07bb34f94d716799a83b065a85
3
+ metadata.gz: 3db7dd4dfc1a4d262eee545f73ad09c0d5d679843d46fcb7640a51ad2158da1c
4
+ data.tar.gz: d23d5a0282ea6096f2475e6901cfe032f15f2aadcef061940ca98a2579f3d0ef
5
5
  SHA512:
6
- metadata.gz: 5a850b95b5b021522701c29bc8a0cb2cd70aa120ea0be2a6a05606d35e1a582c873878a5fe0300df090ec58a12cbe6f30c379167948a40a9b89b953d90e4901e
7
- data.tar.gz: f80bc788dc97f2c422336e607e092e1720cfa7bcbb0b20dbba5d341c154ee3e6e64af96c2f9070237a20d3d96db51e1337e533141f51105d77e3652031adce13
6
+ metadata.gz: bf4cbacf1c087a9579940172518d116c4f18de310c8d220b363a02795e90622ea90de409d943bfb3d65bd7a2bc61550bd93081371cc0a05a3786dbca6c437ebf
7
+ data.tar.gz: ebc8ad8bb08acb531dcfa26df3cb82cefa4743cf72c5dd6f7ec18c4ea037ae0ea661739f43fef3cfe6f66df259c75f7cfa196fcc98d94d5b139de68948d794dc
data/README.md CHANGED
@@ -9,7 +9,7 @@ Quake::Timesheets - the Ruby gem for the TimesheetsApi (params in:body)
9
9
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
10
10
 
11
11
  - API version: 1.0
12
- - Package version: 0.1.1
12
+ - Package version: 0.1.2
13
13
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
14
14
 
15
15
  ## Generating
@@ -37,16 +37,16 @@ gem build quake_timesheets_client.gemspec
37
37
  Then either install the gem locally:
38
38
 
39
39
  ```shell
40
- gem install ./quake_timesheets_client-0.1.1.gem
40
+ gem install ./quake_timesheets_client-0.1.2.gem
41
41
  ```
42
42
 
43
- (for development, run `gem install --dev ./quake_timesheets_client-0.1.1.gem` to install the development dependencies)
43
+ (for development, run `gem install --dev ./quake_timesheets_client-0.1.2.gem` to install the development dependencies)
44
44
 
45
45
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
46
46
 
47
47
  Finally add this to the Gemfile:
48
48
 
49
- gem 'quake_timesheets_client', '~> 0.1.1'
49
+ gem 'quake_timesheets_client', '~> 0.1.2'
50
50
 
51
51
  ### Install from Git
52
52
 
@@ -53,7 +53,7 @@ module Quake::Timesheets
53
53
  form_params = opts[:form_params] || {}
54
54
 
55
55
  # http body (model)
56
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_approval_types_input'])
56
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_approval_types_input'] || opts[:body])
57
57
 
58
58
  # return_type
59
59
  return_type = opts[:debug_return_type] || 'ApprovalType'
@@ -53,7 +53,7 @@ module Quake::Timesheets
53
53
  form_params = opts[:form_params] || {}
54
54
 
55
55
  # http body (model)
56
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_approvals_input'])
56
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_approvals_input'] || opts[:body])
57
57
 
58
58
  # return_type
59
59
  return_type = opts[:debug_return_type] || 'Approval'
@@ -53,7 +53,7 @@ module Quake::Timesheets
53
53
  form_params = opts[:form_params] || {}
54
54
 
55
55
  # http body (model)
56
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_datasets_input'])
56
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_datasets_input'] || opts[:body])
57
57
 
58
58
  # return_type
59
59
  return_type = opts[:debug_return_type] || 'Dataset'
@@ -53,7 +53,7 @@ module Quake::Timesheets
53
53
  form_params = opts[:form_params] || {}
54
54
 
55
55
  # http body (model)
56
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_entries_input'])
56
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_entries_input'] || opts[:body])
57
57
 
58
58
  # return_type
59
59
  return_type = opts[:debug_return_type] || 'Entry'
@@ -185,7 +185,7 @@ module Quake::Timesheets
185
185
  form_params = opts[:form_params] || {}
186
186
 
187
187
  # http body (model)
188
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_entries_input'])
188
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_entries_input'] || opts[:body])
189
189
 
190
190
  # return_type
191
191
  return_type = opts[:debug_return_type] || 'Entry'
@@ -53,7 +53,7 @@ module Quake::Timesheets
53
53
  form_params = opts[:form_params] || {}
54
54
 
55
55
  # http body (model)
56
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_people_input'])
56
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_people_input'] || opts[:body])
57
57
 
58
58
  # return_type
59
59
  return_type = opts[:debug_return_type] || 'Person'
@@ -20,5 +20,5 @@ OpenAPI Generator version: 5.1.0
20
20
  end
21
21
 
22
22
  module Quake::Timesheets
23
- VERSION = '0.1.1'
23
+ VERSION = '0.1.2'
24
24
  end
Binary file
@@ -0,0 +1,206 @@
1
+ =begin
2
+ {{> api_info}}
3
+ =end
4
+
5
+ require 'cgi'
6
+
7
+ module {{moduleName}}
8
+ {{#operations}}
9
+ class {{classname}}
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = ApiClient.default)
13
+ @api_client = api_client
14
+ end
15
+ {{#operation}}
16
+ {{#summary}}
17
+ # {{{summary}}}
18
+ {{/summary}}
19
+ {{#notes}}
20
+ # {{{notes}}}
21
+ {{/notes}}
22
+ {{#allParams}}{{#required}} # @param {{paramName}} [{{{dataType}}}] {{description}}
23
+ {{/required}}{{/allParams}} # @param [Hash] opts the optional parameters
24
+ {{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
25
+ {{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}]
26
+ def {{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
27
+ {{#returnType}}data, _status_code, _headers = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts)
28
+ {{#returnType}}data{{/returnType}}{{^returnType}}nil{{/returnType}}
29
+ end
30
+
31
+ {{#summary}}
32
+ # {{summary}}
33
+ {{/summary}}
34
+ {{#notes}}
35
+ # {{notes}}
36
+ {{/notes}}
37
+ {{#allParams}}{{#required}} # @param {{paramName}} [{{{dataType}}}] {{description}}
38
+ {{/required}}{{/allParams}} # @param [Hash] opts the optional parameters
39
+ {{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}}
40
+ {{/required}}{{/allParams}} # @return [Array<({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}, Integer, Hash)>] {{#returnType}}{{{returnType}}} data{{/returnType}}{{^returnType}}nil{{/returnType}}, response status code and response headers
41
+ def {{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: {{classname}}.{{operationId}} ...'
44
+ end
45
+ {{#allParams}}
46
+ {{^isNullable}}
47
+ {{#required}}
48
+ # verify the required parameter '{{paramName}}' is set
49
+ if @api_client.config.client_side_validation && {{{paramName}}}.nil?
50
+ fail ArgumentError, "Missing the required parameter '{{paramName}}' when calling {{classname}}.{{operationId}}"
51
+ end
52
+ {{#isEnum}}
53
+ {{^isContainer}}
54
+ # verify enum value
55
+ allowable_values = [{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]
56
+ if @api_client.config.client_side_validation && !allowable_values.include?({{{paramName}}})
57
+ fail ArgumentError, "invalid value for \"{{{paramName}}}\", must be one of #{allowable_values}"
58
+ end
59
+ {{/isContainer}}
60
+ {{/isEnum}}
61
+ {{/required}}
62
+ {{/isNullable}}
63
+ {{^required}}
64
+ {{#isEnum}}
65
+ {{#collectionFormat}}
66
+ allowable_values = [{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]
67
+ if @api_client.config.client_side_validation && opts[:'{{{paramName}}}'] && !opts[:'{{{paramName}}}'].all? { |item| allowable_values.include?(item) }
68
+ fail ArgumentError, "invalid value for \"{{{paramName}}}\", must include one of #{allowable_values}"
69
+ end
70
+ {{/collectionFormat}}
71
+ {{^collectionFormat}}
72
+ allowable_values = [{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]
73
+ if @api_client.config.client_side_validation && opts[:'{{{paramName}}}'] && !allowable_values.include?(opts[:'{{{paramName}}}'])
74
+ fail ArgumentError, "invalid value for \"{{{paramName}}}\", must be one of #{allowable_values}"
75
+ end
76
+ {{/collectionFormat}}
77
+ {{/isEnum}}
78
+ {{/required}}
79
+ {{#hasValidation}}
80
+ {{#maxLength}}
81
+ if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length > {{{maxLength}}}
82
+ fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be smaller than or equal to {{{maxLength}}}.'
83
+ end
84
+
85
+ {{/maxLength}}
86
+ {{#minLength}}
87
+ if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.to_s.length < {{{minLength}}}
88
+ fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, the character length must be great than or equal to {{{minLength}}}.'
89
+ end
90
+
91
+ {{/minLength}}
92
+ {{#maximum}}
93
+ if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
94
+ fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.'
95
+ end
96
+
97
+ {{/maximum}}
98
+ {{#minimum}}
99
+ if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}}
100
+ fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}.'
101
+ end
102
+
103
+ {{/minimum}}
104
+ {{#pattern}}
105
+ pattern = Regexp.new({{{pattern}}})
106
+ if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}} !~ pattern
107
+ fail ArgumentError, "invalid value for '{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:\"{{{paramName}}}\"]{{/required}}' when calling {{classname}}.{{operationId}}, must conform to the pattern #{pattern}."
108
+ end
109
+
110
+ {{/pattern}}
111
+ {{#maxItems}}
112
+ if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.length > {{{maxItems}}}
113
+ fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{{maxItems}}}.'
114
+ end
115
+
116
+ {{/maxItems}}
117
+ {{#minItems}}
118
+ if @api_client.config.client_side_validation && {{^required}}!opts[:'{{{paramName}}}'].nil? && {{/required}}{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}.length < {{{minItems}}}
119
+ fail ArgumentError, 'invalid value for "{{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:"{{{paramName}}}"]{{/required}}" when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{{minItems}}}.'
120
+ end
121
+
122
+ {{/minItems}}
123
+ {{/hasValidation}}
124
+ {{/allParams}}
125
+ # resource path
126
+ local_var_path = '{{{path}}}'{{#pathParams}}.sub('{' + '{{baseName}}' + '}', CGI.escape({{paramName}}.to_s){{^strictSpecBehavior}}.gsub('%2F', '/'){{/strictSpecBehavior}}){{/pathParams}}
127
+
128
+ # query parameters
129
+ query_params = opts[:query_params] || {}
130
+ {{#queryParams}}
131
+ {{#required}}
132
+ query_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}}
133
+ {{/required}}
134
+ {{/queryParams}}
135
+ {{#queryParams}}
136
+ {{^required}}
137
+ query_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if !opts[:'{{{paramName}}}'].nil?
138
+ {{/required}}
139
+ {{/queryParams}}
140
+
141
+ # header parameters
142
+ header_params = opts[:header_params] || {}
143
+ {{#hasProduces}}
144
+ # HTTP header 'Accept' (if needed)
145
+ header_params['Accept'] = @api_client.select_header_accept([{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}])
146
+ {{/hasProduces}}
147
+ {{#hasConsumes}}
148
+ # HTTP header 'Content-Type'
149
+ header_params['Content-Type'] = @api_client.select_header_content_type([{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}])
150
+ {{/hasConsumes}}
151
+ {{#headerParams}}
152
+ {{#required}}
153
+ header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}}
154
+ {{/required}}
155
+ {{/headerParams}}
156
+ {{#headerParams}}
157
+ {{^required}}
158
+ header_params[:'{{{baseName}}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if !opts[:'{{{paramName}}}'].nil?
159
+ {{/required}}
160
+ {{/headerParams}}
161
+
162
+ # form parameters
163
+ form_params = opts[:form_params] || {}
164
+ {{#formParams}}
165
+ {{#required}}
166
+ form_params['{{baseName}}'] = {{#collectionFormat}}@api_client.build_collection_param({{{paramName}}}, :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}}
167
+ {{/required}}
168
+ {{/formParams}}
169
+ {{#formParams}}
170
+ {{^required}}
171
+ form_params['{{baseName}}'] = {{#collectionFormat}}@api_client.build_collection_param(opts[:'{{{paramName}}}'], :{{{collectionFormat}}}){{/collectionFormat}}{{^collectionFormat}}opts[:'{{{paramName}}}']{{/collectionFormat}} if !opts[:'{{paramName}}'].nil?
172
+ {{/required}}
173
+ {{/formParams}}
174
+
175
+ # http body (model)
176
+ post_body = opts[:debug_body]{{#bodyParam}} || @api_client.object_to_http_body({{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}'] || opts[:body]{{/required}}){{/bodyParam}}
177
+
178
+ # return_type
179
+ return_type = opts[:debug_return_type]{{#returnType}} || '{{{returnType}}}'{{/returnType}}
180
+
181
+ # auth_names
182
+ auth_names = opts[:debug_auth_names] || [{{#authMethods}}'{{name}}'{{^-last}}, {{/-last}}{{/authMethods}}]
183
+
184
+ new_options = opts.merge(
185
+ :operation => :"{{classname}}.{{operationId}}",
186
+ :header_params => header_params,
187
+ :query_params => query_params,
188
+ :form_params => form_params,
189
+ :body => post_body,
190
+ :auth_names => auth_names,
191
+ :return_type => return_type
192
+ )
193
+
194
+ data, status_code, headers = @api_client.call_api(:{{httpMethod}}, local_var_path, new_options)
195
+ if @api_client.config.debugging
196
+ @api_client.config.logger.debug "API called: {{classname}}#{{operationId}}\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
197
+ end
198
+ return data, status_code, headers
199
+ end
200
+ {{^-last}}
201
+
202
+ {{/-last}}
203
+ {{/operation}}
204
+ end
205
+ {{/operations}}
206
+ end
data/ruby.config.yaml CHANGED
@@ -4,7 +4,7 @@ gemHomepage: https://www.quake.co.uk
4
4
  gemSummary: A client for the Quake Timesheets API
5
5
  gemDescription: Requires the Quake Timesheets system
6
6
  gemLicense: MIT
7
- gemVersion: 0.1.1
7
+ gemVersion: 0.1.2
8
8
  gemRequiredRubyVersion: ">= 2.7"
9
9
  library: faraday
10
10
  moduleName: Quake::Timesheets
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quake_timesheets_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -101,8 +101,10 @@ files:
101
101
  - lib/quake_timesheets_client/models/person.rb
102
102
  - lib/quake_timesheets_client/models/update_entries_input.rb
103
103
  - lib/quake_timesheets_client/version.rb
104
+ - quake_timesheets_client-0.1.1.gem
104
105
  - quake_timesheets_client.gemspec
105
106
  - ruby-templates/README.mustache
107
+ - ruby-templates/api.mustache
106
108
  - ruby-templates/api_client.mustache
107
109
  - ruby-templates/api_client_faraday_partial.mustache
108
110
  - ruby-templates/configuration.mustache