authress-sdk 0.1.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/lib/swagger_client.rb +30 -0
  3. data/lib/swagger_client/api/access_records_api.rb +541 -0
  4. data/lib/swagger_client/api/accounts_api.rb +232 -0
  5. data/lib/swagger_client/api/metadata_api.rb +152 -0
  6. data/lib/swagger_client/api/resource_permissions_api.rb +250 -0
  7. data/lib/swagger_client/api/roles_api.rb +252 -0
  8. data/lib/swagger_client/api/service_clients_api.rb +418 -0
  9. data/lib/swagger_client/api/user_permissions_api.rb +340 -0
  10. data/lib/swagger_client/api_client.rb +388 -0
  11. data/lib/swagger_client/api_error.rb +57 -0
  12. data/lib/swagger_client/configuration.rb +205 -0
  13. data/lib/swagger_client/models/access_record.rb +351 -0
  14. data/lib/swagger_client/models/access_record_collection.rb +229 -0
  15. data/lib/swagger_client/models/access_record_collection_records.rb +351 -0
  16. data/lib/swagger_client/models/account.rb +268 -0
  17. data/lib/swagger_client/models/account_collection.rb +211 -0
  18. data/lib/swagger_client/models/account_collection_accounts.rb +268 -0
  19. data/lib/swagger_client/models/body.rb +236 -0
  20. data/lib/swagger_client/models/body_1.rb +229 -0
  21. data/lib/swagger_client/models/body_10.rb +246 -0
  22. data/lib/swagger_client/models/body_11.rb +246 -0
  23. data/lib/swagger_client/models/body_2.rb +213 -0
  24. data/lib/swagger_client/models/body_3.rb +351 -0
  25. data/lib/swagger_client/models/body_4.rb +351 -0
  26. data/lib/swagger_client/models/body_5.rb +225 -0
  27. data/lib/swagger_client/models/body_6.rb +255 -0
  28. data/lib/swagger_client/models/body_7.rb +255 -0
  29. data/lib/swagger_client/models/body_8.rb +227 -0
  30. data/lib/swagger_client/models/body_9.rb +223 -0
  31. data/lib/swagger_client/models/claim_request.rb +227 -0
  32. data/lib/swagger_client/models/claim_response.rb +197 -0
  33. data/lib/swagger_client/models/client.rb +246 -0
  34. data/lib/swagger_client/models/client_access_key.rb +242 -0
  35. data/lib/swagger_client/models/client_collection.rb +229 -0
  36. data/lib/swagger_client/models/client_collection_clients.rb +246 -0
  37. data/lib/swagger_client/models/identity.rb +228 -0
  38. data/lib/swagger_client/models/identity_collection.rb +213 -0
  39. data/lib/swagger_client/models/identity_collection_identities.rb +228 -0
  40. data/lib/swagger_client/models/identity_request.rb +223 -0
  41. data/lib/swagger_client/models/inline_response_200.rb +247 -0
  42. data/lib/swagger_client/models/inline_response_200_1.rb +236 -0
  43. data/lib/swagger_client/models/inline_response_200_10.rb +255 -0
  44. data/lib/swagger_client/models/inline_response_200_11.rb +211 -0
  45. data/lib/swagger_client/models/inline_response_200_12.rb +213 -0
  46. data/lib/swagger_client/models/inline_response_200_13.rb +229 -0
  47. data/lib/swagger_client/models/inline_response_200_14.rb +246 -0
  48. data/lib/swagger_client/models/inline_response_200_15.rb +242 -0
  49. data/lib/swagger_client/models/inline_response_200_2.rb +238 -0
  50. data/lib/swagger_client/models/inline_response_200_3.rb +260 -0
  51. data/lib/swagger_client/models/inline_response_200_4.rb +228 -0
  52. data/lib/swagger_client/models/inline_response_200_5.rb +213 -0
  53. data/lib/swagger_client/models/inline_response_200_6.rb +229 -0
  54. data/lib/swagger_client/models/inline_response_200_7.rb +229 -0
  55. data/lib/swagger_client/models/inline_response_200_8.rb +351 -0
  56. data/lib/swagger_client/models/inline_response_200_9.rb +268 -0
  57. data/lib/swagger_client/models/invite.rb +225 -0
  58. data/lib/swagger_client/models/link.rb +223 -0
  59. data/lib/swagger_client/models/metadata_object.rb +236 -0
  60. data/lib/swagger_client/models/permission_object.rb +258 -0
  61. data/lib/swagger_client/models/permission_response.rb +238 -0
  62. data/lib/swagger_client/models/resource_permission.rb +213 -0
  63. data/lib/swagger_client/models/resource_permission_collection.rb +228 -0
  64. data/lib/swagger_client/models/resource_permission_collection_links.rb +220 -0
  65. data/lib/swagger_client/models/resource_permission_collection_links_next.rb +223 -0
  66. data/lib/swagger_client/models/resource_permission_collection_resources.rb +213 -0
  67. data/lib/swagger_client/models/resource_users_collection.rb +229 -0
  68. data/lib/swagger_client/models/role.rb +255 -0
  69. data/lib/swagger_client/models/statement.rb +229 -0
  70. data/lib/swagger_client/models/token_request.rb +229 -0
  71. data/lib/swagger_client/models/user.rb +212 -0
  72. data/lib/swagger_client/models/user_resources.rb +247 -0
  73. data/lib/swagger_client/models/user_resources_resources.rb +207 -0
  74. data/lib/swagger_client/models/user_token.rb +260 -0
  75. data/lib/swagger_client/models/user_token_links.rb +211 -0
  76. data/lib/swagger_client/models/user_token_links_self.rb +223 -0
  77. data/lib/swagger_client/models/v1clients_options.rb +218 -0
  78. data/lib/swagger_client/models/v1records_account.rb +211 -0
  79. data/lib/swagger_client/models/v1records_links.rb +211 -0
  80. data/lib/swagger_client/models/v1records_links_self.rb +223 -0
  81. data/lib/swagger_client/models/v1records_users.rb +212 -0
  82. data/lib/swagger_client/models/v1resourcesresource_uri_permissions.rb +259 -0
  83. data/lib/swagger_client/models/v1roles_permissions.rb +258 -0
  84. data/lib/swagger_client/models/v1usersuser_idresourcesresource_urimetadata_account.rb +206 -0
  85. data/lib/swagger_client/models/v1usersuser_idtokens_resources.rb +212 -0
  86. data/lib/swagger_client/models/v1usersuser_idtokens_statements.rb +229 -0
  87. data/lib/swagger_client/version.rb +14 -0
  88. metadata +313 -0
@@ -0,0 +1,252 @@
1
+ =begin
2
+ #Authress
3
+
4
+ #<p> <h2>Authorization</h2> <p>Authorization for Authress is handled one of two different ways. Both mechanisms use oauth2 <i>Bearer</i> tokens.</p> <br> <h4>Identity Provider JWT</h4> <p>Hook up your preferred identity provider directly to Authress. Authress will verify JWTs sourced from that identify provider and allow direct integration with these APIs. Any OIDC JWT provider works, Google, Auth0, Okta, etc... With this mechanism your web app can make direct calls to the permissions API on behalf of your users. <br> <a href=\"https://authress.io/app/#/manage?focus=identity\">Link identity provider</a> </p> <br> <h4>Authress Clients</h4> <p>Regardless of using direct identity provider integration, with the API you can create Authress clients which can call any of the methods on the API. Your users won't be able to directly make API calls, all web app integrations must go through a service which stores the Authress private key. <br> <a href=\"https://authress.io/app/#/manage?focus=clients\">Create Authress service client</a> </p> <br> <h2>Usage</h2> <h4>Billable APIs</h4> <p>Most of the api available is completely free. Use it to populate your roles and configure your account. You'll only be charged for the ones marked as Billable.</p> <p><ul> <li><i class=\"far fa-fw fa-money-bill-alt text-primary\"></i> <span class=\"text-primary\">Billable</span> - <small>These APIs count as calls for your account and will be charged.</small></li> <li><i class=\"fas fa-fw fa-angle-double-right text-secondary\"></i> <span class=\"text-secondary\">Free</span> - <small>These are totally free.</small></li> <li><i class=\"fas fa-fw fa-balance-scale text-secondary\"></i> <span class=\"text-secondary\">Condition</span> - <small>Are conditionally free, see api methods for details.</small></li> </ul></p> <br> <h4>API Access</h4> <p>Access to the following APIs is based on Authress permissions, not the application permissions assigned in Authress to the application services. Each resource is tagged with the required permission <span class=\"badge badge-outline-secondary\">Action: Resource</span> </p>
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: support@authress.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.23
10
+ =end
11
+
12
+ module SwaggerClient
13
+ class RolesApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # Create a role.
20
+ # Creates a role with permissions. <br><span class=\"badge badge-outline-secondary\">CREATE: Authress:Roles</span>
21
+ # @param body
22
+ # @param [Hash] opts the optional parameters
23
+ # @return [InlineResponse20010]
24
+ def create_role(body, opts = {})
25
+ data, _status_code, _headers = create_role_with_http_info(body, opts)
26
+ data
27
+ end
28
+
29
+ # Create a role.
30
+ # Creates a role with permissions. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;CREATE: Authress:Roles&lt;/span&gt;
31
+ # @param body
32
+ # @param [Hash] opts the optional parameters
33
+ # @return [Array<(InlineResponse20010, Integer, Hash)>] InlineResponse20010 data, response status code and response headers
34
+ def create_role_with_http_info(body, opts = {})
35
+ if @api_client.config.debugging
36
+ @api_client.config.logger.debug 'Calling API: RolesApi.create_role ...'
37
+ end
38
+ # verify the required parameter 'body' is set
39
+ if @api_client.config.client_side_validation && body.nil?
40
+ fail ArgumentError, "Missing the required parameter 'body' when calling RolesApi.create_role"
41
+ end
42
+ # resource path
43
+ local_var_path = '/v1/roles'
44
+
45
+ # query parameters
46
+ query_params = opts[:query_params] || {}
47
+
48
+ # header parameters
49
+ header_params = opts[:header_params] || {}
50
+ # HTTP header 'Accept' (if needed)
51
+ header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
52
+ # HTTP header 'Content-Type'
53
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
54
+
55
+ # form parameters
56
+ form_params = opts[:form_params] || {}
57
+
58
+ # http body (model)
59
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
60
+
61
+ return_type = opts[:return_type] || 'InlineResponse20010'
62
+
63
+ auth_names = opts[:auth_names] || ['oauth2']
64
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => return_type)
71
+
72
+ if @api_client.config.debugging
73
+ @api_client.config.logger.debug "API called: RolesApi#create_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
+ end
75
+ return data, status_code, headers
76
+ end
77
+ # Deletes a role.
78
+ # Remove a role. If a record references the role, that record will not be modified. <br><span class=\"badge badge-outline-secondary\">UPDATE: Authress:Roles/{roleId}</span>
79
+ # @param role_id The identifier of the role.
80
+ # @param [Hash] opts the optional parameters
81
+ # @return [nil]
82
+ def delete_role(role_id, opts = {})
83
+ delete_role_with_http_info(role_id, opts)
84
+ nil
85
+ end
86
+
87
+ # Deletes a role.
88
+ # Remove a role. If a record references the role, that record will not be modified. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;UPDATE: Authress:Roles/{roleId}&lt;/span&gt;
89
+ # @param role_id The identifier of the role.
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
92
+ def delete_role_with_http_info(role_id, opts = {})
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug 'Calling API: RolesApi.delete_role ...'
95
+ end
96
+ # verify the required parameter 'role_id' is set
97
+ if @api_client.config.client_side_validation && role_id.nil?
98
+ fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.delete_role"
99
+ end
100
+ # resource path
101
+ local_var_path = '/v1/roles/{roleId}'.sub('{' + 'roleId' + '}', role_id.to_s)
102
+
103
+ # query parameters
104
+ query_params = opts[:query_params] || {}
105
+
106
+ # header parameters
107
+ header_params = opts[:header_params] || {}
108
+
109
+ # form parameters
110
+ form_params = opts[:form_params] || {}
111
+
112
+ # http body (model)
113
+ post_body = opts[:body]
114
+
115
+ return_type = opts[:return_type]
116
+
117
+ auth_names = opts[:auth_names] || ['oauth2']
118
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
119
+ :header_params => header_params,
120
+ :query_params => query_params,
121
+ :form_params => form_params,
122
+ :body => post_body,
123
+ :auth_names => auth_names,
124
+ :return_type => return_type)
125
+
126
+ if @api_client.config.debugging
127
+ @api_client.config.logger.debug "API called: RolesApi#delete_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
128
+ end
129
+ return data, status_code, headers
130
+ end
131
+ # Get a role.
132
+ # Roles contain a list of permissions that will be applied to any user or resource <br><span class=\"badge badge-outline-secondary\">READ: Authress:Roles/{roleId}</span>
133
+ # @param role_id The identifier of the role.
134
+ # @param [Hash] opts the optional parameters
135
+ # @return [InlineResponse20010]
136
+ def get_role(role_id, opts = {})
137
+ data, _status_code, _headers = get_role_with_http_info(role_id, opts)
138
+ data
139
+ end
140
+
141
+ # Get a role.
142
+ # Roles contain a list of permissions that will be applied to any user or resource &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;READ: Authress:Roles/{roleId}&lt;/span&gt;
143
+ # @param role_id The identifier of the role.
144
+ # @param [Hash] opts the optional parameters
145
+ # @return [Array<(InlineResponse20010, Integer, Hash)>] InlineResponse20010 data, response status code and response headers
146
+ def get_role_with_http_info(role_id, opts = {})
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug 'Calling API: RolesApi.get_role ...'
149
+ end
150
+ # verify the required parameter 'role_id' is set
151
+ if @api_client.config.client_side_validation && role_id.nil?
152
+ fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.get_role"
153
+ end
154
+ # resource path
155
+ local_var_path = '/v1/roles/{roleId}'.sub('{' + 'roleId' + '}', role_id.to_s)
156
+
157
+ # query parameters
158
+ query_params = opts[:query_params] || {}
159
+
160
+ # header parameters
161
+ header_params = opts[:header_params] || {}
162
+ # HTTP header 'Accept' (if needed)
163
+ header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
164
+
165
+ # form parameters
166
+ form_params = opts[:form_params] || {}
167
+
168
+ # http body (model)
169
+ post_body = opts[:body]
170
+
171
+ return_type = opts[:return_type] || 'InlineResponse20010'
172
+
173
+ auth_names = opts[:auth_names] || ['oauth2']
174
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
175
+ :header_params => header_params,
176
+ :query_params => query_params,
177
+ :form_params => form_params,
178
+ :body => post_body,
179
+ :auth_names => auth_names,
180
+ :return_type => return_type)
181
+
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug "API called: RolesApi#get_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
184
+ end
185
+ return data, status_code, headers
186
+ end
187
+ # Update a role.
188
+ # Updates a role adding or removing permissions. <br><span class=\"badge badge-outline-secondary\">UPDATE: Authress:Roles/{roleId}</span>
189
+ # @param body
190
+ # @param role_id The identifier of the role.
191
+ # @param [Hash] opts the optional parameters
192
+ # @return [InlineResponse20010]
193
+ def update_role(body, role_id, opts = {})
194
+ data, _status_code, _headers = update_role_with_http_info(body, role_id, opts)
195
+ data
196
+ end
197
+
198
+ # Update a role.
199
+ # Updates a role adding or removing permissions. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;UPDATE: Authress:Roles/{roleId}&lt;/span&gt;
200
+ # @param body
201
+ # @param role_id The identifier of the role.
202
+ # @param [Hash] opts the optional parameters
203
+ # @return [Array<(InlineResponse20010, Integer, Hash)>] InlineResponse20010 data, response status code and response headers
204
+ def update_role_with_http_info(body, role_id, opts = {})
205
+ if @api_client.config.debugging
206
+ @api_client.config.logger.debug 'Calling API: RolesApi.update_role ...'
207
+ end
208
+ # verify the required parameter 'body' is set
209
+ if @api_client.config.client_side_validation && body.nil?
210
+ fail ArgumentError, "Missing the required parameter 'body' when calling RolesApi.update_role"
211
+ end
212
+ # verify the required parameter 'role_id' is set
213
+ if @api_client.config.client_side_validation && role_id.nil?
214
+ fail ArgumentError, "Missing the required parameter 'role_id' when calling RolesApi.update_role"
215
+ end
216
+ # resource path
217
+ local_var_path = '/v1/roles/{roleId}'.sub('{' + 'roleId' + '}', role_id.to_s)
218
+
219
+ # query parameters
220
+ query_params = opts[:query_params] || {}
221
+
222
+ # header parameters
223
+ header_params = opts[:header_params] || {}
224
+ # HTTP header 'Accept' (if needed)
225
+ header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
226
+ # HTTP header 'Content-Type'
227
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
228
+
229
+ # form parameters
230
+ form_params = opts[:form_params] || {}
231
+
232
+ # http body (model)
233
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
234
+
235
+ return_type = opts[:return_type] || 'InlineResponse20010'
236
+
237
+ auth_names = opts[:auth_names] || ['oauth2']
238
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
239
+ :header_params => header_params,
240
+ :query_params => query_params,
241
+ :form_params => form_params,
242
+ :body => post_body,
243
+ :auth_names => auth_names,
244
+ :return_type => return_type)
245
+
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug "API called: RolesApi#update_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
248
+ end
249
+ return data, status_code, headers
250
+ end
251
+ end
252
+ end
@@ -0,0 +1,418 @@
1
+ =begin
2
+ #Authress
3
+
4
+ #<p> <h2>Authorization</h2> <p>Authorization for Authress is handled one of two different ways. Both mechanisms use oauth2 <i>Bearer</i> tokens.</p> <br> <h4>Identity Provider JWT</h4> <p>Hook up your preferred identity provider directly to Authress. Authress will verify JWTs sourced from that identify provider and allow direct integration with these APIs. Any OIDC JWT provider works, Google, Auth0, Okta, etc... With this mechanism your web app can make direct calls to the permissions API on behalf of your users. <br> <a href=\"https://authress.io/app/#/manage?focus=identity\">Link identity provider</a> </p> <br> <h4>Authress Clients</h4> <p>Regardless of using direct identity provider integration, with the API you can create Authress clients which can call any of the methods on the API. Your users won't be able to directly make API calls, all web app integrations must go through a service which stores the Authress private key. <br> <a href=\"https://authress.io/app/#/manage?focus=clients\">Create Authress service client</a> </p> <br> <h2>Usage</h2> <h4>Billable APIs</h4> <p>Most of the api available is completely free. Use it to populate your roles and configure your account. You'll only be charged for the ones marked as Billable.</p> <p><ul> <li><i class=\"far fa-fw fa-money-bill-alt text-primary\"></i> <span class=\"text-primary\">Billable</span> - <small>These APIs count as calls for your account and will be charged.</small></li> <li><i class=\"fas fa-fw fa-angle-double-right text-secondary\"></i> <span class=\"text-secondary\">Free</span> - <small>These are totally free.</small></li> <li><i class=\"fas fa-fw fa-balance-scale text-secondary\"></i> <span class=\"text-secondary\">Condition</span> - <small>Are conditionally free, see api methods for details.</small></li> </ul></p> <br> <h4>API Access</h4> <p>Access to the following APIs is based on Authress permissions, not the application permissions assigned in Authress to the application services. Each resource is tagged with the required permission <span class=\"badge badge-outline-secondary\">Action: Resource</span> </p>
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: support@authress.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.23
10
+ =end
11
+
12
+ module SwaggerClient
13
+ class ServiceClientsApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # Create a new client.
20
+ # Creates a service client to interact with Authress or any other service on behalf of users. Each client has secret private keys used to authenticate with Authress. To use service clients created through other mechanisms, skip creating a client and create access records with the client identifier. <br><span class=\"badge badge-outline-secondary\">CREATE: Authress:ServiceClients</span> or <span class=\"badge badge-outline-secondary\">RESOURCE CLAIM: Authress:ServiceClients</span>
21
+ # @param body
22
+ # @param [Hash] opts the optional parameters
23
+ # @return [InlineResponse20014]
24
+ def create_client(body, opts = {})
25
+ data, _status_code, _headers = create_client_with_http_info(body, opts)
26
+ data
27
+ end
28
+
29
+ # Create a new client.
30
+ # Creates a service client to interact with Authress or any other service on behalf of users. Each client has secret private keys used to authenticate with Authress. To use service clients created through other mechanisms, skip creating a client and create access records with the client identifier. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;CREATE: Authress:ServiceClients&lt;/span&gt; or &lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;RESOURCE CLAIM: Authress:ServiceClients&lt;/span&gt;
31
+ # @param body
32
+ # @param [Hash] opts the optional parameters
33
+ # @return [Array<(InlineResponse20014, Integer, Hash)>] InlineResponse20014 data, response status code and response headers
34
+ def create_client_with_http_info(body, opts = {})
35
+ if @api_client.config.debugging
36
+ @api_client.config.logger.debug 'Calling API: ServiceClientsApi.create_client ...'
37
+ end
38
+ # verify the required parameter 'body' is set
39
+ if @api_client.config.client_side_validation && body.nil?
40
+ fail ArgumentError, "Missing the required parameter 'body' when calling ServiceClientsApi.create_client"
41
+ end
42
+ # resource path
43
+ local_var_path = '/v1/clients'
44
+
45
+ # query parameters
46
+ query_params = opts[:query_params] || {}
47
+
48
+ # header parameters
49
+ header_params = opts[:header_params] || {}
50
+ # HTTP header 'Accept' (if needed)
51
+ header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
52
+ # HTTP header 'Content-Type'
53
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
54
+
55
+ # form parameters
56
+ form_params = opts[:form_params] || {}
57
+
58
+ # http body (model)
59
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
60
+
61
+ return_type = opts[:return_type] || 'InlineResponse20014'
62
+
63
+ auth_names = opts[:auth_names] || ['oauth2']
64
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => return_type)
71
+
72
+ if @api_client.config.debugging
73
+ @api_client.config.logger.debug "API called: ServiceClientsApi#create_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
+ end
75
+ return data, status_code, headers
76
+ end
77
+ # Remove an access key for a client.
78
+ # Deletes an access key for a client prevent it from being used to authenticate with Authress. <br><span class=\"badge badge-outline-secondary\">UPDATE: Authress:ServiceClients/{clientId}/access-keys/{keyId}</span>
79
+ # @param client_id The unique identifier of the client.
80
+ # @param key_id The id of the access key to remove from the client.
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [nil]
83
+ def delete_access_key(client_id, key_id, opts = {})
84
+ delete_access_key_with_http_info(client_id, key_id, opts)
85
+ nil
86
+ end
87
+
88
+ # Remove an access key for a client.
89
+ # Deletes an access key for a client prevent it from being used to authenticate with Authress. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;UPDATE: Authress:ServiceClients/{clientId}/access-keys/{keyId}&lt;/span&gt;
90
+ # @param client_id The unique identifier of the client.
91
+ # @param key_id The id of the access key to remove from the client.
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
94
+ def delete_access_key_with_http_info(client_id, key_id, opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: ServiceClientsApi.delete_access_key ...'
97
+ end
98
+ # verify the required parameter 'client_id' is set
99
+ if @api_client.config.client_side_validation && client_id.nil?
100
+ fail ArgumentError, "Missing the required parameter 'client_id' when calling ServiceClientsApi.delete_access_key"
101
+ end
102
+ # verify the required parameter 'key_id' is set
103
+ if @api_client.config.client_side_validation && key_id.nil?
104
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling ServiceClientsApi.delete_access_key"
105
+ end
106
+ # resource path
107
+ local_var_path = '/v1/clients/{clientId}/access-keys/{keyId}'.sub('{' + 'clientId' + '}', client_id.to_s).sub('{' + 'keyId' + '}', key_id.to_s)
108
+
109
+ # query parameters
110
+ query_params = opts[:query_params] || {}
111
+
112
+ # header parameters
113
+ header_params = opts[:header_params] || {}
114
+
115
+ # form parameters
116
+ form_params = opts[:form_params] || {}
117
+
118
+ # http body (model)
119
+ post_body = opts[:body]
120
+
121
+ return_type = opts[:return_type]
122
+
123
+ auth_names = opts[:auth_names] || ['oauth2']
124
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
125
+ :header_params => header_params,
126
+ :query_params => query_params,
127
+ :form_params => form_params,
128
+ :body => post_body,
129
+ :auth_names => auth_names,
130
+ :return_type => return_type)
131
+
132
+ if @api_client.config.debugging
133
+ @api_client.config.logger.debug "API called: ServiceClientsApi#delete_access_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
134
+ end
135
+ return data, status_code, headers
136
+ end
137
+ # Delete a client.
138
+ # This deletes the service client. <br><span class=\"badge badge-outline-secondary\">UPDATE: Authress:ServiceClients/{clientId}</span>
139
+ # @param client_id The unique identifier for the client.
140
+ # @param [Hash] opts the optional parameters
141
+ # @return [nil]
142
+ def delete_client(client_id, opts = {})
143
+ delete_client_with_http_info(client_id, opts)
144
+ nil
145
+ end
146
+
147
+ # Delete a client.
148
+ # This deletes the service client. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;UPDATE: Authress:ServiceClients/{clientId}&lt;/span&gt;
149
+ # @param client_id The unique identifier for the client.
150
+ # @param [Hash] opts the optional parameters
151
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
152
+ def delete_client_with_http_info(client_id, opts = {})
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug 'Calling API: ServiceClientsApi.delete_client ...'
155
+ end
156
+ # verify the required parameter 'client_id' is set
157
+ if @api_client.config.client_side_validation && client_id.nil?
158
+ fail ArgumentError, "Missing the required parameter 'client_id' when calling ServiceClientsApi.delete_client"
159
+ end
160
+ # resource path
161
+ local_var_path = '/v1/clients/{clientId}'.sub('{' + 'clientId' + '}', client_id.to_s)
162
+
163
+ # query parameters
164
+ query_params = opts[:query_params] || {}
165
+
166
+ # header parameters
167
+ header_params = opts[:header_params] || {}
168
+
169
+ # form parameters
170
+ form_params = opts[:form_params] || {}
171
+
172
+ # http body (model)
173
+ post_body = opts[:body]
174
+
175
+ return_type = opts[:return_type]
176
+
177
+ auth_names = opts[:auth_names] || ['oauth2']
178
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
179
+ :header_params => header_params,
180
+ :query_params => query_params,
181
+ :form_params => form_params,
182
+ :body => post_body,
183
+ :auth_names => auth_names,
184
+ :return_type => return_type)
185
+
186
+ if @api_client.config.debugging
187
+ @api_client.config.logger.debug "API called: ServiceClientsApi#delete_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
188
+ end
189
+ return data, status_code, headers
190
+ end
191
+ # Get a client.
192
+ # Returns all information related to client except for the private access keys. <br><span class=\"badge badge-outline-secondary\">READ: Authress:ServiceClients/{clientId}</span>
193
+ # @param client_id The unique identifier for the client.
194
+ # @param [Hash] opts the optional parameters
195
+ # @return [InlineResponse20014]
196
+ def get_client(client_id, opts = {})
197
+ data, _status_code, _headers = get_client_with_http_info(client_id, opts)
198
+ data
199
+ end
200
+
201
+ # Get a client.
202
+ # Returns all information related to client except for the private access keys. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;READ: Authress:ServiceClients/{clientId}&lt;/span&gt;
203
+ # @param client_id The unique identifier for the client.
204
+ # @param [Hash] opts the optional parameters
205
+ # @return [Array<(InlineResponse20014, Integer, Hash)>] InlineResponse20014 data, response status code and response headers
206
+ def get_client_with_http_info(client_id, opts = {})
207
+ if @api_client.config.debugging
208
+ @api_client.config.logger.debug 'Calling API: ServiceClientsApi.get_client ...'
209
+ end
210
+ # verify the required parameter 'client_id' is set
211
+ if @api_client.config.client_side_validation && client_id.nil?
212
+ fail ArgumentError, "Missing the required parameter 'client_id' when calling ServiceClientsApi.get_client"
213
+ end
214
+ # resource path
215
+ local_var_path = '/v1/clients/{clientId}'.sub('{' + 'clientId' + '}', client_id.to_s)
216
+
217
+ # query parameters
218
+ query_params = opts[:query_params] || {}
219
+
220
+ # header parameters
221
+ header_params = opts[:header_params] || {}
222
+ # HTTP header 'Accept' (if needed)
223
+ header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
224
+
225
+ # form parameters
226
+ form_params = opts[:form_params] || {}
227
+
228
+ # http body (model)
229
+ post_body = opts[:body]
230
+
231
+ return_type = opts[:return_type] || 'InlineResponse20014'
232
+
233
+ auth_names = opts[:auth_names] || ['oauth2']
234
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
235
+ :header_params => header_params,
236
+ :query_params => query_params,
237
+ :form_params => form_params,
238
+ :body => post_body,
239
+ :auth_names => auth_names,
240
+ :return_type => return_type)
241
+
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug "API called: ServiceClientsApi#get_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
244
+ end
245
+ return data, status_code, headers
246
+ end
247
+ # Get clients collection.
248
+ # Returns all clients that the user has access to in the account. <br><span class=\"badge badge-outline-secondary\">READ: Authress:ServiceClients/{clientId}</span>
249
+ # @param [Hash] opts the optional parameters
250
+ # @return [InlineResponse20013]
251
+ def get_clients(opts = {})
252
+ data, _status_code, _headers = get_clients_with_http_info(opts)
253
+ data
254
+ end
255
+
256
+ # Get clients collection.
257
+ # Returns all clients that the user has access to in the account. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;READ: Authress:ServiceClients/{clientId}&lt;/span&gt;
258
+ # @param [Hash] opts the optional parameters
259
+ # @return [Array<(InlineResponse20013, Integer, Hash)>] InlineResponse20013 data, response status code and response headers
260
+ def get_clients_with_http_info(opts = {})
261
+ if @api_client.config.debugging
262
+ @api_client.config.logger.debug 'Calling API: ServiceClientsApi.get_clients ...'
263
+ end
264
+ # resource path
265
+ local_var_path = '/v1/clients'
266
+
267
+ # query parameters
268
+ query_params = opts[:query_params] || {}
269
+
270
+ # header parameters
271
+ header_params = opts[:header_params] || {}
272
+ # HTTP header 'Accept' (if needed)
273
+ header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
274
+
275
+ # form parameters
276
+ form_params = opts[:form_params] || {}
277
+
278
+ # http body (model)
279
+ post_body = opts[:body]
280
+
281
+ return_type = opts[:return_type] || 'InlineResponse20013'
282
+
283
+ auth_names = opts[:auth_names] || ['oauth2']
284
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
285
+ :header_params => header_params,
286
+ :query_params => query_params,
287
+ :form_params => form_params,
288
+ :body => post_body,
289
+ :auth_names => auth_names,
290
+ :return_type => return_type)
291
+
292
+ if @api_client.config.debugging
293
+ @api_client.config.logger.debug "API called: ServiceClientsApi#get_clients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
294
+ end
295
+ return data, status_code, headers
296
+ end
297
+ # Request a new access key.
298
+ # Create a new access key for the client so that a service can authenticate with Authress as that client. Using the client will allow delegation of permission checking of users. <br><span class=\"badge badge-outline-secondary\">UPDATE: Authress:ServiceClients/{clientId}/access-keys</span>
299
+ # @param client_id The unique identifier of the client.
300
+ # @param [Hash] opts the optional parameters
301
+ # @return [InlineResponse20015]
302
+ def request_access_key(client_id, opts = {})
303
+ data, _status_code, _headers = request_access_key_with_http_info(client_id, opts)
304
+ data
305
+ end
306
+
307
+ # Request a new access key.
308
+ # Create a new access key for the client so that a service can authenticate with Authress as that client. Using the client will allow delegation of permission checking of users. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;UPDATE: Authress:ServiceClients/{clientId}/access-keys&lt;/span&gt;
309
+ # @param client_id The unique identifier of the client.
310
+ # @param [Hash] opts the optional parameters
311
+ # @return [Array<(InlineResponse20015, Integer, Hash)>] InlineResponse20015 data, response status code and response headers
312
+ def request_access_key_with_http_info(client_id, opts = {})
313
+ if @api_client.config.debugging
314
+ @api_client.config.logger.debug 'Calling API: ServiceClientsApi.request_access_key ...'
315
+ end
316
+ # verify the required parameter 'client_id' is set
317
+ if @api_client.config.client_side_validation && client_id.nil?
318
+ fail ArgumentError, "Missing the required parameter 'client_id' when calling ServiceClientsApi.request_access_key"
319
+ end
320
+ # resource path
321
+ local_var_path = '/v1/clients/{clientId}/access-keys'.sub('{' + 'clientId' + '}', client_id.to_s)
322
+
323
+ # query parameters
324
+ query_params = opts[:query_params] || {}
325
+
326
+ # header parameters
327
+ header_params = opts[:header_params] || {}
328
+ # HTTP header 'Accept' (if needed)
329
+ header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])
330
+
331
+ # form parameters
332
+ form_params = opts[:form_params] || {}
333
+
334
+ # http body (model)
335
+ post_body = opts[:body]
336
+
337
+ return_type = opts[:return_type] || 'InlineResponse20015'
338
+
339
+ auth_names = opts[:auth_names] || ['oauth2']
340
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
341
+ :header_params => header_params,
342
+ :query_params => query_params,
343
+ :form_params => form_params,
344
+ :body => post_body,
345
+ :auth_names => auth_names,
346
+ :return_type => return_type)
347
+
348
+ if @api_client.config.debugging
349
+ @api_client.config.logger.debug "API called: ServiceClientsApi#request_access_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
350
+ end
351
+ return data, status_code, headers
352
+ end
353
+ # Update a client.
354
+ # Updates a client information. <br><span class=\"badge badge-outline-secondary\">UPDATE: Authress:ServiceClients/{clientId}</span>
355
+ # @param body
356
+ # @param client_id The unique identifier for the client.
357
+ # @param [Hash] opts the optional parameters
358
+ # @return [InlineResponse20014]
359
+ def update_client(body, client_id, opts = {})
360
+ data, _status_code, _headers = update_client_with_http_info(body, client_id, opts)
361
+ data
362
+ end
363
+
364
+ # Update a client.
365
+ # Updates a client information. &lt;br&gt;&lt;span class&#x3D;\&quot;badge badge-outline-secondary\&quot;&gt;UPDATE: Authress:ServiceClients/{clientId}&lt;/span&gt;
366
+ # @param body
367
+ # @param client_id The unique identifier for the client.
368
+ # @param [Hash] opts the optional parameters
369
+ # @return [Array<(InlineResponse20014, Integer, Hash)>] InlineResponse20014 data, response status code and response headers
370
+ def update_client_with_http_info(body, client_id, opts = {})
371
+ if @api_client.config.debugging
372
+ @api_client.config.logger.debug 'Calling API: ServiceClientsApi.update_client ...'
373
+ end
374
+ # verify the required parameter 'body' is set
375
+ if @api_client.config.client_side_validation && body.nil?
376
+ fail ArgumentError, "Missing the required parameter 'body' when calling ServiceClientsApi.update_client"
377
+ end
378
+ # verify the required parameter 'client_id' is set
379
+ if @api_client.config.client_side_validation && client_id.nil?
380
+ fail ArgumentError, "Missing the required parameter 'client_id' when calling ServiceClientsApi.update_client"
381
+ end
382
+ # resource path
383
+ local_var_path = '/v1/clients/{clientId}'.sub('{' + 'clientId' + '}', client_id.to_s)
384
+
385
+ # query parameters
386
+ query_params = opts[:query_params] || {}
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/links+json'])
392
+ # HTTP header 'Content-Type'
393
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
394
+
395
+ # form parameters
396
+ form_params = opts[:form_params] || {}
397
+
398
+ # http body (model)
399
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
400
+
401
+ return_type = opts[:return_type] || 'InlineResponse20014'
402
+
403
+ auth_names = opts[:auth_names] || ['oauth2']
404
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
405
+ :header_params => header_params,
406
+ :query_params => query_params,
407
+ :form_params => form_params,
408
+ :body => post_body,
409
+ :auth_names => auth_names,
410
+ :return_type => return_type)
411
+
412
+ if @api_client.config.debugging
413
+ @api_client.config.logger.debug "API called: ServiceClientsApi#update_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
414
+ end
415
+ return data, status_code, headers
416
+ end
417
+ end
418
+ end