Class: Dor::Services::Client::VersionedService Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/dor/services/client/versioned_service.rb

Overview

This class is abstract.

API calls to a versioned endpoint

Constant Summary collapse

EXCEPTION_CLASS =
{
  400 => BadRequestError,
  401 => UnauthorizedResponse,
  404 => NotFoundResponse,
  409 => ConflictResponse,
  412 => PreconditionFailedResponse,
  422 => UnprocessableContentError
}.freeze
JSON_API_MIME_TYPE =
'application/vnd.api+json'

Instance Method Summary collapse

Constructor Details

#initialize(connection:, version:) ⇒ VersionedService

Returns a new instance of VersionedService.



19
20
21
22
# File 'lib/dor/services/client/versioned_service.rb', line 19

def initialize(connection:, version:)
  @connection = connection
  @api_version = version
end

Instance Method Details

#async_result(url:) ⇒ Object

Common interface for handling asynchronous results



25
26
27
# File 'lib/dor/services/client/versioned_service.rb', line 25

def async_result(url:)
  AsyncResult.new(url: url)
end