@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 |
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. |
PathParameterWithOptions |
An object that can be passed as a path parameter, allowing for additional options to be set relating to how the parameter is encoded. |
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 |
RequestParameters |
Shape of the default request parameters, this may be overridden 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
add |
Adds a credential policy to the pipeline if a credential is provided. If none is provided, no policy is added. |
create |
Creates a rest error from a PathUnchecked response |
create |
Creates a rest error from an error message and a PathUnchecked response |
get |
Creates a client with a default pipeline |
get |
Creates a client with a default pipeline |
operation |
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
- response
- PathUncheckedResponse
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
- response
- PathUncheckedResponse
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
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