NAME

Azure::SDK::Core::ClientOptions - shared client configuration and pipeline factory

SYNOPSIS

my $options = Azure::SDK::Core::ClientOptions->new(
    api_version => '2025-01-05',
    credential  => $credential,
    logger      => sub ($line) { warn "$line\n" },
);

my $pipeline = $options->build_pipeline;

DESCRIPTION

Azure::SDK::Core::ClientOptions holds the configuration every client shares: API version, diagnostics, user-agent, retry tuning, default headers, transport, credential, and any custom policies. Its build_pipeline method assembles a default pipeline with sensible policy ordering so service clients do not have to wire the pipeline by hand.

Default pipeline ordering

  1. Headers (per-call)

  2. Telemetry (per-call)

  3. Diagnostics (per-call)

  4. Custom per-call policies

  5. Retry (the per-try boundary)

  6. Custom per-try policies

  7. Credential (per-try, only when a credential is configured)

CONSTRUCTOR

new

Named parameters (all optional):

api_version

Service API version. Defaults to 2026-05-08-preview.

diagnostics_enabled

Whether the diagnostics policy emits log lines. Defaults to true.

user_agent

User-agent string. Defaults to azure-sdk-perl/$VERSION.

max_retries

Maximum retry attempts. Defaults to 3.

base_delay

Base retry backoff in seconds. Defaults to 0.5.

default_headers

Hashref of headers applied to every request. Defaults to empty.

max_response_bytes

Maximum response body size buffered by the default Azure::SDK::Core::Transport::Default transport. Defaults to 64 MiB. When a response exceeds the cap, the transport throws Azure::SDK::Core::Error with code set to ResponseTooLarge and a message that names the configured cap. Set to 0 to disable the cap for workloads that intentionally buffer larger responses.

transport

Transport implementation. Defaults to a new Azure::SDK::Core::Transport::Default. max_response_bytes is applied when this default transport is created; custom transports are responsible for their own response-size behavior.

credential

Optional Azure::SDK::Core::Credential. When set, a credential policy is added to the per-try stage.

logger

Optional coderef passed to the diagnostics policy.

per_call_policies

Optional arrayref of extra per-call policies inserted before the retry boundary.

per_try_policies

Optional arrayref of extra per-try policies inserted after the retry boundary.

METHODS

build_pipeline

Returns an Azure::SDK::Core::Pipeline wired with the default policy ordering.

SEE ALSO

Azure::SDK::Core::Pipeline, Azure::SDK::Core