Class: Zyphr::AuthOAuthApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zyphr/api/auth_o_auth_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AuthOAuthApi

Returns a new instance of AuthOAuthApi.



19
20
21
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#disconnect_o_auth_provider(provider, opts = {}) ⇒ SuccessResult

Disconnect OAuth provider Disconnect an OAuth provider from the current user.

Parameters:

  • provider (String)

    OAuth provider name

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 27

def disconnect_o_auth_provider(provider, opts = {})
  data, _status_code, _headers = disconnect_o_auth_provider_with_http_info(provider, opts)
  data
end

#disconnect_o_auth_provider_with_http_info(provider, opts = {}) ⇒ Array<(SuccessResult, Integer, Hash)>

Disconnect OAuth provider Disconnect an OAuth provider from the current user.

Parameters:

  • provider (String)

    OAuth provider name

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SuccessResult, Integer, Hash)>)

    SuccessResult data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 37

def disconnect_o_auth_provider_with_http_info(provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthOAuthApi.disconnect_o_auth_provider ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.disconnect_o_auth_provider"
  end
  # resource path
  local_var_path = '/auth/oauth/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SuccessResult'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey']

  new_options = opts.merge(
    :operation => :"AuthOAuthApi.disconnect_o_auth_provider",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthOAuthApi#disconnect_o_auth_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_o_auth_authorization_url(provider, redirect_uri, opts = {}) ⇒ OAuthAuthorizationUrlResponse

Get OAuth authorization URL Generate an OAuth authorization URL for the specified provider.

Parameters:

  • provider (String)

    OAuth provider name

  • redirect_uri (String)

    Redirect URI after authorization

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



91
92
93
94
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 91

def get_o_auth_authorization_url(provider, redirect_uri, opts = {})
  data, _status_code, _headers = get_o_auth_authorization_url_with_http_info(provider, redirect_uri, opts)
  data
end

#get_o_auth_authorization_url_with_http_info(provider, redirect_uri, opts = {}) ⇒ Array<(OAuthAuthorizationUrlResponse, Integer, Hash)>

Get OAuth authorization URL Generate an OAuth authorization URL for the specified provider.

Parameters:

  • provider (String)

    OAuth provider name

  • redirect_uri (String)

    Redirect URI after authorization

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 102

def get_o_auth_authorization_url_with_http_info(provider, redirect_uri, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthOAuthApi.get_o_auth_authorization_url ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.get_o_auth_authorization_url"
  end
  # verify the required parameter 'redirect_uri' is set
  if @api_client.config.client_side_validation && redirect_uri.nil?
    fail ArgumentError, "Missing the required parameter 'redirect_uri' when calling AuthOAuthApi.get_o_auth_authorization_url"
  end
  # resource path
  local_var_path = '/auth/oauth/{provider}/authorize'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'redirect_uri'] = redirect_uri

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OAuthAuthorizationUrlResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApplicationPublicKey']

  new_options = opts.merge(
    :operation => :"AuthOAuthApi.get_o_auth_authorization_url",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthOAuthApi#get_o_auth_authorization_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_o_auth_connection_info(provider, opts = {}) ⇒ OAuthConnectionInfoResponse

Get OAuth connection info Get OAuth connection info for a specific provider (without tokens). Safe for public key authentication.

Parameters:

  • provider (String)

    OAuth provider name

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



160
161
162
163
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 160

def get_o_auth_connection_info(provider, opts = {})
  data, _status_code, _headers = get_o_auth_connection_info_with_http_info(provider, opts)
  data
end

#get_o_auth_connection_info_with_http_info(provider, opts = {}) ⇒ Array<(OAuthConnectionInfoResponse, Integer, Hash)>

Get OAuth connection info Get OAuth connection info for a specific provider (without tokens). Safe for public key authentication.

Parameters:

  • provider (String)

    OAuth provider name

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(OAuthConnectionInfoResponse, Integer, Hash)>)

    OAuthConnectionInfoResponse data, response status code and response headers



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 170

def get_o_auth_connection_info_with_http_info(provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthOAuthApi.get_o_auth_connection_info ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.get_o_auth_connection_info"
  end
  # resource path
  local_var_path = '/auth/oauth/connections/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OAuthConnectionInfoResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey']

  new_options = opts.merge(
    :operation => :"AuthOAuthApi.get_o_auth_connection_info",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthOAuthApi#get_o_auth_connection_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_o_auth_tokens(provider, user_id, opts = {}) ⇒ OAuthTokensResponse

Get OAuth provider tokens Get OAuth provider tokens for an end user. Requires secret key authentication (server-side only). This allows developers to access downstream APIs on behalf of their users.

Parameters:

  • provider (String)

    OAuth provider name

  • user_id (String)

    End user ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



224
225
226
227
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 224

def get_o_auth_tokens(provider, user_id, opts = {})
  data, _status_code, _headers = get_o_auth_tokens_with_http_info(provider, user_id, opts)
  data
end

#get_o_auth_tokens_with_http_info(provider, user_id, opts = {}) ⇒ Array<(OAuthTokensResponse, Integer, Hash)>

Get OAuth provider tokens Get OAuth provider tokens for an end user. Requires secret key authentication (server-side only). This allows developers to access downstream APIs on behalf of their users.

Parameters:

  • provider (String)

    OAuth provider name

  • user_id (String)

    End user ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(OAuthTokensResponse, Integer, Hash)>)

    OAuthTokensResponse data, response status code and response headers



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 235

def get_o_auth_tokens_with_http_info(provider, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthOAuthApi.get_o_auth_tokens ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.get_o_auth_tokens"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthOAuthApi.get_o_auth_tokens"
  end
  # resource path
  local_var_path = '/auth/oauth/tokens/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'user_id'] = user_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OAuthTokensResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']

  new_options = opts.merge(
    :operation => :"AuthOAuthApi.get_o_auth_tokens",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthOAuthApi#get_o_auth_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#handle_o_auth_callback(provider, o_auth_callback_request, opts = {}) ⇒ OAuthCallbackResponse

Handle OAuth callback Handle the OAuth callback by exchanging the authorization code for tokens and authenticating the user.

Parameters:

  • provider (String)

    OAuth provider name

  • o_auth_callback_request (OAuthCallbackRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



294
295
296
297
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 294

def handle_o_auth_callback(provider, o_auth_callback_request, opts = {})
  data, _status_code, _headers = handle_o_auth_callback_with_http_info(provider, o_auth_callback_request, opts)
  data
end

#handle_o_auth_callback_with_http_info(provider, o_auth_callback_request, opts = {}) ⇒ Array<(OAuthCallbackResponse, Integer, Hash)>

Handle OAuth callback Handle the OAuth callback by exchanging the authorization code for tokens and authenticating the user.

Parameters:

  • provider (String)

    OAuth provider name

  • o_auth_callback_request (OAuthCallbackRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(OAuthCallbackResponse, Integer, Hash)>)

    OAuthCallbackResponse data, response status code and response headers



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 305

def handle_o_auth_callback_with_http_info(provider, o_auth_callback_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthOAuthApi.handle_o_auth_callback ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.handle_o_auth_callback"
  end
  # verify the required parameter 'o_auth_callback_request' is set
  if @api_client.config.client_side_validation && o_auth_callback_request.nil?
    fail ArgumentError, "Missing the required parameter 'o_auth_callback_request' when calling AuthOAuthApi.handle_o_auth_callback"
  end
  # resource path
  local_var_path = '/auth/oauth/{provider}/callback'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(o_auth_callback_request)

  # return_type
  return_type = opts[:debug_return_type] || 'OAuthCallbackResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"AuthOAuthApi.handle_o_auth_callback",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthOAuthApi#handle_o_auth_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_o_auth_connections(opts = {}) ⇒ OAuthConnectionsResponse

List OAuth connections Get OAuth connections for the current user with metadata.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



366
367
368
369
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 366

def list_o_auth_connections(opts = {})
  data, _status_code, _headers = list_o_auth_connections_with_http_info(opts)
  data
end

#list_o_auth_connections_with_http_info(opts = {}) ⇒ Array<(OAuthConnectionsResponse, Integer, Hash)>

List OAuth connections Get OAuth connections for the current user with metadata.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(OAuthConnectionsResponse, Integer, Hash)>)

    OAuthConnectionsResponse data, response status code and response headers



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 375

def list_o_auth_connections_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthOAuthApi.list_o_auth_connections ...'
  end
  # resource path
  local_var_path = '/auth/oauth/connections'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OAuthConnectionsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey']

  new_options = opts.merge(
    :operation => :"AuthOAuthApi.list_o_auth_connections",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthOAuthApi#list_o_auth_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_o_auth_providers(opts = {}) ⇒ OAuthProvidersResponse

List OAuth providers Get list of enabled OAuth providers for the application.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



423
424
425
426
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 423

def list_o_auth_providers(opts = {})
  data, _status_code, _headers = list_o_auth_providers_with_http_info(opts)
  data
end

#list_o_auth_providers_with_http_info(opts = {}) ⇒ Array<(OAuthProvidersResponse, Integer, Hash)>

List OAuth providers Get list of enabled OAuth providers for the application.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(OAuthProvidersResponse, Integer, Hash)>)

    OAuthProvidersResponse data, response status code and response headers



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 432

def list_o_auth_providers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthOAuthApi.list_o_auth_providers ...'
  end
  # resource path
  local_var_path = '/auth/oauth/providers'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'OAuthProvidersResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApplicationPublicKey']

  new_options = opts.merge(
    :operation => :"AuthOAuthApi.list_o_auth_providers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthOAuthApi#list_o_auth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#refresh_o_auth_tokens(provider, refresh_o_auth_tokens_request, opts = {}) ⇒ OAuthTokensRefreshResponse

Refresh OAuth provider tokens Refresh OAuth provider tokens for an end user. Requires secret key authentication (server-side only). Only supported for providers that support token refresh (e.g., Google, Microsoft).

Parameters:

  • provider (String)

    OAuth provider name

  • refresh_o_auth_tokens_request (RefreshOAuthTokensRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



482
483
484
485
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 482

def refresh_o_auth_tokens(provider, refresh_o_auth_tokens_request, opts = {})
  data, _status_code, _headers = refresh_o_auth_tokens_with_http_info(provider, refresh_o_auth_tokens_request, opts)
  data
end

#refresh_o_auth_tokens_with_http_info(provider, refresh_o_auth_tokens_request, opts = {}) ⇒ Array<(OAuthTokensRefreshResponse, Integer, Hash)>

Refresh OAuth provider tokens Refresh OAuth provider tokens for an end user. Requires secret key authentication (server-side only). Only supported for providers that support token refresh (e.g., Google, Microsoft).

Parameters:

  • provider (String)

    OAuth provider name

  • refresh_o_auth_tokens_request (RefreshOAuthTokensRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(OAuthTokensRefreshResponse, Integer, Hash)>)

    OAuthTokensRefreshResponse data, response status code and response headers



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 493

def refresh_o_auth_tokens_with_http_info(provider, refresh_o_auth_tokens_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuthOAuthApi.refresh_o_auth_tokens ...'
  end
  # verify the required parameter 'provider' is set
  if @api_client.config.client_side_validation && provider.nil?
    fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.refresh_o_auth_tokens"
  end
  # verify the required parameter 'refresh_o_auth_tokens_request' is set
  if @api_client.config.client_side_validation && refresh_o_auth_tokens_request.nil?
    fail ArgumentError, "Missing the required parameter 'refresh_o_auth_tokens_request' when calling AuthOAuthApi.refresh_o_auth_tokens"
  end
  # resource path
  local_var_path = '/auth/oauth/tokens/{provider}/refresh'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(refresh_o_auth_tokens_request)

  # return_type
  return_type = opts[:debug_return_type] || 'OAuthTokensRefreshResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey']

  new_options = opts.merge(
    :operation => :"AuthOAuthApi.refresh_o_auth_tokens",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuthOAuthApi#refresh_o_auth_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end