=begin
#OAuthService
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.2.2
=end
require 'cgi'
module Hubspot
module Client
module OAuth
module Api
class RefreshTokensApi
attr_accessor :api_client
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=deleteRefreshToken) | [API Goggles](https://tools.hubteam.com/api/delete/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2F%28%28%7Btoken%7D%29%29?showRequestDetails=true) | Permalink
# @param token [String]
# @param [Hash] opts the optional parameters
# @return [Error]
def delete_oauth_v1_refresh_tokens_token(token, opts = {})
data, _status_code, _headers = delete_oauth_v1_refresh_tokens_token_with_http_info(token, opts)
data
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=deleteRefreshToken) | [API Goggles](https://tools.hubteam.com/api/delete/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2F%28%28%7Btoken%7D%29%29?showRequestDetails=true) | <a href='#operations-Refresh_Tokens-delete-%2Foauth%2Fv1%2Frefresh-tokens%2F%7Btoken%7D'>Permalink</a>
# @param token [String]
# @param [Hash] opts the optional parameters
# @return [Array<(Error, Integer, Hash)>] Error data, response status code and response headers
def delete_oauth_v1_refresh_tokens_token_with_http_info(token, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RefreshTokensApi.delete_oauth_v1_refresh_tokens_token ...'
end
# verify the required parameter 'token' is set
if @api_client.config.client_side_validation && token.nil?
fail ArgumentError, "Missing the required parameter 'token' when calling RefreshTokensApi.delete_oauth_v1_refresh_tokens_token"
end
# resource path
local_var_path = '/v1/refresh-tokens/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s).gsub('%2F', '/'))
# 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(['*/*'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Error'
# auth_names
auth_names = opts[:auth_names] || []
new_options = opts.merge(
: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: RefreshTokensApi#delete_oauth_v1_refresh_tokens_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=getRefreshTokenInfo) | [API Goggles](https://tools.hubteam.com/api/get/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2Fhubs%2F%28%28%7BhubId%7D%29%29%2Fclients%2F%28%28%7BclientId%7D%29%29?showRequestDetails=true) | Permalink
# @param hub_id [Integer]
# @param client_id [String]
# @param [Hash] opts the optional parameters
# @return [Array]
def get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id(hub_id, client_id, opts = {})
data, _status_code, _headers = get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id_with_http_info(hub_id, client_id, opts)
data
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=getRefreshTokenInfo) | [API Goggles](https://tools.hubteam.com/api/get/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2Fhubs%2F%28%28%7BhubId%7D%29%29%2Fclients%2F%28%28%7BclientId%7D%29%29?showRequestDetails=true) | <a href='#operations-Refresh_Tokens-get-%2Foauth%2Fv1%2Frefresh-tokens%2Fhubs%2F%7BhubId%7D%2Fclients%2F%7BclientId%7D'>Permalink</a>
# @param hub_id [Integer]
# @param client_id [String]
# @param [Hash] opts the optional parameters
# @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
def get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id_with_http_info(hub_id, client_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RefreshTokensApi.get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id ...'
end
# verify the required parameter 'hub_id' is set
if @api_client.config.client_side_validation && hub_id.nil?
fail ArgumentError, "Missing the required parameter 'hub_id' when calling RefreshTokensApi.get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id"
end
# verify the required parameter 'client_id' is set
if @api_client.config.client_side_validation && client_id.nil?
fail ArgumentError, "Missing the required parameter 'client_id' when calling RefreshTokensApi.get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id"
end
# resource path
local_var_path = '/v1/refresh-tokens/hubs/{hubId}/clients/{clientId}'.sub('{' + 'hubId' + '}', CGI.escape(hub_id.to_s).gsub('%2F', '/')).sub('{' + 'clientId' + '}', CGI.escape(client_id.to_s).gsub('%2F', '/'))
# 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', '*/*'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Array'
# auth_names
auth_names = opts[:auth_names] || []
new_options = opts.merge(
: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: RefreshTokensApi#get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=getTokenAuditsByHubAndClient) | [API Goggles](https://tools.hubteam.com/api/get/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2Fhubs%2F%28%28%7BhubId%7D%29%29%2Fclients%2F%28%28%7BclientId%7D%29%29%2Faudits?showRequestDetails=true) | Permalink
# @param hub_id [Integer]
# @param client_id [String]
# @param [Hash] opts the optional parameters
# @return [Array]
def get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id_audits(hub_id, client_id, opts = {})
data, _status_code, _headers = get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id_audits_with_http_info(hub_id, client_id, opts)
data
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=getTokenAuditsByHubAndClient) | [API Goggles](https://tools.hubteam.com/api/get/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2Fhubs%2F%28%28%7BhubId%7D%29%29%2Fclients%2F%28%28%7BclientId%7D%29%29%2Faudits?showRequestDetails=true) | <a href='#operations-Refresh_Tokens-get-%2Foauth%2Fv1%2Frefresh-tokens%2Fhubs%2F%7BhubId%7D%2Fclients%2F%7BclientId%7D%2Faudits'>Permalink</a>
# @param hub_id [Integer]
# @param client_id [String]
# @param [Hash] opts the optional parameters
# @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
def get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id_audits_with_http_info(hub_id, client_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RefreshTokensApi.get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id_audits ...'
end
# verify the required parameter 'hub_id' is set
if @api_client.config.client_side_validation && hub_id.nil?
fail ArgumentError, "Missing the required parameter 'hub_id' when calling RefreshTokensApi.get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id_audits"
end
# verify the required parameter 'client_id' is set
if @api_client.config.client_side_validation && client_id.nil?
fail ArgumentError, "Missing the required parameter 'client_id' when calling RefreshTokensApi.get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id_audits"
end
# resource path
local_var_path = '/v1/refresh-tokens/hubs/{hubId}/clients/{clientId}/audits'.sub('{' + 'hubId' + '}', CGI.escape(hub_id.to_s).gsub('%2F', '/')).sub('{' + 'clientId' + '}', CGI.escape(client_id.to_s).gsub('%2F', '/'))
# 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', '*/*'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Array'
# auth_names
auth_names = opts[:auth_names] || []
new_options = opts.merge(
: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: RefreshTokensApi#get_oauth_v1_refresh_tokens_hubs_hub_id_clients_client_id_audits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=requestRefreshTokenInfo) | [API Goggles](https://tools.hubteam.com/api/get/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2F%28%28%7Btoken%7D%29%29?showRequestDetails=true) | Permalink
# @param token [String]
# @param [Hash] opts the optional parameters
# @return [RefreshTokenInfoResponse]
def get_oauth_v1_refresh_tokens_token(token, opts = {})
data, _status_code, _headers = get_oauth_v1_refresh_tokens_token_with_http_info(token, opts)
data
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=requestRefreshTokenInfo) | [API Goggles](https://tools.hubteam.com/api/get/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2F%28%28%7Btoken%7D%29%29?showRequestDetails=true) | <a href='#operations-Refresh_Tokens-get-%2Foauth%2Fv1%2Frefresh-tokens%2F%7Btoken%7D'>Permalink</a>
# @param token [String]
# @param [Hash] opts the optional parameters
# @return [Array<(RefreshTokenInfoResponse, Integer, Hash)>] RefreshTokenInfoResponse data, response status code and response headers
def get_oauth_v1_refresh_tokens_token_with_http_info(token, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RefreshTokensApi.get_oauth_v1_refresh_tokens_token ...'
end
# verify the required parameter 'token' is set
if @api_client.config.client_side_validation && token.nil?
fail ArgumentError, "Missing the required parameter 'token' when calling RefreshTokensApi.get_oauth_v1_refresh_tokens_token"
end
# resource path
local_var_path = '/v1/refresh-tokens/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s).gsub('%2F', '/'))
# 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', '*/*'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'RefreshTokenInfoResponse'
# auth_names
auth_names = opts[:auth_names] || []
new_options = opts.merge(
: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: RefreshTokensApi#get_oauth_v1_refresh_tokens_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=getTokenAudits) | [API Goggles](https://tools.hubteam.com/api/get/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2F%28%28%7Btoken%7D%29%29%2Faudits?showRequestDetails=true) | Permalink
# @param token [String]
# @param [Hash] opts the optional parameters
# @return [Array]
def get_oauth_v1_refresh_tokens_token_audits(token, opts = {})
data, _status_code, _headers = get_oauth_v1_refresh_tokens_token_audits_with_http_info(token, opts)
data
end
# Auth Level: none ([Docs](https://product.hubteam.com/docs/appsystems/auth-and-rest/auth-levels.html)) [Source Code](https://private.hubteam.com/opengrok/search?project=all&path=RefreshTokensResource%20OR%20Object&defs=getTokenAudits) | [API Goggles](https://tools.hubteam.com/api/get/api.hubapi.com%2Foauth%2Fv1%2Frefresh-tokens%2F%28%28%7Btoken%7D%29%29%2Faudits?showRequestDetails=true) | <a href='#operations-Refresh_Tokens-get-%2Foauth%2Fv1%2Frefresh-tokens%2F%7Btoken%7D%2Faudits'>Permalink</a>
# @param token [String]
# @param [Hash] opts the optional parameters
# @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers
def get_oauth_v1_refresh_tokens_token_audits_with_http_info(token, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RefreshTokensApi.get_oauth_v1_refresh_tokens_token_audits ...'
end
# verify the required parameter 'token' is set
if @api_client.config.client_side_validation && token.nil?
fail ArgumentError, "Missing the required parameter 'token' when calling RefreshTokensApi.get_oauth_v1_refresh_tokens_token_audits"
end
# resource path
local_var_path = '/v1/refresh-tokens/{token}/audits'.sub('{' + 'token' + '}', CGI.escape(token.to_s).gsub('%2F', '/'))
# 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', '*/*'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Array'
# auth_names
auth_names = opts[:auth_names] || []
new_options = opts.merge(
: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: RefreshTokensApi#get_oauth_v1_refresh_tokens_token_audits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end
end
end
end