/*
* 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 { Namespaces } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { EventHubManagementClient } from "../eventHubManagementClient";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
EHNamespace,
NamespacesListNextOptionalParams,
NamespacesListOptionalParams,
NamespacesListResponse,
NamespacesListByResourceGroupNextOptionalParams,
NamespacesListByResourceGroupOptionalParams,
NamespacesListByResourceGroupResponse,
AuthorizationRule,
NamespacesListAuthorizationRulesNextOptionalParams,
NamespacesListAuthorizationRulesOptionalParams,
NamespacesListAuthorizationRulesResponse,
NamespacesCreateOrUpdateOptionalParams,
NamespacesCreateOrUpdateResponse,
NamespacesDeleteOptionalParams,
NamespacesGetOptionalParams,
NamespacesGetResponse,
NamespacesUpdateOptionalParams,
NamespacesUpdateResponse,
NamespacesCreateOrUpdateAuthorizationRuleOptionalParams,
NamespacesCreateOrUpdateAuthorizationRuleResponse,
NamespacesDeleteAuthorizationRuleOptionalParams,
NamespacesGetAuthorizationRuleOptionalParams,
NamespacesGetAuthorizationRuleResponse,
NamespacesListKeysOptionalParams,
NamespacesListKeysResponse,
RegenerateAccessKeyParameters,
NamespacesRegenerateKeysOptionalParams,
NamespacesRegenerateKeysResponse,
CheckNameAvailabilityParameter,
NamespacesCheckNameAvailabilityOptionalParams,
NamespacesCheckNameAvailabilityResponse,
NamespacesListNextResponse,
NamespacesListByResourceGroupNextResponse,
NamespacesListAuthorizationRulesNextResponse
} from "../models";
///
/** Class containing Namespaces operations. */
export class NamespacesImpl implements Namespaces {
private readonly client: EventHubManagementClient;
/**
* Initialize a new instance of the class Namespaces class.
* @param client Reference to the service client
*/
constructor(client: EventHubManagementClient) {
this.client = client;
}
/**
* Lists all the available Namespaces within a subscription, irrespective of the resource groups.
* @param options The options parameters.
*/
public list(
options?: NamespacesListOptionalParams
): PagedAsyncIterableIterator {
const iter = this.listPagingAll(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(options, settings);
}
};
}
private async *listPagingPage(
options?: NamespacesListOptionalParams,
settings?: PageSettings
): AsyncIterableIterator {
let result: NamespacesListResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._list(options);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listNext(continuationToken, options);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listPagingAll(
options?: NamespacesListOptionalParams
): AsyncIterableIterator {
for await (const page of this.listPagingPage(options)) {
yield* page;
}
}
/**
* Lists the available Namespaces within a resource group.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param options The options parameters.
*/
public listByResourceGroup(
resourceGroupName: string,
options?: NamespacesListByResourceGroupOptionalParams
): PagedAsyncIterableIterator {
const iter = this.listByResourceGroupPagingAll(resourceGroupName, 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.listByResourceGroupPagingPage(
resourceGroupName,
options,
settings
);
}
};
}
private async *listByResourceGroupPagingPage(
resourceGroupName: string,
options?: NamespacesListByResourceGroupOptionalParams,
settings?: PageSettings
): AsyncIterableIterator {
let result: NamespacesListByResourceGroupResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listByResourceGroup(resourceGroupName, options);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listByResourceGroupNext(
resourceGroupName,
continuationToken,
options
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listByResourceGroupPagingAll(
resourceGroupName: string,
options?: NamespacesListByResourceGroupOptionalParams
): AsyncIterableIterator {
for await (const page of this.listByResourceGroupPagingPage(
resourceGroupName,
options
)) {
yield* page;
}
}
/**
* Gets a list of authorization rules for a Namespace.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param options The options parameters.
*/
public listAuthorizationRules(
resourceGroupName: string,
namespaceName: string,
options?: NamespacesListAuthorizationRulesOptionalParams
): PagedAsyncIterableIterator {
const iter = this.listAuthorizationRulesPagingAll(
resourceGroupName,
namespaceName,
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.listAuthorizationRulesPagingPage(
resourceGroupName,
namespaceName,
options,
settings
);
}
};
}
private async *listAuthorizationRulesPagingPage(
resourceGroupName: string,
namespaceName: string,
options?: NamespacesListAuthorizationRulesOptionalParams,
settings?: PageSettings
): AsyncIterableIterator {
let result: NamespacesListAuthorizationRulesResponse;
let continuationToken = settings?.continuationToken;
if (!continuationToken) {
result = await this._listAuthorizationRules(
resourceGroupName,
namespaceName,
options
);
let page = result.value || [];
continuationToken = result.nextLink;
setContinuationToken(page, continuationToken);
yield page;
}
while (continuationToken) {
result = await this._listAuthorizationRulesNext(
resourceGroupName,
namespaceName,
continuationToken,
options
);
continuationToken = result.nextLink;
let page = result.value || [];
setContinuationToken(page, continuationToken);
yield page;
}
}
private async *listAuthorizationRulesPagingAll(
resourceGroupName: string,
namespaceName: string,
options?: NamespacesListAuthorizationRulesOptionalParams
): AsyncIterableIterator {
for await (const page of this.listAuthorizationRulesPagingPage(
resourceGroupName,
namespaceName,
options
)) {
yield* page;
}
}
/**
* Lists all the available Namespaces within a subscription, irrespective of the resource groups.
* @param options The options parameters.
*/
private _list(
options?: NamespacesListOptionalParams
): Promise {
return this.client.sendOperationRequest({ options }, listOperationSpec);
}
/**
* Lists the available Namespaces within a resource group.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param options The options parameters.
*/
private _listByResourceGroup(
resourceGroupName: string,
options?: NamespacesListByResourceGroupOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, options },
listByResourceGroupOperationSpec
);
}
/**
* Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This
* operation is idempotent.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param parameters Parameters for creating a namespace resource.
* @param options The options parameters.
*/
async beginCreateOrUpdate(
resourceGroupName: string,
namespaceName: string,
parameters: EHNamespace,
options?: NamespacesCreateOrUpdateOptionalParams
): Promise<
PollerLike<
PollOperationState,
NamespacesCreateOrUpdateResponse
>
> {
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, namespaceName, parameters, options },
createOrUpdateOperationSpec
);
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs
});
await poller.poll();
return poller;
}
/**
* Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This
* operation is idempotent.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param parameters Parameters for creating a namespace resource.
* @param options The options parameters.
*/
async beginCreateOrUpdateAndWait(
resourceGroupName: string,
namespaceName: string,
parameters: EHNamespace,
options?: NamespacesCreateOrUpdateOptionalParams
): Promise {
const poller = await this.beginCreateOrUpdate(
resourceGroupName,
namespaceName,
parameters,
options
);
return poller.pollUntilDone();
}
/**
* Deletes an existing namespace. This operation also removes all associated resources under the
* namespace.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param options The options parameters.
*/
async beginDelete(
resourceGroupName: string,
namespaceName: string,
options?: NamespacesDeleteOptionalParams
): 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, namespaceName, options },
deleteOperationSpec
);
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs
});
await poller.poll();
return poller;
}
/**
* Deletes an existing namespace. This operation also removes all associated resources under the
* namespace.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param options The options parameters.
*/
async beginDeleteAndWait(
resourceGroupName: string,
namespaceName: string,
options?: NamespacesDeleteOptionalParams
): Promise {
const poller = await this.beginDelete(
resourceGroupName,
namespaceName,
options
);
return poller.pollUntilDone();
}
/**
* Gets the description of the specified namespace.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param options The options parameters.
*/
get(
resourceGroupName: string,
namespaceName: string,
options?: NamespacesGetOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, namespaceName, options },
getOperationSpec
);
}
/**
* Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This
* operation is idempotent.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param parameters Parameters for updating a namespace resource.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
namespaceName: string,
parameters: EHNamespace,
options?: NamespacesUpdateOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, namespaceName, parameters, options },
updateOperationSpec
);
}
/**
* Gets a list of authorization rules for a Namespace.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param options The options parameters.
*/
private _listAuthorizationRules(
resourceGroupName: string,
namespaceName: string,
options?: NamespacesListAuthorizationRulesOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, namespaceName, options },
listAuthorizationRulesOperationSpec
);
}
/**
* Creates or updates an AuthorizationRule for a Namespace.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param authorizationRuleName The authorization rule name.
* @param parameters The shared access AuthorizationRule.
* @param options The options parameters.
*/
createOrUpdateAuthorizationRule(
resourceGroupName: string,
namespaceName: string,
authorizationRuleName: string,
parameters: AuthorizationRule,
options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams
): Promise {
return this.client.sendOperationRequest(
{
resourceGroupName,
namespaceName,
authorizationRuleName,
parameters,
options
},
createOrUpdateAuthorizationRuleOperationSpec
);
}
/**
* Deletes an AuthorizationRule for a Namespace.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param authorizationRuleName The authorization rule name.
* @param options The options parameters.
*/
deleteAuthorizationRule(
resourceGroupName: string,
namespaceName: string,
authorizationRuleName: string,
options?: NamespacesDeleteAuthorizationRuleOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, namespaceName, authorizationRuleName, options },
deleteAuthorizationRuleOperationSpec
);
}
/**
* Gets an AuthorizationRule for a Namespace by rule name.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param authorizationRuleName The authorization rule name.
* @param options The options parameters.
*/
getAuthorizationRule(
resourceGroupName: string,
namespaceName: string,
authorizationRuleName: string,
options?: NamespacesGetAuthorizationRuleOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, namespaceName, authorizationRuleName, options },
getAuthorizationRuleOperationSpec
);
}
/**
* Gets the primary and secondary connection strings for the Namespace.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param authorizationRuleName The authorization rule name.
* @param options The options parameters.
*/
listKeys(
resourceGroupName: string,
namespaceName: string,
authorizationRuleName: string,
options?: NamespacesListKeysOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, namespaceName, authorizationRuleName, options },
listKeysOperationSpec
);
}
/**
* Regenerates the primary or secondary connection strings for the specified Namespace.
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param authorizationRuleName The authorization rule name.
* @param parameters Parameters required to regenerate the connection string.
* @param options The options parameters.
*/
regenerateKeys(
resourceGroupName: string,
namespaceName: string,
authorizationRuleName: string,
parameters: RegenerateAccessKeyParameters,
options?: NamespacesRegenerateKeysOptionalParams
): Promise {
return this.client.sendOperationRequest(
{
resourceGroupName,
namespaceName,
authorizationRuleName,
parameters,
options
},
regenerateKeysOperationSpec
);
}
/**
* Check the give Namespace name availability.
* @param parameters Parameters to check availability of the given Namespace name
* @param options The options parameters.
*/
checkNameAvailability(
parameters: CheckNameAvailabilityParameter,
options?: NamespacesCheckNameAvailabilityOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ parameters, options },
checkNameAvailabilityOperationSpec
);
}
/**
* ListNext
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
private _listNext(
nextLink: string,
options?: NamespacesListNextOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ nextLink, options },
listNextOperationSpec
);
}
/**
* ListByResourceGroupNext
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
* @param options The options parameters.
*/
private _listByResourceGroupNext(
resourceGroupName: string,
nextLink: string,
options?: NamespacesListByResourceGroupNextOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, nextLink, options },
listByResourceGroupNextOperationSpec
);
}
/**
* ListAuthorizationRulesNext
* @param resourceGroupName Name of the resource group within the azure subscription.
* @param namespaceName The Namespace name
* @param nextLink The nextLink from the previous successful call to the ListAuthorizationRules method.
* @param options The options parameters.
*/
private _listAuthorizationRulesNext(
resourceGroupName: string,
namespaceName: string,
nextLink: string,
options?: NamespacesListAuthorizationRulesNextOptionalParams
): Promise {
return this.client.sendOperationRequest(
{ resourceGroupName, namespaceName, nextLink, options },
listAuthorizationRulesNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.EHNamespaceListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.EHNamespaceListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName
],
headerParameters: [Parameters.accept],
serializer
};
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.EHNamespace
},
201: {
bodyMapper: Mappers.EHNamespace
},
202: {
bodyMapper: Mappers.EHNamespace
},
204: {
bodyMapper: Mappers.EHNamespace
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters1,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}",
httpMethod: "DELETE",
responses: {
200: {},
201: {},
202: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName
],
headerParameters: [Parameters.accept],
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.EHNamespace
},
201: {
bodyMapper: Mappers.EHNamespace
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName
],
headerParameters: [Parameters.accept],
serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.EHNamespace
},
201: {
bodyMapper: Mappers.EHNamespace
},
202: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters1,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const listAuthorizationRulesOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AuthorizationRuleListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion1],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName
],
headerParameters: [Parameters.accept],
serializer
};
const createOrUpdateAuthorizationRuleOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.AuthorizationRule
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters2,
queryParameters: [Parameters.apiVersion1],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName,
Parameters.authorizationRuleName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteAuthorizationRuleOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion1],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName,
Parameters.authorizationRuleName
],
headerParameters: [Parameters.accept],
serializer
};
const getAuthorizationRuleOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AuthorizationRule
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion1],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName,
Parameters.authorizationRuleName
],
headerParameters: [Parameters.accept],
serializer
};
const listKeysOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.AccessKeys
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion1],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName,
Parameters.authorizationRuleName
],
headerParameters: [Parameters.accept],
serializer
};
const regenerateKeysOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.AccessKeys
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters3,
queryParameters: [Parameters.apiVersion1],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.namespaceName,
Parameters.authorizationRuleName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.CheckNameAvailabilityResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters4,
queryParameters: [Parameters.apiVersion1],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.EHNamespaceListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.EHNamespaceListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AuthorizationRuleListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.nextLink,
Parameters.namespaceName
],
headerParameters: [Parameters.accept],
serializer
};