apimatic-core

Gem Version Tests Linting Test Coverage Ruby Style Guide Licence

Introduction

Core library ruby does the job of congregating common and core functionality from ruby SDKs. This includes functionalities like the ability to create HTTP requests, handle responses, apply authentication schemes, convert API responses back to object instances, and validate user and server data.

Installation

You will need 2.6 <= Ruby version <= 3.2 to support this package.

Installation is quite simple, just execute the following command:

“em install apimatic_core

If you’d rather install apimatic_core using bundler, add a line for it in your Gemfile:

“em ‘apimatic_core’

API Call Classes

NameDescription
RequestBuilderBuilder class used to build an API Request
APICallClass used to create an API Call object
ResponseHandlerUsed to handle the response returned by the server

Authentication

NameDescription
HeaderAuthSupports HTTP authentication through HTTP Headers
QueryAuthSupports HTTP authentication through query parameters
AuthGroupHelper class to support multiple authentication operation
AndHelper class to support AND operation between multiple authentication types
OrHelper class to support OR operation between multiple authentication types
SingleHelper class to support single authentication

Configurations

NameDescription
GlobalConfigurationClass holding the global configuration properties to make a successful API Call

Exceptions

NameDescription
OneOfValidationExceptionAn exception class for the failed validation of oneOf (union-type) cases
AnyOfValidationExceptionAn exception class for the failed validation of anyOf (union-type) cases
AuthValidationExceptionAn exception class for the failed validation of authentication schemes

Factories

NameDescription
HttpResponseFactoryFactory class to create an HTTP Response

HTTP

NameDescription
HttpClientConfigurationClass used for configuring SDK by a user
HttpRequestClass which contains information about the HTTP Request
ApiResponseWrapper class for Api Response
HttpResponseClass which contains information about the HTTP Response

Logger

NameDescription
SdkLoggerA class responsible for logging request and response of an api call
NilSdkLoggerA class responsible for no logging
ConsoleLoggerRepresents default implementation of logger interface
ApiLoggingConfigurationRepresents logging configuration
ApiRequestLoggingConfigurationRepresents request logging configuration.
ApiResponseLoggingConfigurationRepresents response logging configuration.

Types

NameDescription
ApiExceptionBasic exception type for the SDK
AnyOfRepresents the AnyOf union type
OneOfRepresents the OneOf union type
LeafTypeRepresents the LeafOf union type
UnionTypeContextRepresents the context for a UnionType
ValidationExceptionException thrown in case of validation error or failure
ErrorCaseA class to represent Exception types
FileWrapperA wrapper to allow passing in content type for file uploads
ParameterA class to represent information about a Parameter passed in an endpoint
XmlAttributesA class to represent information about an XML Parameter passed in an endpoint

Utilities

NameDescription
ApiHelperA Helper Class with various functions associated with making an API Call
AuthHelperA Helper Class with various functions associated with authentication in API Calls
UnionTypeHelperA Helper Class with various functions associated with Union type in API Calls
ComparisonHelperA Helper Class used for the comparison of expected and actual API response
FileHelperA Helper Class for files
XmlHelperA Helper class that holds utility methods for xml serialization and deserialization.