diff --git a/sdk/eventhub/arm-eventhub/src/eventHubManagementClient.ts b/sdk/eventhub/arm-eventhub/src/eventHubManagementClient.ts index 631e78f8bd67..2dbcb24a7551 100644 --- a/sdk/eventhub/arm-eventhub/src/eventHubManagementClient.ts +++ b/sdk/eventhub/arm-eventhub/src/eventHubManagementClient.ts @@ -26,6 +26,7 @@ class EventHubManagementClient extends EventHubManagementClientContext { eventHubs: operations.EventHubs; disasterRecoveryConfigs: operations.DisasterRecoveryConfigs; consumerGroups: operations.ConsumerGroups; + schemaRegistry: operations.SchemaRegistry; /** * Initializes a new instance of the EventHubManagementClient class. @@ -50,6 +51,7 @@ class EventHubManagementClient extends EventHubManagementClientContext { this.eventHubs = new operations.EventHubs(this); this.disasterRecoveryConfigs = new operations.DisasterRecoveryConfigs(this); this.consumerGroups = new operations.ConsumerGroups(this); + this.schemaRegistry = new operations.SchemaRegistry(this); } } diff --git a/sdk/eventhub/arm-eventhub/src/eventHubManagementClientContext.ts b/sdk/eventhub/arm-eventhub/src/eventHubManagementClientContext.ts index 5044f2bbfe83..20bef61fa9c4 100644 --- a/sdk/eventhub/arm-eventhub/src/eventHubManagementClientContext.ts +++ b/sdk/eventhub/arm-eventhub/src/eventHubManagementClientContext.ts @@ -50,7 +50,7 @@ export class EventHubManagementClientContext extends msRestAzure.AzureServiceCli super(credentials, options); - this.apiVersion = '2021-06-01-preview'; + this.apiVersion = '2021-11-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/eventhub/arm-eventhub/src/models/clustersMappers.ts b/sdk/eventhub/arm-eventhub/src/models/clustersMappers.ts index 7a799b246370..0cc309aa590f 100644 --- a/sdk/eventhub/arm-eventhub/src/models/clustersMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/clustersMappers.ts @@ -23,6 +23,8 @@ export { EHNamespaceIdContainer, EHNamespaceIdListResult, Encryption, + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, Eventhub, Identity, @@ -32,7 +34,9 @@ export { NWRuleSetVirtualNetworkRules, PrivateEndpoint, PrivateEndpointConnection, + ProxyResource, Resource, + SchemaGroup, Sku, Subnet, SystemData, diff --git a/sdk/eventhub/arm-eventhub/src/models/configurationMappers.ts b/sdk/eventhub/arm-eventhub/src/models/configurationMappers.ts index 8c1941e74211..cdcf160a5991 100644 --- a/sdk/eventhub/arm-eventhub/src/models/configurationMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/configurationMappers.ts @@ -8,5 +8,7 @@ export { ClusterQuotaConfigurationProperties, + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse } from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub/src/models/consumerGroupsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/consumerGroupsMappers.ts index 51f0891b9749..badcb5ee6ecf 100644 --- a/sdk/eventhub/arm-eventhub/src/models/consumerGroupsMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/consumerGroupsMappers.ts @@ -19,6 +19,8 @@ export { Destination, EHNamespace, Encryption, + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, Eventhub, Identity, @@ -28,7 +30,9 @@ export { NWRuleSetVirtualNetworkRules, PrivateEndpoint, PrivateEndpointConnection, + ProxyResource, Resource, + SchemaGroup, Sku, Subnet, SystemData, diff --git a/sdk/eventhub/arm-eventhub/src/models/disasterRecoveryConfigsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/disasterRecoveryConfigsMappers.ts index f1c6d8bb81f8..b3cf4d7ac430 100644 --- a/sdk/eventhub/arm-eventhub/src/models/disasterRecoveryConfigsMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/disasterRecoveryConfigsMappers.ts @@ -23,6 +23,8 @@ export { Destination, EHNamespace, Encryption, + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, Eventhub, Identity, @@ -32,7 +34,9 @@ export { NWRuleSetVirtualNetworkRules, PrivateEndpoint, PrivateEndpointConnection, + ProxyResource, Resource, + SchemaGroup, Sku, Subnet, SystemData, diff --git a/sdk/eventhub/arm-eventhub/src/models/eventHubsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/eventHubsMappers.ts index 75ff6dcc3354..65dfc1842ad3 100644 --- a/sdk/eventhub/arm-eventhub/src/models/eventHubsMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/eventHubsMappers.ts @@ -20,6 +20,8 @@ export { Destination, EHNamespace, Encryption, + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, Eventhub, EventHubListResult, @@ -30,8 +32,10 @@ export { NWRuleSetVirtualNetworkRules, PrivateEndpoint, PrivateEndpointConnection, + ProxyResource, RegenerateAccessKeyParameters, Resource, + SchemaGroup, Sku, Subnet, SystemData, diff --git a/sdk/eventhub/arm-eventhub/src/models/index.ts b/sdk/eventhub/arm-eventhub/src/models/index.ts index 5cacf8c93e4c..59c9621f151f 100644 --- a/sdk/eventhub/arm-eventhub/src/models/index.ts +++ b/sdk/eventhub/arm-eventhub/src/models/index.ts @@ -31,19 +31,62 @@ export interface AvailableClustersList { value?: AvailableCluster[]; } +/** + * The resource management error additional info. + */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly info?: any; +} + +/** + * The error detail. + */ +export interface ErrorDetail { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The error target. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + /** + * The error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + /** * Error response indicates Event Hub service is not able to process the incoming request. The * reason is provided in the error message. */ export interface ErrorResponse { /** - * Error code. + * The error object. */ - code?: string; - /** - * Error message indicating why the operation failed. - */ - message?: string; + error?: ErrorDetail; } /** @@ -89,21 +132,24 @@ export interface SystemData { } /** - * The resource definition. + * Common fields that are returned in the response for all Azure Resource Manager resources + * @summary Resource */ export interface Resource extends BaseResource { /** - * Resource ID. + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * Resource name. + * The name of the resource * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * Resource type. + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts" * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; @@ -324,10 +370,39 @@ export interface ConnectionState { description?: string; } +/** + * Common fields that are returned in the response for all Azure Resource Manager resources + * @summary Resource + */ +export interface ProxyResource extends BaseResource { + /** + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or + * "Microsoft.EventHub/Namespaces/EventHubs" + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The geo-location where the resource lives + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly location?: string; +} + /** * Properties of the PrivateEndpointConnection. */ -export interface PrivateEndpointConnection extends Resource { +export interface PrivateEndpointConnection extends ProxyResource { /** * The Private Endpoint resource for this Connection. */ @@ -429,6 +504,10 @@ export interface EHNamespace extends TrackedResource { * This property disables SAS authentication for the Event Hubs namespace. */ disableLocalAuth?: boolean; + /** + * Alternate name specified when alias and namespace names are same. + */ + alternateName?: string; } /** @@ -476,24 +555,29 @@ export interface PrivateLinkResourcesListResult { } /** - * The object that represents the operation. + * Operation display payload */ export interface OperationDisplay { /** - * Service provider: Microsoft.EventHub + * Resource provider of the operation * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly provider?: string; /** - * Resource on which the operation is performed: Invoice, etc. + * Resource of the operation * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly resource?: string; /** - * Operation type: Read, write, delete, etc. + * Localized friendly name for the operation * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly operation?: string; + /** + * Localized friendly description for the operation + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; } /** @@ -506,9 +590,21 @@ export interface Operation { */ readonly name?: string; /** - * The object that represents the operation. + * Indicates whether the operation is a data action + */ + isDataAction?: boolean; + /** + * Display of the operation */ display?: OperationDisplay; + /** + * Origin of the operation + */ + origin?: string; + /** + * Properties of the operation + */ + properties?: any; } /** @@ -533,6 +629,18 @@ export interface Destination { * the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order */ archiveNameFormat?: string; + /** + * Subscription Id of Azure Data Lake Store + */ + dataLakeSubscriptionId?: string; + /** + * The Azure Data Lake Store name for the captured events + */ + dataLakeAccountName?: string; + /** + * The destination folder path for the captured events + */ + dataLakeFolderPath?: string; } /** @@ -572,7 +680,7 @@ export interface CaptureDescription { /** * Single item in List or Get Event Hub operation */ -export interface Eventhub extends Resource { +export interface Eventhub extends ProxyResource { /** * Current number of shards on the Event Hub. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -648,7 +756,7 @@ export interface CheckNameAvailabilityResult { /** * Single item in List or Get Alias(Disaster Recovery configuration) operation */ -export interface ArmDisasterRecovery extends Resource { +export interface ArmDisasterRecovery extends ProxyResource { /** * Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' * or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed' @@ -722,7 +830,7 @@ export interface NWRuleSetVirtualNetworkRules { /** * Description of topic resource. */ -export interface NetworkRuleSet extends Resource { +export interface NetworkRuleSet extends ProxyResource { /** * Value that indicates whether Trusted Service Access is Enabled or not. */ @@ -751,10 +859,25 @@ export interface NetworkRuleSet extends Resource { readonly systemData?: SystemData; } +/** + * The response of the List NetworkRuleSet operation + */ +export interface NetworkRuleSetListResult { + /** + * Result of the List NetworkRuleSet operation + */ + value?: NetworkRuleSet[]; + /** + * Link to the next set of results. Not empty if Value contains incomplete list of + * NetworkRuleSet. + */ + nextLink?: string; +} + /** * Single item in a List or Get AuthorizationRule operation */ -export interface AuthorizationRule extends Resource { +export interface AuthorizationRule extends ProxyResource { /** * The rights associated with the rule. */ @@ -826,7 +949,7 @@ export interface RegenerateAccessKeyParameters { /** * Single item in List or Get Consumer group operation */ -export interface ConsumerGroup extends Resource { +export interface ConsumerGroup extends ProxyResource { /** * Exact time the message was created. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -850,6 +973,44 @@ export interface ConsumerGroup extends Resource { readonly systemData?: SystemData; } +/** + * Single item in List or Get Schema Group operation + */ +export interface SchemaGroup extends ProxyResource { + /** + * Exact time the Schema Group was updated + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly updatedAtUtc?: Date; + /** + * Exact time the Schema Group was created. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly createdAtUtc?: Date; + /** + * The ETag value. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly eTag?: string; + /** + * dictionary object for SchemaGroup group properties + */ + groupProperties?: { [propertyName: string]: string }; + /** + * Possible values include: 'None', 'Backward', 'Forward' + */ + schemaCompatibility?: SchemaCompatibility; + /** + * Possible values include: 'Unknown', 'Avro' + */ + schemaType?: SchemaType; + /** + * The system meta data relating to this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; +} + /** * Optional Parameters. */ @@ -914,6 +1075,38 @@ export interface ConsumerGroupsListByEventHubNextOptionalParams extends msRest.R top?: number; } +/** + * Optional Parameters. + */ +export interface SchemaRegistryListByNamespaceOptionalParams extends msRest.RequestOptionsBase { + /** + * Skip is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + */ + skip?: number; + /** + * May be used to limit the number of results to the most recent N usageDetails. + */ + top?: number; +} + +/** + * Optional Parameters. + */ +export interface SchemaRegistryListByNamespaceNextOptionalParams extends msRest.RequestOptionsBase { + /** + * Skip is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skip parameter + * that specifies a starting point to use for subsequent calls. + */ + skip?: number; + /** + * May be used to limit the number of results to the most recent N usageDetails. + */ + top?: number; +} + /** * An interface representing EventHubManagementClientOptions. */ @@ -1023,6 +1216,18 @@ export interface ConsumerGroupListResult extends Array { nextLink?: string; } +/** + * @interface + * The result of the List SchemaGroup operation. + * @extends Array + */ +export interface SchemaGroupListResult extends Array { + /** + * Link to the next set of results. Not empty if Value contains incomplete list of Schema Groups. + */ + nextLink?: string; +} + /** * Defines values for CreatedByType. * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' @@ -1162,6 +1367,22 @@ export type AccessRights = 'Manage' | 'Send' | 'Listen'; */ export type KeyType = 'PrimaryKey' | 'SecondaryKey'; +/** + * Defines values for SchemaCompatibility. + * Possible values include: 'None', 'Backward', 'Forward' + * @readonly + * @enum {string} + */ +export type SchemaCompatibility = 'None' | 'Backward' | 'Forward'; + +/** + * Defines values for SchemaType. + * Possible values include: 'Unknown', 'Avro' + * @readonly + * @enum {string} + */ +export type SchemaType = 'Unknown' | 'Avro'; + /** * Contains response data for the listAvailableClusterRegion operation. */ @@ -1562,6 +1783,26 @@ export type NamespacesGetNetworkRuleSetResponse = NetworkRuleSet & { }; }; +/** + * Contains response data for the listNetworkRuleSet operation. + */ +export type NamespacesListNetworkRuleSetResponse = NetworkRuleSetListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: NetworkRuleSetListResult; + }; +}; + /** * Contains response data for the listAuthorizationRules operation. */ @@ -2361,3 +2602,83 @@ export type ConsumerGroupsListByEventHubNextResponse = ConsumerGroupListResult & parsedBody: ConsumerGroupListResult; }; }; + +/** + * Contains response data for the listByNamespace operation. + */ +export type SchemaRegistryListByNamespaceResponse = SchemaGroupListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SchemaGroupListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type SchemaRegistryCreateOrUpdateResponse = SchemaGroup & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SchemaGroup; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type SchemaRegistryGetResponse = SchemaGroup & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SchemaGroup; + }; +}; + +/** + * Contains response data for the listByNamespaceNext operation. + */ +export type SchemaRegistryListByNamespaceNextResponse = SchemaGroupListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SchemaGroupListResult; + }; +}; diff --git a/sdk/eventhub/arm-eventhub/src/models/mappers.ts b/sdk/eventhub/arm-eventhub/src/models/mappers.ts index 3a570027fe69..e973520645b5 100644 --- a/sdk/eventhub/arm-eventhub/src/models/mappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/mappers.ts @@ -50,23 +50,99 @@ export const AvailableClustersList: msRest.CompositeMapper = { } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", +export const ErrorAdditionalInfo: msRest.CompositeMapper = { + serializedName: "ErrorAdditionalInfo", type: { name: "Composite", - className: "ErrorResponse", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + info: { + readOnly: true, + serializedName: "info", + type: { + name: "Object" + } + } + } + } +}; + +export const ErrorDetail: msRest.CompositeMapper = { + serializedName: "ErrorDetail", + type: { + name: "Composite", + className: "ErrorDetail", modelProperties: { code: { + readOnly: true, serializedName: "code", type: { name: "String" } }, message: { + readOnly: true, serializedName: "message", type: { name: "String" } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + }, + details: { + readOnly: true, + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + readOnly: true, + serializedName: "additionalInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } } } } @@ -549,13 +625,51 @@ export const ConnectionState: msRest.CompositeMapper = { } }; +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + location: { + readOnly: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const PrivateEndpointConnection: msRest.CompositeMapper = { serializedName: "PrivateEndpointConnection", type: { name: "Composite", className: "PrivateEndpointConnection", modelProperties: { - ...Resource.type.modelProperties, + ...ProxyResource.type.modelProperties, privateEndpoint: { serializedName: "properties.privateEndpoint", type: { @@ -713,6 +827,12 @@ export const EHNamespace: msRest.CompositeMapper = { type: { name: "Boolean" } + }, + alternateName: { + serializedName: "properties.alternateName", + type: { + name: "String" + } } } } @@ -803,7 +923,7 @@ export const PrivateLinkResourcesListResult: msRest.CompositeMapper = { }; export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", + serializedName: "OperationDisplay", type: { name: "Composite", className: "OperationDisplay", @@ -828,6 +948,13 @@ export const OperationDisplay: msRest.CompositeMapper = { type: { name: "String" } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } } } } @@ -846,12 +973,30 @@ export const Operation: msRest.CompositeMapper = { name: "String" } }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, display: { serializedName: "display", type: { name: "Composite", className: "OperationDisplay" } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Object" + } } } } @@ -886,6 +1031,24 @@ export const Destination: msRest.CompositeMapper = { type: { name: "String" } + }, + dataLakeSubscriptionId: { + serializedName: "properties.dataLakeSubscriptionId", + type: { + name: "Uuid" + } + }, + dataLakeAccountName: { + serializedName: "properties.dataLakeAccountName", + type: { + name: "String" + } + }, + dataLakeFolderPath: { + serializedName: "properties.dataLakeFolderPath", + type: { + name: "String" + } } } } @@ -948,7 +1111,7 @@ export const Eventhub: msRest.CompositeMapper = { name: "Composite", className: "Eventhub", modelProperties: { - ...Resource.type.modelProperties, + ...ProxyResource.type.modelProperties, partitionIds: { readOnly: true, serializedName: "properties.partitionIds", @@ -1089,7 +1252,7 @@ export const ArmDisasterRecovery: msRest.CompositeMapper = { name: "Composite", className: "ArmDisasterRecovery", modelProperties: { - ...Resource.type.modelProperties, + ...ProxyResource.type.modelProperties, provisioningState: { readOnly: true, serializedName: "properties.provisioningState", @@ -1212,7 +1375,7 @@ export const NetworkRuleSet: msRest.CompositeMapper = { name: "Composite", className: "NetworkRuleSet", modelProperties: { - ...Resource.type.modelProperties, + ...ProxyResource.type.modelProperties, trustedServiceAccessEnabled: { serializedName: "properties.trustedServiceAccessEnabled", type: { @@ -1268,13 +1431,41 @@ export const NetworkRuleSet: msRest.CompositeMapper = { } }; +export const NetworkRuleSetListResult: msRest.CompositeMapper = { + serializedName: "NetworkRuleSetListResult", + type: { + name: "Composite", + className: "NetworkRuleSetListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkRuleSet" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const AuthorizationRule: msRest.CompositeMapper = { serializedName: "AuthorizationRule", type: { name: "Composite", className: "AuthorizationRule", modelProperties: { - ...Resource.type.modelProperties, + ...ProxyResource.type.modelProperties, rights: { required: true, serializedName: "properties.rights", @@ -1368,11 +1559,7 @@ export const RegenerateAccessKeyParameters: msRest.CompositeMapper = { required: true, serializedName: "keyType", type: { - name: "Enum", - allowedValues: [ - "PrimaryKey", - "SecondaryKey" - ] + name: "String" } }, key: { @@ -1391,7 +1578,7 @@ export const ConsumerGroup: msRest.CompositeMapper = { name: "Composite", className: "ConsumerGroup", modelProperties: { - ...Resource.type.modelProperties, + ...ProxyResource.type.modelProperties, createdAt: { readOnly: true, serializedName: "properties.createdAt", @@ -1424,6 +1611,69 @@ export const ConsumerGroup: msRest.CompositeMapper = { } }; +export const SchemaGroup: msRest.CompositeMapper = { + serializedName: "SchemaGroup", + type: { + name: "Composite", + className: "SchemaGroup", + modelProperties: { + ...ProxyResource.type.modelProperties, + updatedAtUtc: { + readOnly: true, + serializedName: "properties.updatedAtUtc", + type: { + name: "DateTime" + } + }, + createdAtUtc: { + readOnly: true, + serializedName: "properties.createdAtUtc", + type: { + name: "DateTime" + } + }, + eTag: { + readOnly: true, + serializedName: "properties.eTag", + type: { + name: "Uuid" + } + }, + groupProperties: { + serializedName: "properties.groupProperties", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + schemaCompatibility: { + serializedName: "properties.schemaCompatibility", + type: { + name: "String" + } + }, + schemaType: { + serializedName: "properties.schemaType", + type: { + name: "String" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + export const ClusterListResult: msRest.CompositeMapper = { serializedName: "ClusterListResult", type: { @@ -1650,3 +1900,31 @@ export const ConsumerGroupListResult: msRest.CompositeMapper = { } } }; + +export const SchemaGroupListResult: msRest.CompositeMapper = { + serializedName: "SchemaGroupListResult", + type: { + name: "Composite", + className: "SchemaGroupListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SchemaGroup" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts b/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts index 1516ae824548..881d44dbe850 100644 --- a/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/namespacesMappers.ts @@ -23,17 +23,22 @@ export { EHNamespace, EHNamespaceListResult, Encryption, + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, Eventhub, Identity, KeyVaultProperties, NetworkRuleSet, + NetworkRuleSetListResult, NWRuleSetIpRules, NWRuleSetVirtualNetworkRules, PrivateEndpoint, PrivateEndpointConnection, + ProxyResource, RegenerateAccessKeyParameters, Resource, + SchemaGroup, Sku, Subnet, SystemData, diff --git a/sdk/eventhub/arm-eventhub/src/models/operationsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/operationsMappers.ts index 3e8e33c6f2bd..fddc3077d64b 100644 --- a/sdk/eventhub/arm-eventhub/src/models/operationsMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/operationsMappers.ts @@ -7,6 +7,8 @@ */ export { + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, Operation, OperationDisplay, diff --git a/sdk/eventhub/arm-eventhub/src/models/parameters.ts b/sdk/eventhub/arm-eventhub/src/models/parameters.ts index 4983ad87de26..5ef139453356 100644 --- a/sdk/eventhub/arm-eventhub/src/models/parameters.ts +++ b/sdk/eventhub/arm-eventhub/src/models/parameters.ts @@ -147,6 +147,20 @@ export const resourceGroupName: msRest.OperationURLParameter = { } } }; +export const schemaGroupName: msRest.OperationURLParameter = { + parameterPath: "schemaGroupName", + mapper: { + required: true, + serializedName: "schemaGroupName", + constraints: { + MaxLength: 256, + MinLength: 1 + }, + type: { + name: "String" + } + } +}; export const skip: msRest.OperationQueryParameter = { parameterPath: [ "options", diff --git a/sdk/eventhub/arm-eventhub/src/models/privateEndpointConnectionsMappers.ts b/sdk/eventhub/arm-eventhub/src/models/privateEndpointConnectionsMappers.ts index 2fa3ea5348a6..5c97a228e212 100644 --- a/sdk/eventhub/arm-eventhub/src/models/privateEndpointConnectionsMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/privateEndpointConnectionsMappers.ts @@ -18,6 +18,8 @@ export { Destination, EHNamespace, Encryption, + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, Eventhub, Identity, @@ -28,7 +30,9 @@ export { PrivateEndpoint, PrivateEndpointConnection, PrivateEndpointConnectionListResult, + ProxyResource, Resource, + SchemaGroup, Sku, Subnet, SystemData, diff --git a/sdk/eventhub/arm-eventhub/src/models/privateLinkResourcesMappers.ts b/sdk/eventhub/arm-eventhub/src/models/privateLinkResourcesMappers.ts index be5115bf1832..c39824263cea 100644 --- a/sdk/eventhub/arm-eventhub/src/models/privateLinkResourcesMappers.ts +++ b/sdk/eventhub/arm-eventhub/src/models/privateLinkResourcesMappers.ts @@ -7,6 +7,8 @@ */ export { + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, PrivateLinkResource, PrivateLinkResourcesListResult diff --git a/sdk/eventhub/arm-eventhub/src/models/schemaRegistryMappers.ts b/sdk/eventhub/arm-eventhub/src/models/schemaRegistryMappers.ts new file mode 100644 index 000000000000..902bbef8962d --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/models/schemaRegistryMappers.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +export { + ArmDisasterRecovery, + AuthorizationRule, + BaseResource, + CaptureDescription, + Cluster, + ClusterSku, + ConnectionState, + ConsumerGroup, + Destination, + EHNamespace, + Encryption, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Eventhub, + Identity, + KeyVaultProperties, + NetworkRuleSet, + NWRuleSetIpRules, + NWRuleSetVirtualNetworkRules, + PrivateEndpoint, + PrivateEndpointConnection, + ProxyResource, + Resource, + SchemaGroup, + SchemaGroupListResult, + Sku, + Subnet, + SystemData, + TrackedResource, + UserAssignedIdentity, + UserAssignedIdentityProperties +} from "../models/mappers"; diff --git a/sdk/eventhub/arm-eventhub/src/operations/disasterRecoveryConfigs.ts b/sdk/eventhub/arm-eventhub/src/operations/disasterRecoveryConfigs.ts index 7abe5ea8d4a0..8e7f5942a807 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/disasterRecoveryConfigs.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/disasterRecoveryConfigs.ts @@ -561,6 +561,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { ], responses: { 200: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/eventhub/arm-eventhub/src/operations/index.ts b/sdk/eventhub/arm-eventhub/src/operations/index.ts index 85d2082e35e3..1f044ff59cdc 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/index.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/index.ts @@ -16,3 +16,4 @@ export * from "./operations"; export * from "./eventHubs"; export * from "./disasterRecoveryConfigs"; export * from "./consumerGroups"; +export * from "./schemaRegistry"; diff --git a/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts b/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts index 08be611d71df..255ebc6b689f 100644 --- a/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts +++ b/sdk/eventhub/arm-eventhub/src/operations/namespaces.ts @@ -242,6 +242,38 @@ export class Namespaces { callback) as Promise; } + /** + * Gets NetworkRuleSet for a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param [options] The optional parameters + * @returns Promise + */ + listNetworkRuleSet(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param callback The callback + */ + listNetworkRuleSet(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The optional parameters + * @param callback The callback + */ + listNetworkRuleSet(resourceGroupName: string, namespaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNetworkRuleSet(resourceGroupName: string, namespaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + namespaceName, + options + }, + listNetworkRuleSetOperationSpec, + callback) as Promise; + } + /** * Gets a list of authorization rules for a Namespace. * @param resourceGroupName Name of the resource group within the azure subscription. @@ -782,6 +814,31 @@ const getNetworkRuleSetOperationSpec: msRest.OperationSpec = { serializer }; +const listNetworkRuleSetOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.NetworkRuleSetListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + const listAuthorizationRulesOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules", diff --git a/sdk/eventhub/arm-eventhub/src/operations/schemaRegistry.ts b/sdk/eventhub/arm-eventhub/src/operations/schemaRegistry.ts new file mode 100644 index 000000000000..6dbeeb48927e --- /dev/null +++ b/sdk/eventhub/arm-eventhub/src/operations/schemaRegistry.ts @@ -0,0 +1,335 @@ +/* + * 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 * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/schemaRegistryMappers"; +import * as Parameters from "../models/parameters"; +import { EventHubManagementClientContext } from "../eventHubManagementClientContext"; + +/** Class representing a SchemaRegistry. */ +export class SchemaRegistry { + private readonly client: EventHubManagementClientContext; + + /** + * Create a SchemaRegistry. + * @param {EventHubManagementClientContext} client Reference to the service client. + */ + constructor(client: EventHubManagementClientContext) { + this.client = client; + } + + /** + * Gets all the Schema Groups in a Namespace. + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param [options] The optional parameters + * @returns Promise + */ + listByNamespace(resourceGroupName: string, namespaceName: string, options?: Models.SchemaRegistryListByNamespaceOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param callback The callback + */ + listByNamespace(resourceGroupName: string, namespaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param options The optional parameters + * @param callback The callback + */ + listByNamespace(resourceGroupName: string, namespaceName: string, options: Models.SchemaRegistryListByNamespaceOptionalParams, callback: msRest.ServiceCallback): void; + listByNamespace(resourceGroupName: string, namespaceName: string, options?: Models.SchemaRegistryListByNamespaceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + namespaceName, + options + }, + listByNamespaceOperationSpec, + callback) as Promise; + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param schemaGroupName The Schema Group name + * @param parameters Parameters supplied to create an Event Hub resource. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, namespaceName: string, schemaGroupName: string, parameters: Models.SchemaGroup, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param schemaGroupName The Schema Group name + * @param parameters Parameters supplied to create an Event Hub resource. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, namespaceName: string, schemaGroupName: string, parameters: Models.SchemaGroup, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param schemaGroupName The Schema Group name + * @param parameters Parameters supplied to create an Event Hub resource. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, namespaceName: string, schemaGroupName: string, parameters: Models.SchemaGroup, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, namespaceName: string, schemaGroupName: string, parameters: Models.SchemaGroup, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + namespaceName, + schemaGroupName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param schemaGroupName The Schema Group name + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, namespaceName: string, schemaGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param schemaGroupName The Schema Group name + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, namespaceName: string, schemaGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param schemaGroupName The Schema Group name + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, namespaceName: string, schemaGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, namespaceName: string, schemaGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + namespaceName, + schemaGroupName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param schemaGroupName The Schema Group name + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, namespaceName: string, schemaGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param schemaGroupName The Schema Group name + * @param callback The callback + */ + get(resourceGroupName: string, namespaceName: string, schemaGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group within the azure subscription. + * @param namespaceName The Namespace name + * @param schemaGroupName The Schema Group name + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, namespaceName: string, schemaGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, namespaceName: string, schemaGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + namespaceName, + schemaGroupName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Gets all the Schema Groups in a Namespace. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByNamespaceNext(nextPageLink: string, options?: Models.SchemaRegistryListByNamespaceNextOptionalParams): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByNamespaceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByNamespaceNext(nextPageLink: string, options: Models.SchemaRegistryListByNamespaceNextOptionalParams, callback: msRest.ServiceCallback): void; + listByNamespaceNext(nextPageLink: string, options?: Models.SchemaRegistryListByNamespaceNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByNamespaceNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByNamespaceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.skip, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SchemaGroupListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.schemaGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.SchemaGroup, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SchemaGroup + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.schemaGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.namespaceName, + Parameters.schemaGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SchemaGroup + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByNamespaceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.skip, + Parameters.top + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SchemaGroupListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +};