kinde_sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +15 -0
  3. data/Gemfile.lock +119 -0
  4. data/LICENSE +21 -0
  5. data/README.md +342 -0
  6. data/Rakefile +10 -0
  7. data/kinde_api/.gitignore +39 -0
  8. data/kinde_api/.rspec +2 -0
  9. data/kinde_api/README.md +103 -0
  10. data/kinde_api/docs/AddOrganizationUsers200Response.md +22 -0
  11. data/kinde_api/docs/AddOrganizationUsersRequest.md +18 -0
  12. data/kinde_api/docs/ApiResult.md +18 -0
  13. data/kinde_api/docs/ConnectedAppsAccessToken.md +20 -0
  14. data/kinde_api/docs/ConnectedAppsApi.md +219 -0
  15. data/kinde_api/docs/ConnectedAppsAuthUrl.md +20 -0
  16. data/kinde_api/docs/CreateOrganization201Response.md +20 -0
  17. data/kinde_api/docs/CreateOrganizationRequest.md +20 -0
  18. data/kinde_api/docs/CreateUser200Response.md +22 -0
  19. data/kinde_api/docs/CreateUserRequest.md +20 -0
  20. data/kinde_api/docs/CreateUserRequestIdentitiesInner.md +20 -0
  21. data/kinde_api/docs/CreateUserRequestIdentitiesInnerDetails.md +18 -0
  22. data/kinde_api/docs/CreateUserRequestProfile.md +20 -0
  23. data/kinde_api/docs/EnvironmentsApi.md +216 -0
  24. data/kinde_api/docs/Error.md +20 -0
  25. data/kinde_api/docs/ErrorResponse.md +18 -0
  26. data/kinde_api/docs/FeatureFlagsApi.md +239 -0
  27. data/kinde_api/docs/GetOrganizationUsers200Response.md +24 -0
  28. data/kinde_api/docs/GetOrganizations200Response.md +24 -0
  29. data/kinde_api/docs/GetUsers200Response.md +24 -0
  30. data/kinde_api/docs/OAuthApi.md +141 -0
  31. data/kinde_api/docs/Organization.md +22 -0
  32. data/kinde_api/docs/OrganizationUser.md +26 -0
  33. data/kinde_api/docs/OrganizationsApi.md +671 -0
  34. data/kinde_api/docs/RemoveOrganizationUsers200Response.md +20 -0
  35. data/kinde_api/docs/RemoveOrganizationUsersRequest.md +18 -0
  36. data/kinde_api/docs/SuccessResponse.md +20 -0
  37. data/kinde_api/docs/UpdateUserRequest.md +22 -0
  38. data/kinde_api/docs/User.md +28 -0
  39. data/kinde_api/docs/UserIdentity.md +20 -0
  40. data/kinde_api/docs/UserIdentityResult.md +20 -0
  41. data/kinde_api/docs/UserProfile.md +26 -0
  42. data/kinde_api/docs/UserProfileV2.md +30 -0
  43. data/kinde_api/docs/UsersApi.md +603 -0
  44. data/kinde_api/lib/kinde_api/api/connected_apps_api.rb +221 -0
  45. data/kinde_api/lib/kinde_api/api/environments_api.rb +212 -0
  46. data/kinde_api/lib/kinde_api/api/feature_flags_api.rb +309 -0
  47. data/kinde_api/lib/kinde_api/api/o_auth_api.rb +136 -0
  48. data/kinde_api/lib/kinde_api/api/organizations_api.rb +634 -0
  49. data/kinde_api/lib/kinde_api/api/users_api.rb +560 -0
  50. data/kinde_api/lib/kinde_api/api_client.rb +397 -0
  51. data/kinde_api/lib/kinde_api/api_error.rb +58 -0
  52. data/kinde_api/lib/kinde_api/configuration.rb +295 -0
  53. data/kinde_api/lib/kinde_api/models/add_organization_users200_response.rb +239 -0
  54. data/kinde_api/lib/kinde_api/models/add_organization_users_request.rb +220 -0
  55. data/kinde_api/lib/kinde_api/models/api_result.rb +218 -0
  56. data/kinde_api/lib/kinde_api/models/connected_apps_access_token.rb +228 -0
  57. data/kinde_api/lib/kinde_api/models/connected_apps_auth_url.rb +228 -0
  58. data/kinde_api/lib/kinde_api/models/create_organization201_response.rb +228 -0
  59. data/kinde_api/lib/kinde_api/models/create_organization_request.rb +252 -0
  60. data/kinde_api/lib/kinde_api/models/create_user200_response.rb +239 -0
  61. data/kinde_api/lib/kinde_api/models/create_user_request.rb +229 -0
  62. data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner.rb +228 -0
  63. data/kinde_api/lib/kinde_api/models/create_user_request_identities_inner_details.rb +219 -0
  64. data/kinde_api/lib/kinde_api/models/create_user_request_profile.rb +229 -0
  65. data/kinde_api/lib/kinde_api/models/error.rb +228 -0
  66. data/kinde_api/lib/kinde_api/models/error_response.rb +219 -0
  67. data/kinde_api/lib/kinde_api/models/get_organization_users200_response.rb +249 -0
  68. data/kinde_api/lib/kinde_api/models/get_organizations200_response.rb +249 -0
  69. data/kinde_api/lib/kinde_api/models/get_users200_response.rb +249 -0
  70. data/kinde_api/lib/kinde_api/models/organization.rb +235 -0
  71. data/kinde_api/lib/kinde_api/models/organization_user.rb +253 -0
  72. data/kinde_api/lib/kinde_api/models/remove_organization_users200_response.rb +228 -0
  73. data/kinde_api/lib/kinde_api/models/remove_organization_users_request.rb +220 -0
  74. data/kinde_api/lib/kinde_api/models/success_response.rb +226 -0
  75. data/kinde_api/lib/kinde_api/models/update_user_request.rb +238 -0
  76. data/kinde_api/lib/kinde_api/models/user.rb +269 -0
  77. data/kinde_api/lib/kinde_api/models/user_identity.rb +227 -0
  78. data/kinde_api/lib/kinde_api/models/user_identity_result.rb +229 -0
  79. data/kinde_api/lib/kinde_api/models/user_profile.rb +259 -0
  80. data/kinde_api/lib/kinde_api/models/user_profile_v2.rb +279 -0
  81. data/kinde_api/lib/kinde_api/version.rb +15 -0
  82. data/kinde_api/lib/kinde_api.rb +73 -0
  83. data/kinde_api/spec/api/connected_apps_api_spec.rb +72 -0
  84. data/kinde_api/spec/api/environments_api_spec.rb +71 -0
  85. data/kinde_api/spec/api/feature_flags_api_spec.rb +82 -0
  86. data/kinde_api/spec/api/o_auth_api_spec.rb +57 -0
  87. data/kinde_api/spec/api/organizations_api_spec.rb +154 -0
  88. data/kinde_api/spec/api/users_api_spec.rb +141 -0
  89. data/kinde_api/spec/api_client_spec.rb +229 -0
  90. data/kinde_api/spec/configuration_spec.rb +42 -0
  91. data/kinde_api/spec/models/add_organization_users200_response_spec.rb +46 -0
  92. data/kinde_api/spec/models/add_organization_users_request_spec.rb +34 -0
  93. data/kinde_api/spec/models/api_result_spec.rb +34 -0
  94. data/kinde_api/spec/models/connected_apps_access_token_spec.rb +40 -0
  95. data/kinde_api/spec/models/connected_apps_auth_url_spec.rb +40 -0
  96. data/kinde_api/spec/models/create_organization201_response_spec.rb +40 -0
  97. data/kinde_api/spec/models/create_organization_request_spec.rb +44 -0
  98. data/kinde_api/spec/models/create_user200_response_spec.rb +46 -0
  99. data/kinde_api/spec/models/create_user_request_identities_inner_details_spec.rb +34 -0
  100. data/kinde_api/spec/models/create_user_request_identities_inner_spec.rb +40 -0
  101. data/kinde_api/spec/models/create_user_request_profile_spec.rb +40 -0
  102. data/kinde_api/spec/models/create_user_request_spec.rb +40 -0
  103. data/kinde_api/spec/models/error_response_spec.rb +34 -0
  104. data/kinde_api/spec/models/error_spec.rb +40 -0
  105. data/kinde_api/spec/models/get_organization_users200_response_spec.rb +52 -0
  106. data/kinde_api/spec/models/get_organizations200_response_spec.rb +52 -0
  107. data/kinde_api/spec/models/get_users200_response_spec.rb +52 -0
  108. data/kinde_api/spec/models/organization_spec.rb +46 -0
  109. data/kinde_api/spec/models/organization_user_spec.rb +58 -0
  110. data/kinde_api/spec/models/remove_organization_users200_response_spec.rb +40 -0
  111. data/kinde_api/spec/models/remove_organization_users_request_spec.rb +34 -0
  112. data/kinde_api/spec/models/success_response_spec.rb +40 -0
  113. data/kinde_api/spec/models/update_user_request_spec.rb +46 -0
  114. data/kinde_api/spec/models/user_identity_result_spec.rb +40 -0
  115. data/kinde_api/spec/models/user_identity_spec.rb +40 -0
  116. data/kinde_api/spec/models/user_profile_spec.rb +58 -0
  117. data/kinde_api/spec/models/user_profile_v2_spec.rb +70 -0
  118. data/kinde_api/spec/models/user_spec.rb +64 -0
  119. data/kinde_api/spec/spec_helper.rb +111 -0
  120. data/kinde_sdk.gemspec +33 -0
  121. data/lib/kinde_sdk/client.rb +49 -0
  122. data/lib/kinde_sdk/configuration.rb +50 -0
  123. data/lib/kinde_sdk/version.rb +3 -0
  124. data/lib/kinde_sdk.rb +109 -0
  125. data/openapitools.json +7 -0
  126. data/spec/kinde_sdk_spec.rb +105 -0
  127. data/spec/spec_helper.rb +82 -0
  128. metadata +291 -0
