ApiClient Class

Format

An R6Class generator object

Details

ApiClient Class

Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of the methods and models for each application are generated from the OpenAPI Generator templates.

NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Ref: https://openapi-generator.tech Do not edit the class manually.

Public fields

basePath

Base url

userAgent

Default user agent

defaultHeaders

Default HTTP headers

username

Username for HTTP basic authentication

password

Password for HTTP basic authentication

apiKeys

API keys - not used

accessToken

HTTP Access token - not used

timeout

Default timeout in seconds

Methods


Method new()

Create an ApiClient

Usage

ApiClient$new(
  basePath = NULL,
  userAgent = NULL,
  defaultHeaders = NULL,
  username = NULL,
  password = NULL,
  apiKeys = NULL,
  accessToken = NULL,
  timeout = NULL
)

Arguments

basePath

HTTP call base path to the end point

userAgent

User agent string to access endpoint with

defaultHeaders

default headers in the HTTP request

username

User name (HTTP basic authentication)

password

User password (HTTP basic authentication)

apiKeys

API keys

accessToken

Access token

timeout

Time Out (seconds)


Method CallApi()

CallApi

Usage

ApiClient$CallApi(
  url,
  method,
  queryParams,
  headerParams,
  body,
  contentType = "application/json",
  ...
)

Arguments

url

URL to call

method

One of GET, POST, PUT, PATCH, HEAD, DELETE

queryParams

Query parameters

headerParams

Additional header parameters

body

The call body (only in POST, PUT, PATCH)

contentType

Defaults to application/json

...

Pass through to httr method call


Method deserialize()

Deserialize the content of api response to the given type.

Usage

ApiClient$deserialize(resp, returnType, pkgEnv)

Arguments

resp

HTTP response, compatible to be read as httr::content text

returnType

Target type to deserialize into

pkgEnv

Current package environment


Method deserializeObj()

Deserialize the response from jsonlite object based on the given type by handling complex and nested types by iterating recursively Example returnTypes will be like "array[integer]", "map(Pet)", "array[map(Tag)]", etc.,

Usage

ApiClient$deserializeObj(obj, returnType, pkgEnv)

Arguments

obj

Object to deserialize

returnType

Target type to deserialize into

pkgEnv

Current package environment


Method clone()

The objects of this class are cloneable with this method.

Usage

ApiClient$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.