class

Twilio::ApiClient

Inherits Reference / Object

Constants

COLLECTION_FORMAT_MULTI = "multi"
COLLECTION_FORMAT_SEPARATOR_MAP = {"csv" => ",", "ssv" => " ", "tsv" => "\t", "pipes" => "|", COLLECTION_FORMAT_MULTI => COLLECTION_FORMAT_MULTI}
DEFAULT_MIME_TYPE = "application/octet-stream"
JSON_MIME_REGEX = /Application\/.*json(?!p)(;.*)?/i
UNKNOWN_COLLECTION_FORMAT_SEPARATOR = "unknown"

Constructors

default
Source
new(config : Twilio::Configuration = Configuration.default, default_url_encoder : ::Crest::ParamsEncoder.class = Crest::ZeroEnumeratedFlatParamsEncoder, default_headers : Hash(String, String) = Hash(String, String).new, default_cookies : Hash(String, String) = Hash(String, String).new)

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

Source

Instance methods

build_api_request(http_method : Symbol, path : String, operation : String | Nil = nil, post_body : IO | String | Nil = nil, auth_names : Array(String) = Array(String).new, header_params : Hash(String, String) = Hash(String, String).new, cookie_params : Hash(String, String) = Hash(String, String).new, query_params : Hash(String, String | Array(String) | JSON::Any) = Hash(String, (String | Array(String) | JSON::Any)).new, form_params : Array(Tuple(String, Crest::ParamsValue)) | Nil = nil) : Crest::Request

Build an API request with given options.

@return Crest::Request the data deserialized from response body (could be nil), response status code and response headers.

Source
build_collection_param(params : Array, collection_format : String) : Array(String)

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

Source
build_collection_param_tuples(name : String, params : Array, collection_format : String) : Array(Tuple(String, Crest::ParamsValue))

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

Source
build_form_data(form_params : Array(Tuple(String, Crest::ParamsValue)), header_params : Hash(String, String)) : String

Build form data from form params @param [Array(Tuple(String, Crest::ParamsValue))] form_params

Source
build_header_param(params : Array) : String

Build HTTP header value for array HTTP header values are always comma separated @param [Array] params

Source
build_multipart_form_data(form_params : Array(Tuple(String, Crest::ParamsValue)), header_params : Hash(String, String)) : String

Build multipart form data from form params @param [Array(Tuple(String, Crest::ParamsValue))] form_params

Source
build_request_url(path : String, operation : String | Nil) : String
Source
build_url_encoded_form_data(form_params : Array(Tuple(String, Crest::ParamsValue))) : String

Build url encoded form data from form params @param [Array(Tuple(String, Crest::ParamsValue))] form_params

Source
config

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

Source
config=(config : Configuration)

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

Source
default_cookies

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

@return [Hash]

Source
default_cookies=(default_cookies : Hash(String, String))

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

@return [Hash]

Source
default_headers

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

@return [Hash]

Source
default_headers=(default_headers : Hash(String, String))

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

@return [Hash]

Source
default_url_encoder

The encoder class used to encode request body

Source
default_url_encoder=(default_url_encoder : Crest::ParamsEncoder.class)

The encoder class used to encode request body

Source
encode(body : Hash | Array | OpenApi::Json | JSON::Any, content_type : String | Nil = nil, url_encoder : Crest::ParamsEncoder.class | Nil = nil) : String
Source
execute_api_request(request : Crest::Request) : Tuple(String, Int32, Hash(String, Array(String) | String))
Source
json_mime?(mime : String) : Bool

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

Source
select_header_accept(accepts : Array(String)) : 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)

Source
select_header_content_type(content_types : Array(String)) : String

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)

Source
user_agent

User Agent

Source
user_agent=(user_agent : String | Nil) : Nil

Sets user agent in HTTP header

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

Source