class OpenapiClient::TagsApi
Attributes
Public Class Methods
# File lib/openapi_client/api/tags_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Create a New Tag
Create a new Tag
for customizing how you track your shipments @param tag_name [String] @param [Hash] opts the optional parameters @return [CreateTagResponseBody]
# File lib/openapi_client/api/tags_api.rb, line 27 def create_tag(tag_name, opts = {}) data, _status_code, _headers = create_tag_with_http_info(tag_name, opts) data end
Create a New Tag
Create a new Tag
for customizing how you track your shipments @param tag_name [String] @param [Hash] opts the optional parameters @return [Array<(CreateTagResponseBody
, Integer, Hash)>] CreateTagResponseBody
data, response status code and response headers
# File lib/openapi_client/api/tags_api.rb, line 37 def create_tag_with_http_info(tag_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TagsApi.create_tag ...' end # verify the required parameter 'tag_name' is set if @api_client.config.client_side_validation && tag_name.nil? fail ArgumentError, "Missing the required parameter 'tag_name' when calling TagsApi.create_tag" end if @api_client.config.client_side_validation && tag_name.to_s.length < 1 fail ArgumentError, 'invalid value for "tag_name" when calling TagsApi.create_tag, the character length must be great than or equal to 1.' end # resource path local_var_path = '/v1/tags/{tag_name}'.sub('{' + 'tag_name' + '}', CGI.escape(tag_name.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 return_type = opts[:return_type] || 'CreateTagResponseBody' # auth_names auth_names = opts[:auth_names] || ['api_key'] 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(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TagsApi#create_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete Tag
Delete a tag that is no longer needed @param tag_name [String] @param [Hash] opts the optional parameters @return [String]
# File lib/openapi_client/api/tags_api.rb, line 93 def delete_tag(tag_name, opts = {}) data, _status_code, _headers = delete_tag_with_http_info(tag_name, opts) data end
Delete Tag
Delete a tag that is no longer needed @param tag_name [String] @param [Hash] opts the optional parameters @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
# File lib/openapi_client/api/tags_api.rb, line 103 def delete_tag_with_http_info(tag_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TagsApi.delete_tag ...' end # verify the required parameter 'tag_name' is set if @api_client.config.client_side_validation && tag_name.nil? fail ArgumentError, "Missing the required parameter 'tag_name' when calling TagsApi.delete_tag" end if @api_client.config.client_side_validation && tag_name.to_s.length < 1 fail ArgumentError, 'invalid value for "tag_name" when calling TagsApi.delete_tag, the character length must be great than or equal to 1.' end # resource path local_var_path = '/v1/tags/{tag_name}'.sub('{' + 'tag_name' + '}', CGI.escape(tag_name.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(['text/plain', 'application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'String' # auth_names auth_names = opts[:auth_names] || ['api_key'] 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: TagsApi#delete_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update Tag
Name Change a tag name while still keeping the relevant shipments attached to it @param tag_name [String] @param new_tag_name [String] @param [Hash] opts the optional parameters @return [String]
# File lib/openapi_client/api/tags_api.rb, line 216 def rename_tag(tag_name, new_tag_name, opts = {}) data, _status_code, _headers = rename_tag_with_http_info(tag_name, new_tag_name, opts) data end
Update Tag
Name Change a tag name while still keeping the relevant shipments attached to it @param tag_name [String] @param new_tag_name [String] @param [Hash] opts the optional parameters @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
# File lib/openapi_client/api/tags_api.rb, line 227 def rename_tag_with_http_info(tag_name, new_tag_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TagsApi.rename_tag ...' end # verify the required parameter 'tag_name' is set if @api_client.config.client_side_validation && tag_name.nil? fail ArgumentError, "Missing the required parameter 'tag_name' when calling TagsApi.rename_tag" end if @api_client.config.client_side_validation && tag_name.to_s.length < 1 fail ArgumentError, 'invalid value for "tag_name" when calling TagsApi.rename_tag, the character length must be great than or equal to 1.' end # verify the required parameter 'new_tag_name' is set if @api_client.config.client_side_validation && new_tag_name.nil? fail ArgumentError, "Missing the required parameter 'new_tag_name' when calling TagsApi.rename_tag" end if @api_client.config.client_side_validation && new_tag_name.to_s.length < 1 fail ArgumentError, 'invalid value for "new_tag_name" when calling TagsApi.rename_tag, the character length must be great than or equal to 1.' end # resource path local_var_path = '/v1/tags/{tag_name}/{new_tag_name}'.sub('{' + 'tag_name' + '}', CGI.escape(tag_name.to_s)).sub('{' + 'new_tag_name' + '}', CGI.escape(new_tag_name.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(['text/plain', 'application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'String' # auth_names auth_names = opts[:auth_names] || ['api_key'] 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(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TagsApi#rename_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end