class stcloud::TokensApiControllerApi
Attributes
Public Class Methods
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Create new app token @param app_id appId @param dto dto @param [Hash] opts the optional parameters @return [GenericApiResponse]
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 27 def create_app_token1(app_id, dto, opts = {}) data, _status_code, _headers = create_app_token1_with_http_info(app_id, dto, opts) data end
Create new app token @param app_id appId @param dto dto @param [Hash] opts the optional parameters @return [Array<(GenericApiResponse
, Fixnum, Hash)>] GenericApiResponse
data, response status code and response headers
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 37 def create_app_token1_with_http_info(app_id, dto, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApiControllerApi.create_app_token1 ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApiControllerApi.create_app_token1" end # verify the required parameter 'dto' is set if @api_client.config.client_side_validation && dto.nil? fail ArgumentError, "Missing the required parameter 'dto' when calling TokensApiControllerApi.create_app_token1" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/tokens'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(dto) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GenericApiResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TokensApiControllerApi#create_app_token1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete app token @param app_id appId @param token_id tokenId @param [Hash] opts the optional parameters @return [GenericMapBasedApiResponse]
# File lib/stcloud/api/tokens_api_controller_api.rb, line 86 def delete_app_token(app_id, token_id, opts = {}) data, _status_code, _headers = delete_app_token_with_http_info(app_id, token_id, opts) data end
Delete app token @param app_id appId @param token_id tokenId @param [Hash] opts the optional parameters @return [GenericApiResponse]
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 85 def delete_app_token1(app_id, token_id, opts = {}) data, _status_code, _headers = delete_app_token1_with_http_info(app_id, token_id, opts) data end
Delete app token @param app_id appId @param token_id tokenId @param [Hash] opts the optional parameters @return [Array<(GenericApiResponse
, Fixnum, Hash)>] GenericApiResponse
data, response status code and response headers
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 95 def delete_app_token1_with_http_info(app_id, token_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApiControllerApi.delete_app_token1 ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApiControllerApi.delete_app_token1" end # verify the required parameter 'token_id' is set if @api_client.config.client_side_validation && token_id.nil? fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApiControllerApi.delete_app_token1" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/tokens/{tokenId}'.sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'tokenId' + '}', token_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GenericApiResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TokensApiControllerApi#delete_app_token1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete app token @param app_id appId @param token_id tokenId @param [Hash] opts the optional parameters @return [Array<(GenericMapBasedApiResponse
, Integer, Hash)>] GenericMapBasedApiResponse
data, response status code and response headers
# File lib/stcloud/api/tokens_api_controller_api.rb, line 96 def delete_app_token_with_http_info(app_id, token_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApiControllerApi.delete_app_token ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApiControllerApi.delete_app_token" end # verify the required parameter 'token_id' is set if @api_client.config.client_side_validation && token_id.nil? fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApiControllerApi.delete_app_token" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/tokens/{tokenId}'.sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'tokenId' + '}', token_id.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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'GenericMapBasedApiResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: TokensApiControllerApi#delete_app_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get app available tokens @param app_id appId @param [Hash] opts the optional parameters @return [GenericApiResponse]
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 142 def get_app_tokens(app_id, opts = {}) data, _status_code, _headers = get_app_tokens_with_http_info(app_id, opts) data end
Get app available tokens @param app_id appId @param [Hash] opts the optional parameters @return [TokensResponse]
# File lib/stcloud/api/tokens_api_controller_api.rb, line 145 def get_app_tokens1(app_id, opts = {}) data, _status_code, _headers = get_app_tokens1_with_http_info(app_id, opts) data end
Get app available tokens @param app_id appId @param [Hash] opts the optional parameters @return [Array<(TokensResponse
, Integer, Hash)>] TokensResponse
data, response status code and response headers
# File lib/stcloud/api/tokens_api_controller_api.rb, line 154 def get_app_tokens1_with_http_info(app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApiControllerApi.get_app_tokens1 ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApiControllerApi.get_app_tokens1" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/tokens'.sub('{' + 'appId' + '}', app_id.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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'TokensResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: TokensApiControllerApi#get_app_tokens1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get app available tokens @param app_id appId @param [Hash] opts the optional parameters @return [Array<(GenericApiResponse
, Fixnum, Hash)>] GenericApiResponse
data, response status code and response headers
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 151 def get_app_tokens_with_http_info(app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApiControllerApi.get_app_tokens ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApiControllerApi.get_app_tokens" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/tokens'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GenericApiResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TokensApiControllerApi#get_app_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Regenerate app token) @param app_id appId @param token_id tokenId @param [Hash] opts the optional parameters @return [TokenResponse]
# File lib/stcloud/api/tokens_api_controller_api.rb, line 200 def regenerate_app_token(app_id, token_id, opts = {}) data, _status_code, _headers = regenerate_app_token_with_http_info(app_id, token_id, opts) data end
Regenerate app token) @param app_id appId @param token_id tokenId @param [Hash] opts the optional parameters @return [GenericApiResponse]
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 195 def regenerate_app_token1(app_id, token_id, opts = {}) data, _status_code, _headers = regenerate_app_token1_with_http_info(app_id, token_id, opts) data end
Regenerate app token) @param app_id appId @param token_id tokenId @param [Hash] opts the optional parameters @return [Array<(GenericApiResponse
, Fixnum, Hash)>] GenericApiResponse
data, response status code and response headers
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 205 def regenerate_app_token1_with_http_info(app_id, token_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApiControllerApi.regenerate_app_token1 ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApiControllerApi.regenerate_app_token1" end # verify the required parameter 'token_id' is set if @api_client.config.client_side_validation && token_id.nil? fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApiControllerApi.regenerate_app_token1" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/tokens/{tokenId}/regenerate'.sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'tokenId' + '}', token_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GenericApiResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TokensApiControllerApi#regenerate_app_token1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Regenerate app token) @param app_id appId @param token_id tokenId @param [Hash] opts the optional parameters @return [Array<(TokenResponse
, Integer, Hash)>] TokenResponse
data, response status code and response headers
# File lib/stcloud/api/tokens_api_controller_api.rb, line 210 def regenerate_app_token_with_http_info(app_id, token_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApiControllerApi.regenerate_app_token ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApiControllerApi.regenerate_app_token" end # verify the required parameter 'token_id' is set if @api_client.config.client_side_validation && token_id.nil? fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApiControllerApi.regenerate_app_token" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/tokens/{tokenId}/regenerate'.sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'tokenId' + '}', token_id.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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'TokenResponse' auth_names = opts[:auth_names] || ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: TokensApiControllerApi#regenerate_app_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update app token (enable/disable or name) @param app_id appId @param token_id tokenId @param dto dto @param [Hash] opts the optional parameters @return [GenericApiResponse]
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 254 def update_app_token(app_id, token_id, dto, opts = {}) data, _status_code, _headers = update_app_token_with_http_info(app_id, token_id, dto, opts) data end
Update app token (enable/disable or name) @param app_id appId @param token_id tokenId @param dto dto @param [Hash] opts the optional parameters @return [Array<(GenericApiResponse
, Fixnum, Hash)>] GenericApiResponse
data, response status code and response headers
# File lib/SematextCloud/api/tokens_api_controller_api.rb, line 265 def update_app_token_with_http_info(app_id, token_id, dto, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokensApiControllerApi.update_app_token ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling TokensApiControllerApi.update_app_token" end # verify the required parameter 'token_id' is set if @api_client.config.client_side_validation && token_id.nil? fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApiControllerApi.update_app_token" end # verify the required parameter 'dto' is set if @api_client.config.client_side_validation && dto.nil? fail ArgumentError, "Missing the required parameter 'dto' when calling TokensApiControllerApi.update_app_token" end # resource path local_var_path = '/users-web/api/v3/apps/{appId}/tokens/{tokenId}'.sub('{' + 'appId' + '}', app_id.to_s).sub('{' + 'tokenId' + '}', token_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(dto) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GenericApiResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TokensApiControllerApi#update_app_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end