Skip to content

apimatic/core-lib-ruby

Repository files navigation

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.3 to support this package.

Installation is quite simple, just execute the following command:

gem install apimatic_core

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

gem 'apimatic_core'

API Call Classes

Name Description
RequestBuilder Builder class used to build an API Request
APICall Class used to create an API Call object
ResponseHandler Used to handle the response returned by the server

Authentication

Name Description
HeaderAuth Supports HTTP authentication through HTTP Headers
QueryAuth Supports HTTP authentication through query parameters
AuthGroup Helper class to support multiple authentication operation
And Helper class to support AND operation between multiple authentication types
Or Helper class to support OR operation between multiple authentication types
Single Helper class to support single authentication

Configurations

Name Description
GlobalConfiguration Class holding the global configuration properties to make a successful API Call

Exceptions

Name Description
OneOfValidationException An exception class for the failed validation of oneOf (union-type) cases
AnyOfValidationException An exception class for the failed validation of anyOf (union-type) cases
AuthValidationException An exception class for the failed validation of authentication schemes

Factories

Name Description
HttpResponseFactory Factory class to create an HTTP Response

HTTP

Name Description
HttpClientConfiguration Class used for configuring SDK by a user
HttpRequest Class which contains information about the HTTP Request
ApiResponse Wrapper class for Api Response
HttpResponse Class which contains information about the HTTP Response
HttpCallContext This class captures the HTTP request and response lifecycle during an API call and is used with clients or controllers that support pre- and post-request hooks.

Logger

Name Description
SdkLogger A class responsible for logging request and response of an api call
NilSdkLogger A class responsible for no logging
ConsoleLogger Represents default implementation of logger interface
ApiLoggingConfiguration Represents logging configuration
ApiRequestLoggingConfiguration Represents request logging configuration.
ApiResponseLoggingConfiguration Represents response logging configuration.

Pagination

Name Description
CursorPagination Cursor-based pagination strategy that handles extraction and injection of cursor values for seamless traversal across paged API responses.
LinkPagination Extracts the next page link from API responses via a JSON pointer and updates the request builder with corresponding query parameters.
OffsetPagination Offset-based pagination using a configurable JSON pointer to update and track offset values in the request builder across responses.
PagePagination Page-based pagination strategy that updates the request builder with page numbers using a JSON pointer and wraps each response with metadata.
PaginatedData Iterator for paginated API responses supporting multiple strategies, item/page iteration, and access to the latest response and request builder.

Types

Name Description
ApiException Basic exception type for the SDK
AnyOf Represents the AnyOf union type
OneOf Represents the OneOf union type
LeafType Represents the LeafOf union type
UnionTypeContext Represents the context for a UnionType
ValidationException Exception thrown in case of validation error or failure
ErrorCase A class to represent Exception types
FileWrapper A wrapper to allow passing in content type for file uploads
Parameter A class to represent information about a Parameter passed in an endpoint
XmlAttributes A class to represent information about an XML Parameter passed in an endpoint

Utilities

Name Description
ApiHelper A Helper Class with various functions associated with making an API Call
AuthHelper A Helper Class with various functions associated with authentication in API Calls
UnionTypeHelper A Helper Class with various functions associated with Union type in API Calls
ComparisonHelper A Helper Class used for the comparison of expected and actual API response
FileHelper A Helper Class for files
XmlHelper A Helper class that holds utility methods for xml serialization and deserialization.
DateTimeHelper Utility methods for date-time format conversions.
DeepCloneUtils Utility methods for deep cloning arrays, hashes, and objects.
JsonPointerHelper Utility methods for getting and setting JSON pointer values in hashes.
JsonPointer Enables querying, updating, and deleting values in nested Ruby Hashes and Arrays using JSON Pointer syntax (RFC 6901).
LoggerHelper Utility methods for logging.

Links

About

This project contains core logic and the utilities for the Ruby SDK provided by APIMatic.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 9

Languages