NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class ClientBuilder

Builder for creating AWS service clients

Namespace: Aws\Common\Client
Located at Aws/Common/Client/ClientBuilder.php

## Methods summary

- `public static` `factory ( string $namespace = null )`

  Factory method for creating the client builder

- `public` `__construct ( string $namespace = null )`

  Constructs a client builder

- `public` `setConfig ( array|Collection $config )`

  Sets the config options

- `public` `setConfigDefaults ( array|Collection $defaults )`

  Sets the config options' defaults

- `public` `setConfigRequirements ( array|Collection $required )`

  Sets the required config options

- `public` `setExceptionParser ( Aws\Common\Exception\Parser\ExceptionParserInterface $parser )`

  Sets the exception parser. If one is not provided the builder will use the default XML exception parser.

- `public` `setIteratorsConfig ( array $config )`

  Set the configuration for the client's iterators

- `public` `build ( )`

  Performs the building logic using all of the parameters that have been set and falling back to default values. Returns an instantiate service client with credentials prepared and plugins attached.

- `protected` `addBackoffLogger ( Guzzle\Plugin\Backoff\BackoffPlugin $plugin, Guzzle\Common\Collection $config )`

  Add backoff logging to the backoff plugin if needed

- `protected` `processArray ( array|Collection $array )`

  Ensures that an array (e.g. for config data) is actually in array form

- `protected` `updateConfigFromDescription ( Guzzle\Common\Collection $config )`

  Update a configuration object from a service description

- `protected` `getSignature ( Guzzle\Service\Description\ServiceDescription $description, Guzzle\Common\Collection $config )`

  Return an appropriate signature object for a a client based on the "signature" configuration setting, or the default signature specified in a service description. The signature can be set to a valid signature version identifier string or an instance of Aws\Common\Signature\SignatureInterface.

- `protected` `getCredentials ( Guzzle\Common\Collection $config )`

## Methods detail

# `public static `Aws\Common\Client\ClientBuilder``
`factory( string $namespace = null )`

Factory method for creating the client builder

#### Parameters

$namespace
  `string`
  $namespace The namespace of the client

#### Returns

``Aws\Common\Client\ClientBuilder``
# `public`
`__construct( string $namespace = null )`

Constructs a client builder

#### Parameters

$namespace
  `string`
  $namespace The namespace of the client

# `public `Aws\Common\Client\ClientBuilder``
`setConfig( array|`Guzzle\Common\Collection` $config )`

Sets the config options

#### Parameters

$config
  `array|`Guzzle\Common\Collection``
  $config The config options

#### Returns

``Aws\Common\Client\ClientBuilder``
# `public `Aws\Common\Client\ClientBuilder``
`setConfigDefaults( array|`Guzzle\Common\Collection` $defaults )`

Sets the config options' defaults

#### Parameters

$defaults
  `array|`Guzzle\Common\Collection``
  $defaults The default values

#### Returns

``Aws\Common\Client\ClientBuilder``
# `public `Aws\Common\Client\ClientBuilder``
`setConfigRequirements( array|`Guzzle\Common\Collection` $required )`

Sets the required config options

#### Parameters

$required
  `array|`Guzzle\Common\Collection``
  $required The required config options

#### Returns

``Aws\Common\Client\ClientBuilder``
# `public `Aws\Common\Client\ClientBuilder``
`setExceptionParser( `Aws\Common\Exception\Parser\ExceptionParserInterface` $parser )`

Sets the exception parser. If one is not provided the builder will use the default XML exception parser.

#### Parameters

$parser
  ``Aws\Common\Exception\Parser\ExceptionParserInterface``
  $parser The exception parser

#### Returns

``Aws\Common\Client\ClientBuilder``
# `public `Aws\Common\Client\ClientBuilder``
`setIteratorsConfig( array $config )`

Set the configuration for the client's iterators

#### Parameters

$config
  `array`
  $config Configuration data for client's iterators

#### Returns

``Aws\Common\Client\ClientBuilder``
# `public `Aws\Common\Client\AwsClientInterface``
`build( )`

Performs the building logic using all of the parameters that have been set and falling back to default values. Returns an instantiate service client with credentials prepared and plugins attached.

#### Returns

``Aws\Common\Client\AwsClientInterface``

#### Throws

``Aws\Common\Exception\InvalidArgumentException``
# `protected`
`addBackoffLogger( `Guzzle\Plugin\Backoff\BackoffPlugin` $plugin, `Guzzle\Common\Collection` $config )`

Add backoff logging to the backoff plugin if needed

#### Parameters

$plugin
  ``Guzzle\Plugin\Backoff\BackoffPlugin``
  $plugin Backoff plugin
$config
  ``Guzzle\Common\Collection``
  $config Configuration settings

#### Throws

``Aws\Common\Exception\InvalidArgumentException``
# `protected array`
`processArray( array|`Guzzle\Common\Collection` $array )`

Ensures that an array (e.g. for config data) is actually in array form

#### Parameters

$array
  `array|`Guzzle\Common\Collection``
  $array The array data

#### Returns

`array`

#### Throws

``Aws\Common\Exception\InvalidArgumentException``
if the arg is not an array or Collection
# `protected `Guzzle\Service\Description\ServiceDescription``
`updateConfigFromDescription( `Guzzle\Common\Collection` $config )`

Update a configuration object from a service description

#### Parameters

$config
  ``Guzzle\Common\Collection``
  $config Config to update

#### Returns

``Guzzle\Service\Description\ServiceDescription``

#### Throws

``Aws\Common\Exception\InvalidArgumentException``
# `protected `Aws\Common\Signature\SignatureInterface``
`getSignature( `Guzzle\Service\Description\ServiceDescription` $description, `Guzzle\Common\Collection` $config )`

Return an appropriate signature object for a a client based on the "signature" configuration setting, or the default signature specified in a service description. The signature can be set to a valid signature version identifier string or an instance of Aws\Common\Signature\SignatureInterface.

#### Parameters

$description
  ``Guzzle\Service\Description\ServiceDescription``
  $description Description that holds a signature option
$config
  ``Guzzle\Common\Collection``
  $config Configuration options

#### Returns

``Aws\Common\Signature\SignatureInterface``

#### Throws

``Aws\Common\Exception\InvalidArgumentException``
# `protected`
`getCredentials( `Guzzle\Common\Collection` $config )`

### Magic methods summary

## Properties summary

`protected static array` | $commonConfigDefaults | # Default client config
`protected static array` | $commonConfigRequirements | # Default client requirements
`protected string` | $clientNamespace | # The namespace of the client
`protected array` | $config | # The config options
`protected array` | $configDefaults | # The config defaults
`protected array` | $configRequirements | # The config requirements
`protected `Aws\Common\Exception\Parser\ExceptionParserInterface`` | $exceptionParser | # The Parser interface for the client
`protected array` | $iteratorsConfig | # Array of configuration data for iterators available for the client