@@ -0,0 +1,560 @@
1
+ =begin
2
+ #Kinde Management API
3
+
4
+ #Provides endpoints to manage your Kinde Businesses
5
+
6
+ The version of the OpenAPI document: 1
7
+ Contact: support@kinde.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.4.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module KindeApi
16
+ class UsersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Assign Users to an Organization
23
+ # Add existing users to an organization.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :code The organization's code.
26
+ # @option opts [AddOrganizationUsersRequest] :add_organization_users_request
27
+ # @return [AddOrganizationUsers200Response]
28
+ def add_organization_users(opts = {})
29
+ data, _status_code, _headers = add_organization_users_with_http_info(opts)
30
+ data
31
+ end
32
+
33
+ # Assign Users to an Organization
34
+ # Add existing users to an organization.
35
+ # @param [Hash] opts the optional parameters
36
+ # @option opts [String] :code The organization's code.
37
+ # @option opts [AddOrganizationUsersRequest] :add_organization_users_request
38
+ # @return [Array<(AddOrganizationUsers200Response, Integer, Hash)>] AddOrganizationUsers200Response data, response status code and response headers
39
+ def add_organization_users_with_http_info(opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: UsersApi.add_organization_users ...'
42
+ end
43
+ # resource path
44
+ local_var_path = '/api/v1/organization/users'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+ query_params[:'code'] = opts[:'code'] if !opts[:'code'].nil?
49
+
50
+ # header parameters
51
+ header_params = opts[:header_params] || {}
52
+ # HTTP header 'Accept' (if needed)
53
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
54
+ # HTTP header 'Content-Type'
55
+ content_type = @api_client.select_header_content_type(['application/json'])
56
+ if !content_type.nil?
57
+ header_params['Content-Type'] = content_type
58
+ end
59
+
60
+ # form parameters
61
+ form_params = opts[:form_params] || {}
62
+
63
+ # http body (model)
64
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'add_organization_users_request'])
65
+
66
+ # return_type
67
+ return_type = opts[:debug_return_type] || 'AddOrganizationUsers200Response'
68
+
69
+ # auth_names
70
+ auth_names = opts[:debug_auth_names] || ['kindeBearerAuth']
71
+
72
+ new_options = opts.merge(
73
+ :operation => :"UsersApi.add_organization_users",
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names,
79
+ :return_type => return_type
80
+ )
81
+
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: UsersApi#add_organization_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
89
+ # Create User
90
+ # Creates a user record and optionally zero or more identities for the user. An example identity could be the email address of the user.
91
+ # @param [Hash] opts the optional parameters
92
+ # @option opts [CreateUserRequest] :create_user_request The details of the user to create.
93
+ # @return [CreateUser200Response]
94
+ def create_user(opts = {})
95
+ data, _status_code, _headers = create_user_with_http_info(opts)
96
+ data
97
+ end
98
+
99
+ # Create User
100
+ # Creates a user record and optionally zero or more identities for the user. An example identity could be the email address of the user.
101
+ # @param [Hash] opts the optional parameters
102
+ # @option opts [CreateUserRequest] :create_user_request The details of the user to create.
103
+ # @return [Array<(CreateUser200Response, Integer, Hash)>] CreateUser200Response data, response status code and response headers
104
+ def create_user_with_http_info(opts = {})
105
+ if @api_client.config.debugging
106
+ @api_client.config.logger.debug 'Calling API: UsersApi.create_user ...'
107
+ end
108
+ # resource path
109
+ local_var_path = '/api/v1/user'
110
+
111
+ # query parameters
112
+ query_params = opts[:query_params] || {}
113
+
114
+ # header parameters
115
+ header_params = opts[:header_params] || {}
116
+ # HTTP header 'Accept' (if needed)
117
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
118
+ # HTTP header 'Content-Type'
119
+ content_type = @api_client.select_header_content_type(['application/json'])
120
+ if !content_type.nil?
121
+ header_params['Content-Type'] = content_type
122
+ end
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_user_request'])
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type] || 'CreateUser200Response'
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['kindeBearerAuth']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"UsersApi.create_user",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: UsersApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # Delete User
154
+ # Delete a user record.
155
+ # @param [Hash] opts the optional parameters
156
+ # @option opts [String] :id The user&#39;s id.
157
+ # @return [SuccessResponse]
158
+ def deleteuser(opts = {})
159
+ data, _status_code, _headers = deleteuser_with_http_info(opts)
160
+ data
161
+ end
162
+
163
+ # Delete User
164
+ # Delete a user record.
165
+ # @param [Hash] opts the optional parameters
166
+ # @option opts [String] :id The user&#39;s id.
167
+ # @return [Array<(SuccessResponse, Integer, Hash)>] SuccessResponse data, response status code and response headers
168
+ def deleteuser_with_http_info(opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: UsersApi.deleteuser ...'
171
+ end
172
+ # resource path
173
+ local_var_path = '/api/v1/user'
174
+
175
+ # query parameters
176
+ query_params = opts[:query_params] || {}
177
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
178
+
179
+ # header parameters
180
+ header_params = opts[:header_params] || {}
181
+ # HTTP header 'Accept' (if needed)
182
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
183
+
184
+ # form parameters
185
+ form_params = opts[:form_params] || {}
186
+
187
+ # http body (model)
188
+ post_body = opts[:debug_body]
189
+
190
+ # return_type
191
+ return_type = opts[:debug_return_type] || 'SuccessResponse'
192
+
193
+ # auth_names
194
+ auth_names = opts[:debug_auth_names] || ['kindeBearerAuth']
195
+
196
+ new_options = opts.merge(
197
+ :operation => :"UsersApi.deleteuser",
198
+ :header_params => header_params,
199
+ :query_params => query_params,
200
+ :form_params => form_params,
201
+ :body => post_body,
202
+ :auth_names => auth_names,
203
+ :return_type => return_type
204
+ )
205
+
206
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
207
+ if @api_client.config.debugging
208
+ @api_client.config.logger.debug "API called: UsersApi#deleteuser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
209
+ end
210
+ return data, status_code, headers
211
+ end
212
+
213
+ # List Organization Users
214
+ # Get users in an organization.
215
+ # @param [Hash] opts the optional parameters
216
+ # @option opts [String] :sort Field and order to sort the result by.
217
+ # @option opts [Integer] :page_size Number of results per page. Defaults to 10 if parameter not sent.
218
+ # @option opts [String] :next_token A string to get the next page of results if there are more results.
219
+ # @option opts [String] :code The organization&#39;s code.
220
+ # @option opts [String] :permissions Filter by user permissions
221
+ # @return [GetOrganizationUsers200Response]
222
+ def get_organization_users(opts = {})
223
+ data, _status_code, _headers = get_organization_users_with_http_info(opts)
224
+ data
225
+ end
226
+
227
+ # List Organization Users
228
+ # Get users in an organization.
229
+ # @param [Hash] opts the optional parameters
230
+ # @option opts [String] :sort Field and order to sort the result by.
231
+ # @option opts [Integer] :page_size Number of results per page. Defaults to 10 if parameter not sent.
232
+ # @option opts [String] :next_token A string to get the next page of results if there are more results.
233
+ # @option opts [String] :code The organization&#39;s code.
234
+ # @option opts [String] :permissions Filter by user permissions
235
+ # @return [Array<(GetOrganizationUsers200Response, Integer, Hash)>] GetOrganizationUsers200Response data, response status code and response headers
236
+ def get_organization_users_with_http_info(opts = {})
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug 'Calling API: UsersApi.get_organization_users ...'
239
+ end
240
+ allowable_values = ["name_asc", "name_desc", "email_asc", "email_desc"]
241
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
242
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
243
+ end
244
+ # resource path
245
+ local_var_path = '/api/v1/organization/users'
246
+
247
+ # query parameters
248
+ query_params = opts[:query_params] || {}
249
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
250
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
251
+ query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?
252
+ query_params[:'code'] = opts[:'code'] if !opts[:'code'].nil?
253
+ query_params[:'permissions'] = opts[:'permissions'] if !opts[:'permissions'].nil?
254
+
255
+ # header parameters
256
+ header_params = opts[:header_params] || {}
257
+ # HTTP header 'Accept' (if needed)
258
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
259
+
260
+ # form parameters
261
+ form_params = opts[:form_params] || {}
262
+
263
+ # http body (model)
264
+ post_body = opts[:debug_body]
265
+
266
+ # return_type
267
+ return_type = opts[:debug_return_type] || 'GetOrganizationUsers200Response'
268
+
269
+ # auth_names
270
+ auth_names = opts[:debug_auth_names] || ['kindeBearerAuth']
271
+
272
+ new_options = opts.merge(
273
+ :operation => :"UsersApi.get_organization_users",
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => return_type
280
+ )
281
+
282
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
283
+ if @api_client.config.debugging
284
+ @api_client.config.logger.debug "API called: UsersApi#get_organization_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
285
+ end
286
+ return data, status_code, headers
287
+ end
288
+
289
+ # Get User
290
+ # Retrieve a user record.
291
+ # @param [Hash] opts the optional parameters
292
+ # @option opts [String] :id The user&#39;s id.
293
+ # @return [User]
294
+ def get_user_data(opts = {})
295
+ data, _status_code, _headers = get_user_data_with_http_info(opts)
296
+ data
297
+ end
298
+
299
+ # Get User
300
+ # Retrieve a user record.
301
+ # @param [Hash] opts the optional parameters
302
+ # @option opts [String] :id The user&#39;s id.
303
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
304
+ def get_user_data_with_http_info(opts = {})
305
+ if @api_client.config.debugging
306
+ @api_client.config.logger.debug 'Calling API: UsersApi.get_user_data ...'
307
+ end
308
+ # resource path
309
+ local_var_path = '/api/v1/user'
310
+
311
+ # query parameters
312
+ query_params = opts[:query_params] || {}
313
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
314
+
315
+ # header parameters
316
+ header_params = opts[:header_params] || {}
317
+ # HTTP header 'Accept' (if needed)
318
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
319
+
320
+ # form parameters
321
+ form_params = opts[:form_params] || {}
322
+
323
+ # http body (model)
324
+ post_body = opts[:debug_body]
325
+
326
+ # return_type
327
+ return_type = opts[:debug_return_type] || 'User'
328
+
329
+ # auth_names
330
+ auth_names = opts[:debug_auth_names] || ['kindeBearerAuth']
331
+
332
+ new_options = opts.merge(
333
+ :operation => :"UsersApi.get_user_data",
334
+ :header_params => header_params,
335
+ :query_params => query_params,
336
+ :form_params => form_params,
337
+ :body => post_body,
338
+ :auth_names => auth_names,
339
+ :return_type => return_type
340
+ )
341
+
342
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
343
+ if @api_client.config.debugging
344
+ @api_client.config.logger.debug "API called: UsersApi#get_user_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
345
+ end
346
+ return data, status_code, headers
347
+ end
348
+
349
+ # List Users
350
+ # The returned list can be sorted by full name or email address in ascending or descending order. The number of records to return at a time can also be controlled using the `page_size` query string parameter.
351
+ # @param [Hash] opts the optional parameters
352
+ # @option opts [String] :sort Field and order to sort the result by.
353
+ # @option opts [Integer] :page_size Number of results per page. Defaults to 10 if parameter not sent.
354
+ # @option opts [String] :user_id ID of the user to filter by.
355
+ # @option opts [String] :next_token A string to get the next page of results if there are more results.
356
+ # @return [GetUsers200Response]
357
+ def get_users(opts = {})
358
+ data, _status_code, _headers = get_users_with_http_info(opts)
359
+ data
360
+ end
361
+
362
+ # List Users
363
+ # The returned list can be sorted by full name or email address in ascending or descending order. The number of records to return at a time can also be controlled using the &#x60;page_size&#x60; query string parameter.
364
+ # @param [Hash] opts the optional parameters
365
+ # @option opts [String] :sort Field and order to sort the result by.
366
+ # @option opts [Integer] :page_size Number of results per page. Defaults to 10 if parameter not sent.
367
+ # @option opts [String] :user_id ID of the user to filter by.
368
+ # @option opts [String] :next_token A string to get the next page of results if there are more results.
369
+ # @return [Array<(GetUsers200Response, Integer, Hash)>] GetUsers200Response data, response status code and response headers
370
+ def get_users_with_http_info(opts = {})
371
+ if @api_client.config.debugging
372
+ @api_client.config.logger.debug 'Calling API: UsersApi.get_users ...'
373
+ end
374
+ allowable_values = ["name_asc", "name_desc", "email_asc", "email_desc"]
375
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
376
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
377
+ end
378
+ # resource path
379
+ local_var_path = '/api/v1/users'
380
+
381
+ # query parameters
382
+ query_params = opts[:query_params] || {}
383
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
384
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
385
+ query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil?
386
+ query_params[:'next_token'] = opts[:'next_token'] if !opts[:'next_token'].nil?
387
+
388
+ # header parameters
389
+ header_params = opts[:header_params] || {}
390
+ # HTTP header 'Accept' (if needed)
391
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
392
+
393
+ # form parameters
394
+ form_params = opts[:form_params] || {}
395
+
396
+ # http body (model)
397
+ post_body = opts[:debug_body]
398
+
399
+ # return_type
400
+ return_type = opts[:debug_return_type] || 'GetUsers200Response'
401
+
402
+ # auth_names
403
+ auth_names = opts[:debug_auth_names] || ['kindeBearerAuth']
404
+
405
+ new_options = opts.merge(
406
+ :operation => :"UsersApi.get_users",
407
+ :header_params => header_params,
408
+ :query_params => query_params,
409
+ :form_params => form_params,
410
+ :body => post_body,
411
+ :auth_names => auth_names,
412
+ :return_type => return_type
413
+ )
414
+
415
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
416
+ if @api_client.config.debugging
417
+ @api_client.config.logger.debug "API called: UsersApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
418
+ end
419
+ return data, status_code, headers
420
+ end
421
+
422
+ # Remove Users from an Organization
423
+ # Remove existing users from an organization.
424
+ # @param [Hash] opts the optional parameters
425
+ # @option opts [String] :code The organization&#39;s code.
426
+ # @option opts [RemoveOrganizationUsersRequest] :remove_organization_users_request
427
+ # @return [RemoveOrganizationUsers200Response]
428
+ def remove_organization_users(opts = {})
429
+ data, _status_code, _headers = remove_organization_users_with_http_info(opts)
430
+ data
431
+ end
432
+
433
+ # Remove Users from an Organization
434
+ # Remove existing users from an organization.
435
+ # @param [Hash] opts the optional parameters
436
+ # @option opts [String] :code The organization&#39;s code.
437
+ # @option opts [RemoveOrganizationUsersRequest] :remove_organization_users_request
438
+ # @return [Array<(RemoveOrganizationUsers200Response, Integer, Hash)>] RemoveOrganizationUsers200Response data, response status code and response headers
439
+ def remove_organization_users_with_http_info(opts = {})
440
+ if @api_client.config.debugging
441
+ @api_client.config.logger.debug 'Calling API: UsersApi.remove_organization_users ...'
442
+ end
443
+ # resource path
444
+ local_var_path = '/api/v1/organization/users'
445
+
446
+ # query parameters
447
+ query_params = opts[:query_params] || {}
448
+ query_params[:'code'] = opts[:'code'] if !opts[:'code'].nil?
449
+
450
+ # header parameters
451
+ header_params = opts[:header_params] || {}
452
+ # HTTP header 'Accept' (if needed)
453
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
454
+ # HTTP header 'Content-Type'
455
+ content_type = @api_client.select_header_content_type(['application/json'])
456
+ if !content_type.nil?
457
+ header_params['Content-Type'] = content_type
458
+ end
459
+
460
+ # form parameters
461
+ form_params = opts[:form_params] || {}
462
+
463
+ # http body (model)
464
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'remove_organization_users_request'])
465
+
466
+ # return_type
467
+ return_type = opts[:debug_return_type] || 'RemoveOrganizationUsers200Response'
468
+
469
+ # auth_names
470
+ auth_names = opts[:debug_auth_names] || ['kindeBearerAuth']
471
+
472
+ new_options = opts.merge(
473
+ :operation => :"UsersApi.remove_organization_users",
474
+ :header_params => header_params,
475
+ :query_params => query_params,
476
+ :form_params => form_params,
477
+ :body => post_body,
478
+ :auth_names => auth_names,
479
+ :return_type => return_type
480
+ )
481
+
482
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
483
+ if @api_client.config.debugging
484
+ @api_client.config.logger.debug "API called: UsersApi#remove_organization_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
485
+ end
486
+ return data, status_code, headers
487
+ end
488
+
489
+ # Update User
490
+ # Update a user record.
491
+ # @param update_user_request [UpdateUserRequest] The user to update.
492
+ # @param [Hash] opts the optional parameters
493
+ # @option opts [String] :id The user&#39;s id.
494
+ # @return [User]
495
+ def update_user(update_user_request, opts = {})
496
+ data, _status_code, _headers = update_user_with_http_info(update_user_request, opts)
497
+ data
498
+ end
499
+
500
+ # Update User
501
+ # Update a user record.
502
+ # @param update_user_request [UpdateUserRequest] The user to update.
503
+ # @param [Hash] opts the optional parameters
504
+ # @option opts [String] :id The user&#39;s id.
505
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
506
+ def update_user_with_http_info(update_user_request, opts = {})
507
+ if @api_client.config.debugging
508
+ @api_client.config.logger.debug 'Calling API: UsersApi.update_user ...'
509
+ end
510
+ # verify the required parameter 'update_user_request' is set
511
+ if @api_client.config.client_side_validation && update_user_request.nil?
512
+ fail ArgumentError, "Missing the required parameter 'update_user_request' when calling UsersApi.update_user"
513
+ end
514
+ # resource path
515
+ local_var_path = '/api/v1/user'
516
+
517
+ # query parameters
518
+ query_params = opts[:query_params] || {}
519
+ query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
520
+
521
+ # header parameters
522
+ header_params = opts[:header_params] || {}
523
+ # HTTP header 'Accept' (if needed)
524
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
525
+ # HTTP header 'Content-Type'
526
+ content_type = @api_client.select_header_content_type(['application/json'])
527
+ if !content_type.nil?
528
+ header_params['Content-Type'] = content_type
529
+ end
530
+
531
+ # form parameters
532
+ form_params = opts[:form_params] || {}
533
+
534
+ # http body (model)
535
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user_request)
536
+
537
+ # return_type
538
+ return_type = opts[:debug_return_type] || 'User'
539
+
540
+ # auth_names
541
+ auth_names = opts[:debug_auth_names] || ['kindeBearerAuth']
542
+
543
+ new_options = opts.merge(
544
+ :operation => :"UsersApi.update_user",
545
+ :header_params => header_params,
546
+ :query_params => query_params,
547
+ :form_params => form_params,
548
+ :body => post_body,
549
+ :auth_names => auth_names,
550
+ :return_type => return_type
551
+ )
552
+
553
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
554
+ if @api_client.config.debugging
555
+ @api_client.config.logger.debug "API called: UsersApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
556
+ end
557
+ return data, status_code, headers
558
+ end
559
+ end
560
+ end