class Build::ApiClient

Defined in:

build-client/api_client.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(config : Build::Configuration = Configuration.default) #

Initializes the ApiClient @option config [Configuration] Configuration for initializing the object, default to Configuration.default


[View source]

Class Method Detail

def self.default #

[View source]

Instance Method Detail

def build_collection_param(param, collection_format) #

Build parameter value according to the given collection format. @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi


[View source]
def build_request_url(path : String, operation : Symbol) #

[View source]
def call_api(http_method : Symbol, path : String, operation : Symbol, return_type : String | Nil, post_body : String | Nil, auth_names = [] of String, header_params = {} of String => String, query_params = {} of String => String, form_params = {} of Symbol => String | ::File) #

Call an API with given options.

@return [Array<(Object, Integer, Hash)>] an array of 3 elements: the data deserialized from response body (could be nil), response status code and response headers.


[View source]
def config : Configuration #

The Configuration object holding settings to be used in the API client.


[View source]
def config=(config : Configuration) #

The Configuration object holding settings to be used in the API client.


[View source]
def default_headers : Hash(String, String) #

Defines the headers to be used in HTTP requests of all API calls by default.

@return [Hash]


[View source]
def default_headers=(default_headers : Hash(String, String)) #

Defines the headers to be used in HTTP requests of all API calls by default.

@return [Hash]


[View source]
def json_mime?(mime) #

Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; charset=UTF8 APPLICATION/JSON / @param [String] mime MIME @return [Boolean] True if the MIME is application/json


[View source]
def select_header_accept(accepts) : String #

Return Accept header based on an array of accepts provided. @param [Array] accepts array for Accept @return [String] the Accept header (e.g. application/json)


[View source]
def select_header_content_type(content_types) #

Return Content-Type header based on an array of content types provided. @param [Array] content_types array for Content-Type @return [String] the Content-Type header (e.g. application/json)


[View source]
def update_params_for_auth!(header_params, query_params, auth_names) #

Update header and query params based on authentication settings.

@param [Hash] header_params Header parameters @param [Hash] query_params Query parameters @param [String] auth_names Authentication scheme name


[View source]
def user_agent=(user_agent : String) #

Sets user agent in HTTP header

@param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)


[View source]