stackone_hris_client 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,362 @@
1
+ =begin
2
+ #StackOne Unified API
3
+
4
+ #The documentation for the StackOne Unified API
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module StackOneHrisClient
17
+ class ConnectSessionToken
18
+ attr_accessor :id
19
+
20
+ attr_accessor :organization_id
21
+
22
+ attr_accessor :project_id
23
+
24
+ attr_accessor :categories
25
+
26
+ attr_accessor :provider
27
+
28
+ attr_accessor :origin_owner_id
29
+
30
+ attr_accessor :origin_owner_name
31
+
32
+ attr_accessor :origin_username
33
+
34
+ attr_accessor :created_at
35
+
36
+ attr_accessor :token
37
+
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'id' => :'id',
64
+ :'organization_id' => :'organization_id',
65
+ :'project_id' => :'project_id',
66
+ :'categories' => :'categories',
67
+ :'provider' => :'provider',
68
+ :'origin_owner_id' => :'origin_owner_id',
69
+ :'origin_owner_name' => :'origin_owner_name',
70
+ :'origin_username' => :'origin_username',
71
+ :'created_at' => :'created_at',
72
+ :'token' => :'token'
73
+ }
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'id' => :'String',
85
+ :'organization_id' => :'String',
86
+ :'project_id' => :'String',
87
+ :'categories' => :'Array<String>',
88
+ :'provider' => :'String',
89
+ :'origin_owner_id' => :'String',
90
+ :'origin_owner_name' => :'String',
91
+ :'origin_username' => :'String',
92
+ :'created_at' => :'Time',
93
+ :'token' => :'String'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `StackOneHrisClient::ConnectSessionToken` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!self.class.attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `StackOneHrisClient::ConnectSessionToken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'id')
119
+ self.id = attributes[:'id']
120
+ end
121
+
122
+ if attributes.key?(:'organization_id')
123
+ self.organization_id = attributes[:'organization_id']
124
+ end
125
+
126
+ if attributes.key?(:'project_id')
127
+ self.project_id = attributes[:'project_id']
128
+ end
129
+
130
+ if attributes.key?(:'categories')
131
+ if (value = attributes[:'categories']).is_a?(Array)
132
+ self.categories = value
133
+ end
134
+ end
135
+
136
+ if attributes.key?(:'provider')
137
+ self.provider = attributes[:'provider']
138
+ end
139
+
140
+ if attributes.key?(:'origin_owner_id')
141
+ self.origin_owner_id = attributes[:'origin_owner_id']
142
+ end
143
+
144
+ if attributes.key?(:'origin_owner_name')
145
+ self.origin_owner_name = attributes[:'origin_owner_name']
146
+ end
147
+
148
+ if attributes.key?(:'origin_username')
149
+ self.origin_username = attributes[:'origin_username']
150
+ end
151
+
152
+ if attributes.key?(:'created_at')
153
+ self.created_at = attributes[:'created_at']
154
+ end
155
+
156
+ if attributes.key?(:'token')
157
+ self.token = attributes[:'token']
158
+ end
159
+ end
160
+
161
+ # Show invalid properties with the reasons. Usually used together with valid?
162
+ # @return Array for valid properties with the reasons
163
+ def list_invalid_properties
164
+ invalid_properties = Array.new
165
+ if @id.nil?
166
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
167
+ end
168
+
169
+ if @organization_id.nil?
170
+ invalid_properties.push('invalid value for "organization_id", organization_id cannot be nil.')
171
+ end
172
+
173
+ if @project_id.nil?
174
+ invalid_properties.push('invalid value for "project_id", project_id cannot be nil.')
175
+ end
176
+
177
+ if @provider.nil?
178
+ invalid_properties.push('invalid value for "provider", provider cannot be nil.')
179
+ end
180
+
181
+ if @origin_owner_id.nil?
182
+ invalid_properties.push('invalid value for "origin_owner_id", origin_owner_id cannot be nil.')
183
+ end
184
+
185
+ if @origin_owner_name.nil?
186
+ invalid_properties.push('invalid value for "origin_owner_name", origin_owner_name cannot be nil.')
187
+ end
188
+
189
+ if @created_at.nil?
190
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
191
+ end
192
+
193
+ if @token.nil?
194
+ invalid_properties.push('invalid value for "token", token cannot be nil.')
195
+ end
196
+
197
+ invalid_properties
198
+ end
199
+
200
+ # Check to see if the all the properties in the model are valid
201
+ # @return true if the model is valid
202
+ def valid?
203
+ return false if @id.nil?
204
+ return false if @organization_id.nil?
205
+ return false if @project_id.nil?
206
+ return false if @provider.nil?
207
+ return false if @origin_owner_id.nil?
208
+ return false if @origin_owner_name.nil?
209
+ return false if @created_at.nil?
210
+ return false if @token.nil?
211
+ true
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ id == o.id &&
220
+ organization_id == o.organization_id &&
221
+ project_id == o.project_id &&
222
+ categories == o.categories &&
223
+ provider == o.provider &&
224
+ origin_owner_id == o.origin_owner_id &&
225
+ origin_owner_name == o.origin_owner_name &&
226
+ origin_username == o.origin_username &&
227
+ created_at == o.created_at &&
228
+ token == o.token
229
+ end
230
+
231
+ # @see the `==` method
232
+ # @param [Object] Object to be compared
233
+ def eql?(o)
234
+ self == o
235
+ end
236
+
237
+ # Calculates hash code according to all attributes.
238
+ # @return [Integer] Hash code
239
+ def hash
240
+ [id, organization_id, project_id, categories, provider, origin_owner_id, origin_owner_name, origin_username, created_at, token].hash
241
+ end
242
+
243
+ # Builds the object from hash
244
+ # @param [Hash] attributes Model attributes in the form of hash
245
+ # @return [Object] Returns the model itself
246
+ def self.build_from_hash(attributes)
247
+ new.build_from_hash(attributes)
248
+ end
249
+
250
+ # Builds the object from hash
251
+ # @param [Hash] attributes Model attributes in the form of hash
252
+ # @return [Object] Returns the model itself
253
+ def build_from_hash(attributes)
254
+ return nil unless attributes.is_a?(Hash)
255
+ attributes = attributes.transform_keys(&:to_sym)
256
+ self.class.openapi_types.each_pair do |key, type|
257
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
258
+ self.send("#{key}=", nil)
259
+ elsif type =~ /\AArray<(.*)>/i
260
+ # check to ensure the input is an array given that the attribute
261
+ # is documented as an array but the input is not
262
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
263
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
264
+ end
265
+ elsif !attributes[self.class.attribute_map[key]].nil?
266
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
267
+ end
268
+ end
269
+
270
+ self
271
+ end
272
+
273
+ # Deserializes the data based on type
274
+ # @param string type Data type
275
+ # @param string value Value to be deserialized
276
+ # @return [Object] Deserialized data
277
+ def _deserialize(type, value)
278
+ case type.to_sym
279
+ when :Time
280
+ Time.parse(value)
281
+ when :Date
282
+ Date.parse(value)
283
+ when :String
284
+ value.to_s
285
+ when :Integer
286
+ value.to_i
287
+ when :Float
288
+ value.to_f
289
+ when :Boolean
290
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
291
+ true
292
+ else
293
+ false
294
+ end
295
+ when :Object
296
+ # generic object (usually a Hash), return directly
297
+ value
298
+ when /\AArray<(?<inner_type>.+)>\z/
299
+ inner_type = Regexp.last_match[:inner_type]
300
+ value.map { |v| _deserialize(inner_type, v) }
301
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
302
+ k_type = Regexp.last_match[:k_type]
303
+ v_type = Regexp.last_match[:v_type]
304
+ {}.tap do |hash|
305
+ value.each do |k, v|
306
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
307
+ end
308
+ end
309
+ else # model
310
+ # models (e.g. Pet) or oneOf
311
+ klass = StackOneHrisClient.const_get(type)
312
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
313
+ end
314
+ end
315
+
316
+ # Returns the string representation of the object
317
+ # @return [String] String presentation of the object
318
+ def to_s
319
+ to_hash.to_s
320
+ end
321
+
322
+ # to_body is an alias to to_hash (backward compatibility)
323
+ # @return [Hash] Returns the object in the form of hash
324
+ def to_body
325
+ to_hash
326
+ end
327
+
328
+ # Returns the object in the form of hash
329
+ # @return [Hash] Returns the object in the form of hash
330
+ def to_hash
331
+ hash = {}
332
+ self.class.attribute_map.each_pair do |attr, param|
333
+ value = self.send(attr)
334
+ if value.nil?
335
+ is_nullable = self.class.openapi_nullable.include?(attr)
336
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
337
+ end
338
+
339
+ hash[param] = _to_hash(value)
340
+ end
341
+ hash
342
+ end
343
+
344
+ # Outputs non-array value in the form of hash
345
+ # For object, use to_hash. Otherwise, just return the value
346
+ # @param [Object] value Any valid value
347
+ # @return [Hash] Returns the value in the form of hash
348
+ def _to_hash(value)
349
+ if value.is_a?(Array)
350
+ value.compact.map { |v| _to_hash(v) }
351
+ elsif value.is_a?(Hash)
352
+ {}.tap do |hash|
353
+ value.each { |k, v| hash[k] = _to_hash(v) }
354
+ end
355
+ elsif value.respond_to? :to_hash
356
+ value.to_hash
357
+ else
358
+ value
359
+ end
360
+ end
361
+ end
362
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.4.0
11
11
  =end
12
12
 
13
13
  module StackOneHrisClient
14
- VERSION = '1.0.0'
14
+ VERSION = '1.1.0'
15
15
  end
@@ -17,11 +17,18 @@ require 'stackone_hris_client/version'
17
17
  require 'stackone_hris_client/configuration'
18
18
 
19
19
  # Models
20
+ require 'stackone_hris_client/models/account'
21
+ require 'stackone_hris_client/models/connect_session'
22
+ require 'stackone_hris_client/models/connect_session_authenticate'
23
+ require 'stackone_hris_client/models/connect_session_create'
24
+ require 'stackone_hris_client/models/connect_session_token'
20
25
  require 'stackone_hris_client/models/employee'
21
26
  require 'stackone_hris_client/models/employee_result'
22
27
  require 'stackone_hris_client/models/employees_paginated'
23
28
 
24
29
  # APIs
30
+ require 'stackone_hris_client/api/accounts_api'
31
+ require 'stackone_hris_client/api/connect_sessions_api'
25
32
  require 'stackone_hris_client/api/employees_api'
26
33
 
27
34
  module StackOneHrisClient
@@ -0,0 +1,58 @@
1
+ =begin
2
+ #StackOne Unified API
3
+
4
+ #The documentation for the StackOne Unified API
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.4.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for StackOneHrisClient::AccountsApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'AccountsApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = StackOneHrisClient::AccountsApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of AccountsApi' do
30
+ it 'should create an instance of AccountsApi' do
31
+ expect(@api_instance).to be_instance_of(StackOneHrisClient::AccountsApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for accounts_get
36
+ #
37
+ # @param id
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Account]
40
+ describe 'accounts_get test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ # unit tests for accounts_list
47
+ #
48
+ # @param [Hash] opts the optional parameters
49
+ # @option opts [String] :provider The provider of the results to fetch
50
+ # @option opts [String] :origin_owner_id The origin owner identifier of the results to fetch
51
+ # @return [Array<Account>]
52
+ describe 'accounts_list test' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ end
@@ -0,0 +1,57 @@
1
+ =begin
2
+ #StackOne Unified API
3
+
4
+ #The documentation for the StackOne Unified API
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.4.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for StackOneHrisClient::ConnectSessionsApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'ConnectSessionsApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = StackOneHrisClient::ConnectSessionsApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of ConnectSessionsApi' do
30
+ it 'should create an instance of ConnectSessionsApi' do
31
+ expect(@api_instance).to be_instance_of(StackOneHrisClient::ConnectSessionsApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for connect_sessions_authenticate
36
+ #
37
+ # @param connect_session_authenticate The parameters to authenticate
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [ConnectSession]
40
+ describe 'connect_sessions_authenticate test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ # unit tests for connect_sessions_create
47
+ #
48
+ # @param connect_session_create
49
+ # @param [Hash] opts the optional parameters
50
+ # @return [ConnectSessionToken]
51
+ describe 'connect_sessions_create test' do
52
+ it 'should work' do
53
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
54
+ end
55
+ end
56
+
57
+ end
@@ -0,0 +1,76 @@
1
+ =begin
2
+ #StackOne Unified API
3
+
4
+ #The documentation for the StackOne Unified API
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.4.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for StackOneHrisClient::Account
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe StackOneHrisClient::Account do
21
+ let(:instance) { StackOneHrisClient::Account.new }
22
+
23
+ describe 'test an instance of Account' do
24
+ it 'should create an instance of Account' do
25
+ expect(instance).to be_instance_of(StackOneHrisClient::Account)
26
+ end
27
+ end
28
+ describe 'test attribute "id"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ describe 'test attribute "provider"' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
40
+ describe 'test attribute "origin_owner_id"' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ describe 'test attribute "origin_owner_name"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
+ end
50
+ end
51
+
52
+ describe 'test attribute "origin_username"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ describe 'test attribute "credentials"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
64
+ describe 'test attribute "created_at"' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ describe 'test attribute "updated_at"' do
71
+ it 'should work' do
72
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
73
+ end
74
+ end
75
+
76
+ end
@@ -0,0 +1,34 @@
1
+ =begin
2
+ #StackOne Unified API
3
+
4
+ #The documentation for the StackOne Unified API
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.4.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for StackOneHrisClient::ConnectSessionAuthenticate
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe StackOneHrisClient::ConnectSessionAuthenticate do
21
+ let(:instance) { StackOneHrisClient::ConnectSessionAuthenticate.new }
22
+
23
+ describe 'test an instance of ConnectSessionAuthenticate' do
24
+ it 'should create an instance of ConnectSessionAuthenticate' do
25
+ expect(instance).to be_instance_of(StackOneHrisClient::ConnectSessionAuthenticate)
26
+ end
27
+ end
28
+ describe 'test attribute "token"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ end
@@ -0,0 +1,68 @@
1
+ =begin
2
+ #StackOne Unified API
3
+
4
+ #The documentation for the StackOne Unified API
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.4.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for StackOneHrisClient::ConnectSessionCreate
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe StackOneHrisClient::ConnectSessionCreate do
21
+ let(:instance) { StackOneHrisClient::ConnectSessionCreate.new }
22
+
23
+ describe 'test an instance of ConnectSessionCreate' do
24
+ it 'should create an instance of ConnectSessionCreate' do
25
+ expect(instance).to be_instance_of(StackOneHrisClient::ConnectSessionCreate)
26
+ end
27
+ end
28
+ describe 'test attribute "categories"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["ats", "hris", "crm"])
32
+ # validator.allowable_values.each do |value|
33
+ # expect { instance.categories = value }.not_to raise_error
34
+ # end
35
+ end
36
+ end
37
+
38
+ describe 'test attribute "provider"' do
39
+ it 'should work' do
40
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
41
+ end
42
+ end
43
+
44
+ describe 'test attribute "origin_owner_id"' do
45
+ it 'should work' do
46
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
+ end
48
+ end
49
+
50
+ describe 'test attribute "origin_owner_name"' do
51
+ it 'should work' do
52
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
53
+ end
54
+ end
55
+
56
+ describe 'test attribute "origin_username"' do
57
+ it 'should work' do
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ end
60
+ end
61
+
62
+ describe 'test attribute "metadata"' do
63
+ it 'should work' do
64
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
65
+ end
66
+ end
67
+
68
+ end