Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* @returns Promise
*/
beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName: string, body: Models.SubscriptionCreationParameters, options?: msRest.RequestOptionsBase): Promise {
return this.client.sendLRORequest(
{
enrollmentAccountName,
body,
options
},
beginCreateSubscriptionInEnrollmentAccountOperationSpec,
options);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const beginCreateSubscriptionInEnrollmentAccountOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountName}/providers/Microsoft.Subscription/createSubscription",
urlParameters: [
Parameters.enrollmentAccountName
],
queryParameters: [
Parameters.apiVersion0
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "body",
mapper: {
...Mappers.SubscriptionCreationParameters,
*/
beginDownload(resourceGroupName: string, virtualWANName: string, request: Models.GetVpnSitesConfigurationRequest, options?: msRest.RequestOptionsBase): Promise {
return this.client.sendLRORequest(
{
resourceGroupName,
virtualWANName,
request,
options
},
beginDownloadOperationSpec,
options);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const beginDownloadOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.virtualWANName0
],
queryParameters: [
Parameters.apiVersion0
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "request",
* @returns Promise
*/
beginCreateSubscriptionInEnrollmentAccount(enrollmentAccountName: string, body: Models.SubscriptionCreationParameters, options?: msRest.RequestOptionsBase): Promise {
return this.client.sendLRORequest(
{
enrollmentAccountName,
body,
options
},
beginCreateSubscriptionInEnrollmentAccountOperationSpec,
options);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const beginCreateSubscriptionOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Subscription/createSubscription",
urlParameters: [
Parameters.billingAccountName,
Parameters.invoiceSectionName
],
queryParameters: [
Parameters.apiVersion2
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "body",
mapper: {
* @returns Promise
*/
beginExportThrottledRequests(parameters: Models.ThrottledRequestsInput, location: string, options?: msRest.RequestOptionsBase): Promise {
return this.client.sendLRORequest(
{
parameters,
location,
options
},
beginExportThrottledRequestsOperationSpec,
options);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const beginExportRequestRateByIntervalOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval",
urlParameters: [
Parameters.location1,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion0
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "parameters",
mapper: {
spec: msRest.OperationSpec,
handlerResponse: any,
logger: ILogger
): Promise {
const statusCodeInResponse: number = handlerResponse.statusCode;
res.setStatusCode(statusCodeInResponse);
const responseSpec = spec.responses[statusCodeInResponse];
if (!responseSpec) {
throw new TypeError(
`Request specification doesn't include provided response status code`
);
}
// Serialize headers
const headerSerializer = new msRest.Serializer(Mappers);
const headersMapper = responseSpec.headersMapper;
if (headersMapper && headersMapper.type.name === "Composite") {
const mappersForAllHeaders = headersMapper.type.modelProperties || {};
// Handle headerMapper one by one
for (const key in mappersForAllHeaders) {
if (mappersForAllHeaders.hasOwnProperty(key)) {
const headerMapper = mappersForAllHeaders[key];
const headerName = headerMapper.serializedName;
const headerValueOriginal = handlerResponse[key];
const headerValueSerialized = headerSerializer.serialize(
headerMapper,
headerValueOriginal
);
// Handle collection of headers starting with same prefix, such as x-ms-meta prefix
*/
beginPurgeContent(resourceGroupName: string, frontDoorName: string, contentFilePaths: Models.PurgeParameters, options?: msRest.RequestOptionsBase): Promise {
return this.client.sendLRORequest(
{
resourceGroupName,
frontDoorName,
contentFilePaths,
options
},
beginPurgeContentOperationSpec,
options);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const beginPurgeContentOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/purge",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName0,
Parameters.frontDoorName
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "contentFilePaths",
*/
beginCreate(resourceGroupName: string, managedInstanceName: string, parameters: Models.TdeCertificate, options?: msRest.RequestOptionsBase): Promise {
return this.client.sendLRORequest(
{
resourceGroupName,
managedInstanceName,
parameters,
options
},
beginCreateOperationSpec,
options);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const beginCreateOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates",
urlParameters: [
Parameters.resourceGroupName,
Parameters.managedInstanceName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion2
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "parameters",
*/
beginCreate(resourceGroupName: string, serverName: string, parameters: Models.TdeCertificate, options?: msRest.RequestOptionsBase): Promise {
return this.client.sendLRORequest(
{
resourceGroupName,
serverName,
parameters,
options
},
beginCreateOperationSpec,
options);
}
}
// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const beginCreateOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates",
urlParameters: [
Parameters.resourceGroupName,
Parameters.serverName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion2
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "parameters",
const context = new BlobStorageContext(res.locals, DEFAULT_CONTEXT_PATH);
const handlerResponse = context.handlerResponses;
if (handlerResponse && context.operation) {
const statusCodeInResponse: number = handlerResponse.statusCode;
const spec = Specifications[context.operation];
const responseSpec = spec.responses[statusCodeInResponse];
if (!responseSpec) {
throw new TypeError(
`Request specification doesn't include provided response status code`
);
}
// Serialize headers
const headerSerializer = new msRest.Serializer(Mappers);
const headersMapper = responseSpec.headersMapper;
if (headersMapper && headersMapper.type.name === "Composite") {
const mappersForAllHeaders = headersMapper.type.modelProperties || {};
// Handle headerMapper one by one
for (const key in mappersForAllHeaders) {
if (mappersForAllHeaders.hasOwnProperty(key)) {
const headerMapper = mappersForAllHeaders[key];
const headerName = headerMapper.serializedName;
const headerValueOriginal = handlerResponse[key];
const headerValueSerialized = headerSerializer.serialize(
headerMapper,
headerValueOriginal
);
serializedName: "date",
required: true,
type: {
name: "DateTime"
}
}
}
}
}
},
201: {},
default: {
bodyMapper: CloudErrorMapper
}
},
serializer: new Serializer()
};
const lroPoller: LROPoller = await serviceClient.sendLRORequest(operationArguments, operationSpec, options);
assert.strictEqual(lroPoller.isFinished(), false);
assert.strictEqual(lroPoller.isFinalStatusAcceptable(), undefined);
assert.strictEqual(lroPoller.getOperationStatus(), "InProgress");
assert.strictEqual(await lroPoller.getOperationResponse(), undefined);
assert.strictEqual(lroPoller.getMostRecentResponse().request.url, "https://fake.azure.com/longRunningOperation");
assert.strictEqual(lroPoller.getMostRecentResponse().request.headers.get("x-ms-client-request-id"), requestId);
assert.strictEqual(await lroPoller.poll(), "Succeeded");
assert.strictEqual(lroPoller.isFinished(), true);
assert.strictEqual(lroPoller.isFinalStatusAcceptable(), true);
assert.strictEqual(lroPoller.getOperationStatus(), "Succeeded");
assert.strictEqual(lroPoller.getMostRecentResponse().request.url, "https://fake.azure.com/longRunningOperation2");