You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

Class: AWS.Service

Inherits:
Object
  • Object
show all
Defined in:
lib/service.js

Overview

The service class representing an AWS service.

Abstract Class:

  • This class is an abstract class.

Direct Known Subclasses

AWS.S3

Constructor Summary collapse

Property Summary collapse

Method Summary collapse

Constructor Details

new AWS.Service(config) ⇒ void

Create a new service object with a configuration object

Parameters:

  • config (map)

    a map of configuration options

Property Details

apiVersionsArray<String> (readonly)

Returns the list of API versions supported by this service.

Returns:

  • (Array<String>)

    the list of API versions supported by this service.

Method Details

defineService(serviceIdentifier, versions, features) ⇒ Class<Service>

Defines a new Service class using a service identifier and list of versions including an optional set of features (functions) to apply to the class prototype.

Parameters:

  • serviceIdentifier (String)

    the identifier for the service

  • versions (Array<String>)

    a list of versions that work with this service

  • features (Object)

    an object to attach to the prototype

Returns:

  • (Class<Service>)

    the service class defined by this function.

makeRequest(operation, params, callback) ⇒ void

Calls an operation on a service with the given input parameters.

Parameters:

  • operation (String)

    the name of the operation to call on the service.

  • params (map)

    a map of input options for the operation

Callback (callback):

  • function(err, data) { ... }

    If a callback is supplied, it is called when a response is returned from the service.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

makeUnauthenticatedRequest(operation, params, callback) ⇒ void

Calls an operation on a service with the given input parameters, without any authentication data. This method is useful for "public" API operations.

Parameters:

  • operation (String)

    the name of the operation to call on the service.

  • params (map)

    a map of input options for the operation

Callback (callback):

  • function(err, data) { ... }

    If a callback is supplied, it is called when a response is returned from the service.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

setupRequestListeners(request) ⇒ void

Override this method to setup any custom request listeners for each new request to the service.

Abstract Method:

  • This is an abstract method.

waitFor(state, params, callback) ⇒ void

Waits for a given state

Parameters:

  • state (String)

    the state on the service to wait for

  • params (map)

    a map of parameters to pass with each request

Callback (callback):

  • function(err, data) { ... }

    If a callback is supplied, it is called when a response is returned from the service.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Options Hash (params):

  • $waiter (map)

    a map of configuration options for the waiter

  • $waiter.delay (Number)

    The number of seconds to wait between requests

  • $waiter.maxAttempts (Number)

    The maximum number of requests to send while waiting