/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { setContinuationToken } from "../pagingHelper"; import { LiveEvents } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureMediaServices } from "../azureMediaServices"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { LiveEvent, LiveEventsListNextOptionalParams, LiveEventsListOptionalParams, LiveEventsListResponse, LiveEventsGetOptionalParams, LiveEventsGetResponse, LiveEventsCreateOptionalParams, LiveEventsCreateResponse, LiveEventsUpdateOptionalParams, LiveEventsUpdateResponse, LiveEventsDeleteOptionalParams, LiveEventsAllocateOptionalParams, LiveEventsStartOptionalParams, LiveEventActionInput, LiveEventsStopOptionalParams, LiveEventsResetOptionalParams, LiveEventsAsyncOperationOptionalParams, LiveEventsAsyncOperationResponse, LiveEventsOperationLocationOptionalParams, LiveEventsOperationLocationResponse, LiveEventsListNextResponse } from "../models"; /// /** Class containing LiveEvents operations. */ export class LiveEventsImpl implements LiveEvents { private readonly client: AzureMediaServices; /** * Initialize a new instance of the class LiveEvents class. * @param client Reference to the service client */ constructor(client: AzureMediaServices) { this.client = client; } /** * Lists all the live events in the account. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param options The options parameters. */ public list( resourceGroupName: string, accountName: string, options?: LiveEventsListOptionalParams ): PagedAsyncIterableIterator { const iter = this.listPagingAll(resourceGroupName, accountName, options); return { next() { return iter.next(); }, [Symbol.asyncIterator]() { return this; }, byPage: (settings?: PageSettings) => { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage( resourceGroupName, accountName, options, settings ); } }; } private async *listPagingPage( resourceGroupName: string, accountName: string, options?: LiveEventsListOptionalParams, settings?: PageSettings ): AsyncIterableIterator { let result: LiveEventsListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { result = await this._list(resourceGroupName, accountName, options); let page = result.value || []; continuationToken = result.odataNextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { result = await this._listNext( resourceGroupName, accountName, continuationToken, options ); continuationToken = result.odataNextLink; let page = result.value || []; setContinuationToken(page, continuationToken); yield page; } } private async *listPagingAll( resourceGroupName: string, accountName: string, options?: LiveEventsListOptionalParams ): AsyncIterableIterator { for await (const page of this.listPagingPage( resourceGroupName, accountName, options )) { yield* page; } } /** * Lists all the live events in the account. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param options The options parameters. */ private _list( resourceGroupName: string, accountName: string, options?: LiveEventsListOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, options }, listOperationSpec ); } /** * Gets properties of a live event. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param options The options parameters. */ get( resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsGetOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, liveEventName, options }, getOperationSpec ); } /** * Creates a new live event. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param parameters Live event properties needed for creation. * @param options The options parameters. */ async beginCreate( resourceGroupName: string, accountName: string, liveEventName: string, parameters: LiveEvent, options?: LiveEventsCreateOptionalParams ): Promise< PollerLike< PollOperationState, LiveEventsCreateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { let currentRawResponse: | coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); }; const updatedArgs = { ...args, options: { ...args.options, onResponse: callback } }; const flatResponse = await directSendOperation(updatedArgs, spec); return { flatResponse, rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, headers: currentRawResponse!.headers.toJSON() } }; }; const lro = new LroImpl( sendOperation, { resourceGroupName, accountName, liveEventName, parameters, options }, createOperationSpec ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); return poller; } /** * Creates a new live event. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param parameters Live event properties needed for creation. * @param options The options parameters. */ async beginCreateAndWait( resourceGroupName: string, accountName: string, liveEventName: string, parameters: LiveEvent, options?: LiveEventsCreateOptionalParams ): Promise { const poller = await this.beginCreate( resourceGroupName, accountName, liveEventName, parameters, options ); return poller.pollUntilDone(); } /** * Updates settings on an existing live event. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param parameters Live event properties needed for patch. * @param options The options parameters. */ async beginUpdate( resourceGroupName: string, accountName: string, liveEventName: string, parameters: LiveEvent, options?: LiveEventsUpdateOptionalParams ): Promise< PollerLike< PollOperationState, LiveEventsUpdateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { let currentRawResponse: | coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); }; const updatedArgs = { ...args, options: { ...args.options, onResponse: callback } }; const flatResponse = await directSendOperation(updatedArgs, spec); return { flatResponse, rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, headers: currentRawResponse!.headers.toJSON() } }; }; const lro = new LroImpl( sendOperation, { resourceGroupName, accountName, liveEventName, parameters, options }, updateOperationSpec ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); return poller; } /** * Updates settings on an existing live event. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param parameters Live event properties needed for patch. * @param options The options parameters. */ async beginUpdateAndWait( resourceGroupName: string, accountName: string, liveEventName: string, parameters: LiveEvent, options?: LiveEventsUpdateOptionalParams ): Promise { const poller = await this.beginUpdate( resourceGroupName, accountName, liveEventName, parameters, options ); return poller.pollUntilDone(); } /** * Deletes a live event. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param options The options parameters. */ async beginDelete( resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsDeleteOptionalParams ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { let currentRawResponse: | coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); }; const updatedArgs = { ...args, options: { ...args.options, onResponse: callback } }; const flatResponse = await directSendOperation(updatedArgs, spec); return { flatResponse, rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, headers: currentRawResponse!.headers.toJSON() } }; }; const lro = new LroImpl( sendOperation, { resourceGroupName, accountName, liveEventName, options }, deleteOperationSpec ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); return poller; } /** * Deletes a live event. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param options The options parameters. */ async beginDeleteAndWait( resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsDeleteOptionalParams ): Promise { const poller = await this.beginDelete( resourceGroupName, accountName, liveEventName, options ); return poller.pollUntilDone(); } /** * A live event is in StandBy state after allocation completes, and is ready to start. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param options The options parameters. */ async beginAllocate( resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsAllocateOptionalParams ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { let currentRawResponse: | coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); }; const updatedArgs = { ...args, options: { ...args.options, onResponse: callback } }; const flatResponse = await directSendOperation(updatedArgs, spec); return { flatResponse, rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, headers: currentRawResponse!.headers.toJSON() } }; }; const lro = new LroImpl( sendOperation, { resourceGroupName, accountName, liveEventName, options }, allocateOperationSpec ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); return poller; } /** * A live event is in StandBy state after allocation completes, and is ready to start. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param options The options parameters. */ async beginAllocateAndWait( resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsAllocateOptionalParams ): Promise { const poller = await this.beginAllocate( resourceGroupName, accountName, liveEventName, options ); return poller.pollUntilDone(); } /** * A live event in Stopped or StandBy state will be in Running state after the start operation * completes. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param options The options parameters. */ async beginStart( resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsStartOptionalParams ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { let currentRawResponse: | coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); }; const updatedArgs = { ...args, options: { ...args.options, onResponse: callback } }; const flatResponse = await directSendOperation(updatedArgs, spec); return { flatResponse, rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, headers: currentRawResponse!.headers.toJSON() } }; }; const lro = new LroImpl( sendOperation, { resourceGroupName, accountName, liveEventName, options }, startOperationSpec ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); return poller; } /** * A live event in Stopped or StandBy state will be in Running state after the start operation * completes. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param options The options parameters. */ async beginStartAndWait( resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsStartOptionalParams ): Promise { const poller = await this.beginStart( resourceGroupName, accountName, liveEventName, options ); return poller.pollUntilDone(); } /** * Stops a running live event. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param parameters LiveEvent stop parameters * @param options The options parameters. */ async beginStop( resourceGroupName: string, accountName: string, liveEventName: string, parameters: LiveEventActionInput, options?: LiveEventsStopOptionalParams ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { let currentRawResponse: | coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); }; const updatedArgs = { ...args, options: { ...args.options, onResponse: callback } }; const flatResponse = await directSendOperation(updatedArgs, spec); return { flatResponse, rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, headers: currentRawResponse!.headers.toJSON() } }; }; const lro = new LroImpl( sendOperation, { resourceGroupName, accountName, liveEventName, parameters, options }, stopOperationSpec ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); return poller; } /** * Stops a running live event. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param parameters LiveEvent stop parameters * @param options The options parameters. */ async beginStopAndWait( resourceGroupName: string, accountName: string, liveEventName: string, parameters: LiveEventActionInput, options?: LiveEventsStopOptionalParams ): Promise { const poller = await this.beginStop( resourceGroupName, accountName, liveEventName, parameters, options ); return poller.pollUntilDone(); } /** * Resets an existing live event. All live outputs for the live event are deleted and the live event is * stopped and will be started again. All assets used by the live outputs and streaming locators * created on these assets are unaffected. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param options The options parameters. */ async beginReset( resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsResetOptionalParams ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { let currentRawResponse: | coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, flatResponse: unknown ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); }; const updatedArgs = { ...args, options: { ...args.options, onResponse: callback } }; const flatResponse = await directSendOperation(updatedArgs, spec); return { flatResponse, rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, headers: currentRawResponse!.headers.toJSON() } }; }; const lro = new LroImpl( sendOperation, { resourceGroupName, accountName, liveEventName, options }, resetOperationSpec ); const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); return poller; } /** * Resets an existing live event. All live outputs for the live event are deleted and the live event is * stopped and will be started again. All assets used by the live outputs and streaming locators * created on these assets are unaffected. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param options The options parameters. */ async beginResetAndWait( resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsResetOptionalParams ): Promise { const poller = await this.beginReset( resourceGroupName, accountName, liveEventName, options ); return poller.pollUntilDone(); } /** * Get a live event operation status. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param operationId The ID of an ongoing async operation. * @param options The options parameters. */ asyncOperation( resourceGroupName: string, accountName: string, operationId: string, options?: LiveEventsAsyncOperationOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, operationId, options }, asyncOperationOperationSpec ); } /** * Get a live event operation status. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param liveEventName The name of the live event, maximum length is 32. * @param operationId The ID of an ongoing async operation. * @param options The options parameters. */ operationLocation( resourceGroupName: string, accountName: string, liveEventName: string, operationId: string, options?: LiveEventsOperationLocationOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, liveEventName, operationId, options }, operationLocationOperationSpec ); } /** * ListNext * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( resourceGroupName: string, accountName: string, nextLink: string, options?: LiveEventsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, nextLink, options }, listNextOperationSpec ); } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.LiveEventListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName ], headerParameters: [Parameters.accept], serializer }; const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.LiveEvent }, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.liveEventName ], headerParameters: [Parameters.accept], serializer }; const createOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.LiveEvent }, 201: { bodyMapper: Mappers.LiveEvent }, 202: { bodyMapper: Mappers.LiveEvent }, 204: { bodyMapper: Mappers.LiveEvent }, default: { bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters16, queryParameters: [Parameters.apiVersion, Parameters.autoStart], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.liveEventName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; const updateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.LiveEvent }, 201: { bodyMapper: Mappers.LiveEvent }, 202: { bodyMapper: Mappers.LiveEvent }, 204: { bodyMapper: Mappers.LiveEvent }, default: { bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters16, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.liveEventName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; const deleteOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}", httpMethod: "DELETE", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.liveEventName ], headerParameters: [Parameters.accept], serializer }; const allocateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/allocate", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.liveEventName ], headerParameters: [Parameters.accept], serializer }; const startOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/start", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.liveEventName ], headerParameters: [Parameters.accept], serializer }; const stopOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/stop", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters17, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.liveEventName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; const resetOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/reset", httpMethod: "POST", responses: { 200: {}, 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.liveEventName ], headerParameters: [Parameters.accept], serializer }; const asyncOperationOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEventOperations/{operationId}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.AsyncOperationResult }, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.operationId1 ], headerParameters: [Parameters.accept], serializer }; const operationLocationOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/operationLocations/{operationId}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.LiveEvent }, 202: {}, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.liveEventName, Parameters.operationId1 ], headerParameters: [Parameters.accept], serializer }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.LiveEventListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, Parameters.nextLink ], headerParameters: [Parameters.accept], serializer };