@azure-rest/core-client package

Interfaces

AddCredentialPipelinePolicyOptions

Optional parameters for adding a credential policy to the pipeline.

AdditionalPolicyConfig

Used to configure additional policies added to the pipeline at construction.

Client

Shape of a Rest Level Client

ErrorModel

The error object.

ErrorResponse

A response containing error details.

FullOperationResponse

Wrapper object for http request and response. Deserialized object is stored in the parsedBody property when the response body is received in JSON.

InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

OperationOptions

The base options type for all operations.

OperationRequestOptions

Options used when creating and sending HTTP requests for this operation.

ResourceMethods

Defines the methods that can be called on a resource

Type Aliases

ClientOptions

General options that a Rest Level Client can take

HttpBrowserStreamResponse

Http Response which body is a NodeJS stream object

HttpNodeStreamResponse

Http Response which body is a NodeJS stream object

HttpResponse

Represents the shape of an HttpResponse

PathParameters

Helper type used to detect parameters in a path template text surrounded by {} will be considered a path parameter

PathUnchecked

Defines the signature for pathUnchecked.

PathUncheckedResponse

Type to use with pathUnchecked, overrides the body type to any to allow flexibility

RawResponseCallback

A function to be called each time a response is received from the server while performing the requested operation. May be called multiple times.

This callback will be called with two parameters: the raw response, including headers and response body; and an error object which will be provided if an error was thrown while processing the request. The third __legacyError parameter is provided for backwards compatability only and will have an identical value to the error parameter.

RequestParameters

Shape of the default request parameters, this may be overriden by the specific request types to provide strong types

StreamableMethod

Defines the type for a method that supports getting the response body as a raw stream

Functions

addCredentialPipelinePolicy(Pipeline, string, AddCredentialPipelinePolicyOptions)

Adds a credential policy to the pipeline if a credential is provided. If none is provided, no policy is added.

createRestError(PathUncheckedResponse)

Creates a rest error from a PathUnchecked response

createRestError(string, PathUncheckedResponse)

Creates a rest error from an error message and a PathUnchecked response

getClient(string, ClientOptions)

Creates a client with a default pipeline

getClient(string, TokenCredential | KeyCredential, ClientOptions)

Creates a client with a default pipeline

operationOptionsToRequestParameters(OperationOptions)

Helper function to convert OperationOptions to RequestParameters

Function Details

addCredentialPipelinePolicy(Pipeline, string, AddCredentialPipelinePolicyOptions)

Adds a credential policy to the pipeline if a credential is provided. If none is provided, no policy is added.

function addCredentialPipelinePolicy(pipeline: Pipeline, endpoint: string, options?: AddCredentialPipelinePolicyOptions)

Parameters

pipeline
Pipeline
endpoint

string

createRestError(PathUncheckedResponse)

Creates a rest error from a PathUnchecked response

function createRestError(response: PathUncheckedResponse): RestError

Parameters

Returns

createRestError(string, PathUncheckedResponse)

Creates a rest error from an error message and a PathUnchecked response

function createRestError(message: string, response: PathUncheckedResponse): RestError

Parameters

message

string

Returns

getClient(string, ClientOptions)

Creates a client with a default pipeline

function getClient(endpoint: string, options?: ClientOptions): Client

Parameters

endpoint

string

Base endpoint for the client

options
ClientOptions

Client options

Returns

getClient(string, TokenCredential | KeyCredential, ClientOptions)

Creates a client with a default pipeline

function getClient(endpoint: string, credentials?: TokenCredential | KeyCredential, options?: ClientOptions): Client

Parameters

endpoint

string

Base endpoint for the client

credentials

TokenCredential | KeyCredential

Credentials to authenticate the requests

options
ClientOptions

Client options

Returns

operationOptionsToRequestParameters(OperationOptions)

Helper function to convert OperationOptions to RequestParameters

function operationOptionsToRequestParameters(options: OperationOptions): RequestParameters

Parameters

options
OperationOptions

the options that are used by Modular layer to send the request

Returns

the result of the conversion in RequestParameters of RLC layer