diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index b39ba0ca29b6..f6bd956b43c0 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9305,23 +9305,23 @@ packages: dev: false file:projects/arm-apimanagement.tgz: - resolution: {integrity: sha512-ENVu3UL1ZJ5O9P35Nwlhz1hPCGrauuaQvCl9+4PbVQ6/GllKYFsGNmmWK+o6cnVD3v84gnuVOk1McZwm/JZVbQ==, tarball: file:projects/arm-apimanagement.tgz} + resolution: {integrity: sha512-Q2blU8n2U+uDx6ZhJzhHsBNUNeWiqb2VMVwT1fhfCD78D6fXmvVpGDyRT6LH3bLO/p3+YCVAJAF5JE2bDzEFlg==, tarball: file:projects/arm-apimanagement.tgz} name: '@rush-temp/arm-apimanagement' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 - '@rollup/plugin-json': 4.1.0_rollup@2.67.1 - '@rollup/plugin-multi-entry': 3.0.1_rollup@2.67.1 - '@rollup/plugin-node-resolve': 8.4.0_rollup@2.67.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.67.1 - rollup-plugin-sourcemaps: 0.4.2_rollup@2.67.1 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.1 @@ -12457,7 +12457,7 @@ packages: dev: false file:projects/arm-rediscache.tgz: - resolution: {integrity: sha512-lRPMNQ6X2zNGHkn4+nUXsiXRde6JISO5YjFzhycdJL/3NCg9F4m94x+VbYyNtbvW5a7oVbGmyu4lW+I8qlqszQ==, tarball: file:projects/arm-rediscache.tgz} + resolution: {integrity: sha512-L96UyCle2mXUwU1QCXkofA0Yl4jBo8ElH3wdfGQBGHvDnDGkb1wNzcyuMsNncmPePr3fWsM50xCYuaMASfy0Ag==, tarball: file:projects/arm-rediscache.tgz} name: '@rush-temp/arm-rediscache' version: 0.0.0 dependencies: diff --git a/sdk/apimanagement/arm-apimanagement/CHANGELOG.md b/sdk/apimanagement/arm-apimanagement/CHANGELOG.md index 7e5ff963c489..bafe5d97d211 100644 --- a/sdk/apimanagement/arm-apimanagement/CHANGELOG.md +++ b/sdk/apimanagement/arm-apimanagement/CHANGELOG.md @@ -1,15 +1,31 @@ # Release History - -## 8.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 8.1.0 (2022-03-15) + +**Features** + + - Added operation group GlobalSchema + - Added Interface GlobalSchemaCollection + - Added Interface GlobalSchemaCreateOrUpdateHeaders + - Added Interface GlobalSchemaCreateOrUpdateOptionalParams + - Added Interface GlobalSchemaDeleteOptionalParams + - Added Interface GlobalSchemaGetEntityTagHeaders + - Added Interface GlobalSchemaGetEntityTagOptionalParams + - Added Interface GlobalSchemaGetHeaders + - Added Interface GlobalSchemaGetOptionalParams + - Added Interface GlobalSchemaListByServiceNextOptionalParams + - Added Interface GlobalSchemaListByServiceOptionalParams + - Added Type Alias GlobalSchemaContract + - Added Type Alias GlobalSchemaCreateOrUpdateResponse + - Added Type Alias GlobalSchemaGetEntityTagResponse + - Added Type Alias GlobalSchemaGetResponse + - Added Type Alias GlobalSchemaListByServiceNextResponse + - Added Type Alias GlobalSchemaListByServiceResponse + - Added Type Alias SchemaType + - Class ApiManagementClient has a new parameter globalSchema + - Added Enum KnownSchemaType + + ## 8.0.0 (2021-12-13) The package of @azure/arm-apimanagement is using our next generation design principles since version 8.0.0, which contains breaking changes. diff --git a/sdk/apimanagement/arm-apimanagement/LICENSE b/sdk/apimanagement/arm-apimanagement/LICENSE index ccb63b166732..5d1d36e0af80 100644 --- a/sdk/apimanagement/arm-apimanagement/LICENSE +++ b/sdk/apimanagement/arm-apimanagement/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/apimanagement/arm-apimanagement/_meta.json b/sdk/apimanagement/arm-apimanagement/_meta.json index 02193c17c62b..08c25d3d0bfa 100644 --- a/sdk/apimanagement/arm-apimanagement/_meta.json +++ b/sdk/apimanagement/arm-apimanagement/_meta.json @@ -1,7 +1,8 @@ { - "commit": "b8cae07c799a07f2e779a9e301f639e9b85124b1", + "commit": "5fd3195f038f674be56db6a47ebfdd5c7bd4e984", "readme": "specification/apimanagement/resource-manager/readme.md", - "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/apimanagement/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/apimanagement/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.1.2", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/apimanagement/arm-apimanagement/api-extractor.json b/sdk/apimanagement/arm-apimanagement/api-extractor.json index c617f9f90f40..467fe61534d0 100644 --- a/sdk/apimanagement/arm-apimanagement/api-extractor.json +++ b/sdk/apimanagement/arm-apimanagement/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-apimanagement.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/apimanagement/arm-apimanagement/package.json b/sdk/apimanagement/arm-apimanagement/package.json index dc1469d41f52..4f9243d98ab2 100644 --- a/sdk/apimanagement/arm-apimanagement/package.json +++ b/sdk/apimanagement/arm-apimanagement/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ApiManagementClient.", - "version": "8.0.1", + "version": "8.1.0", "engines": { "node": ">=12.0.0" }, @@ -29,12 +29,12 @@ "types": "./types/arm-apimanagement.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-json": "^4.0.0", "@rollup/plugin-multi-entry": "^3.0.0", "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.0.0", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", @@ -99,4 +99,4 @@ }, "sideEffects": false, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/apimanagement/arm-apimanagement/review/arm-apimanagement.api.md b/sdk/apimanagement/arm-apimanagement/review/arm-apimanagement.api.md index c6421c6b602a..3dc534687d76 100644 --- a/sdk/apimanagement/arm-apimanagement/review/arm-apimanagement.api.md +++ b/sdk/apimanagement/arm-apimanagement/review/arm-apimanagement.api.md @@ -705,6 +705,8 @@ export class ApiManagementClient extends coreClient.ServiceClient { // (undocumented) gatewayHostnameConfiguration: GatewayHostnameConfiguration; // (undocumented) + globalSchema: GlobalSchema; + // (undocumented) group: Group; // (undocumented) groupUser: GroupUser; @@ -2745,7 +2747,7 @@ export interface ContentItemCollection { // @public export type ContentItemContract = Resource & { properties?: { - [propertyName: string]: Record; + [propertyName: string]: any; }; }; @@ -3619,6 +3621,94 @@ export interface GenerateSsoUrlResult { value?: string; } +// @public +export interface GlobalSchema { + beginCreateOrUpdate(resourceGroupName: string, serviceName: string, schemaId: string, parameters: GlobalSchemaContract, options?: GlobalSchemaCreateOrUpdateOptionalParams): Promise, GlobalSchemaCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, serviceName: string, schemaId: string, parameters: GlobalSchemaContract, options?: GlobalSchemaCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceName: string, schemaId: string, ifMatch: string, options?: GlobalSchemaDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceName: string, schemaId: string, options?: GlobalSchemaGetOptionalParams): Promise; + getEntityTag(resourceGroupName: string, serviceName: string, schemaId: string, options?: GlobalSchemaGetEntityTagOptionalParams): Promise; + listByService(resourceGroupName: string, serviceName: string, options?: GlobalSchemaListByServiceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface GlobalSchemaCollection { + count?: number; + readonly nextLink?: string; + readonly value?: GlobalSchemaContract[]; +} + +// @public +export type GlobalSchemaContract = Resource & { + schemaType?: SchemaType; + description?: string; + value?: any; + document?: Record; +}; + +// @public +export interface GlobalSchemaCreateOrUpdateHeaders { + eTag?: string; +} + +// @public +export interface GlobalSchemaCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GlobalSchemaCreateOrUpdateResponse = GlobalSchemaCreateOrUpdateHeaders & GlobalSchemaContract; + +// @public +export interface GlobalSchemaDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface GlobalSchemaGetEntityTagHeaders { + eTag?: string; +} + +// @public +export interface GlobalSchemaGetEntityTagOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GlobalSchemaGetEntityTagResponse = GlobalSchemaGetEntityTagHeaders; + +// @public +export interface GlobalSchemaGetHeaders { + eTag?: string; +} + +// @public +export interface GlobalSchemaGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GlobalSchemaGetResponse = GlobalSchemaGetHeaders & GlobalSchemaContract; + +// @public +export interface GlobalSchemaListByServiceNextOptionalParams extends coreClient.OperationOptions { + filter?: string; + skip?: number; + top?: number; +} + +// @public +export type GlobalSchemaListByServiceNextResponse = GlobalSchemaCollection; + +// @public +export interface GlobalSchemaListByServiceOptionalParams extends coreClient.OperationOptions { + filter?: string; + skip?: number; + top?: number; +} + +// @public +export type GlobalSchemaListByServiceResponse = GlobalSchemaCollection; + // @public export type GrantType = string; @@ -4557,6 +4647,12 @@ export enum KnownSamplingType { Fixed = "fixed" } +// @public +export enum KnownSchemaType { + Json = "json", + Xml = "xml" +} + // @public export enum KnownSettingsTypeName { // (undocumented) @@ -6667,6 +6763,9 @@ export type SchemaContract = Resource & { components?: Record; }; +// @public +export type SchemaType = string; + // @public export type SettingsTypeName = string; diff --git a/sdk/apimanagement/arm-apimanagement/src/apiManagementClient.ts b/sdk/apimanagement/arm-apimanagement/src/apiManagementClient.ts index 488a4a6dc3fd..7a241eb6bb45 100644 --- a/sdk/apimanagement/arm-apimanagement/src/apiManagementClient.ts +++ b/sdk/apimanagement/arm-apimanagement/src/apiManagementClient.ts @@ -73,6 +73,7 @@ import { QuotaByPeriodKeysImpl, RegionImpl, ReportsImpl, + GlobalSchemaImpl, TenantSettingsImpl, ApiManagementSkusImpl, SubscriptionImpl, @@ -149,6 +150,7 @@ import { QuotaByPeriodKeys, Region, Reports, + GlobalSchema, TenantSettings, ApiManagementSkus, Subscription, @@ -204,7 +206,7 @@ export class ApiManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-apimanagement/8.0.0`; + const packageDetails = `azsdk-js-arm-apimanagement/8.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -298,6 +300,7 @@ export class ApiManagementClient extends coreClient.ServiceClient { this.quotaByPeriodKeys = new QuotaByPeriodKeysImpl(this); this.region = new RegionImpl(this); this.reports = new ReportsImpl(this); + this.globalSchema = new GlobalSchemaImpl(this); this.tenantSettings = new TenantSettingsImpl(this); this.apiManagementSkus = new ApiManagementSkusImpl(this); this.subscription = new SubscriptionImpl(this); @@ -472,6 +475,7 @@ export class ApiManagementClient extends coreClient.ServiceClient { quotaByPeriodKeys: QuotaByPeriodKeys; region: Region; reports: Reports; + globalSchema: GlobalSchema; tenantSettings: TenantSettings; apiManagementSkus: ApiManagementSkus; subscription: Subscription; diff --git a/sdk/apimanagement/arm-apimanagement/src/models/index.ts b/sdk/apimanagement/arm-apimanagement/src/models/index.ts index 457a6f082925..517d2e0c3226 100644 --- a/sdk/apimanagement/arm-apimanagement/src/models/index.ts +++ b/sdk/apimanagement/arm-apimanagement/src/models/index.ts @@ -2506,6 +2506,22 @@ export interface RequestReportRecordContract { requestSize?: number; } +/** The response of the list schema operation. */ +export interface GlobalSchemaCollection { + /** + * Global Schema Contract value. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: GlobalSchemaContract[]; + /** Total record count number. */ + count?: number; + /** + * Next page link if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + /** Paged AccessInformation list representation. */ export interface TenantSettingsCollection { /** @@ -3108,15 +3124,15 @@ export type ProductContract = Resource & { displayName?: string; }; -/** Schema Contract details. */ +/** API Schema Contract details. */ export type SchemaContract = Resource & { /** Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. */ contentType?: string; /** Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. */ value?: string; - /** Types definitions. Used for OpenAPI v2 (Swagger) schemas only, null otherwise. */ + /** Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. */ definitions?: Record; - /** Types definitions. Used for OpenAPI v3 schemas only, null otherwise. */ + /** Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. */ components?: Record; }; @@ -3350,7 +3366,7 @@ export type ContentTypeContract = Resource & { /** Content type contract details. */ export type ContentItemContract = Resource & { /** Properties of the content item. */ - properties?: { [propertyName: string]: Record }; + properties?: { [propertyName: string]: any }; }; /** Deleted API Management Service information. */ @@ -3754,6 +3770,18 @@ export type SubscriptionContract = Resource & { allowTracing?: boolean; }; +/** Global Schema Contract details. */ +export type GlobalSchemaContract = Resource & { + /** Schema Type. Immutable. */ + schemaType?: SchemaType; + /** Free-form schema entity description. */ + description?: string; + /** Json-encoded string for non json-based schema. */ + value?: any; + /** Global Schema document object for json-based schema formats(e.g. json schema). */ + document?: Record; +}; + /** Tenant Settings. */ export type TenantSettingsContract = Resource & { /** Tenant settings */ @@ -5152,6 +5180,24 @@ export interface ProductPolicyCreateOrUpdateHeaders { eTag?: string; } +/** Defines headers for GlobalSchema_getEntityTag operation. */ +export interface GlobalSchemaGetEntityTagHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for GlobalSchema_get operation. */ +export interface GlobalSchemaGetHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for GlobalSchema_createOrUpdate operation. */ +export interface GlobalSchemaCreateOrUpdateHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + /** Defines headers for TenantSettings_get operation. */ export interface TenantSettingsGetHeaders { /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ @@ -6355,6 +6401,24 @@ export enum KnownPrivateEndpointConnectionProvisioningState { */ export type PrivateEndpointConnectionProvisioningState = string; +/** Known values of {@link SchemaType} that the service accepts. */ +export enum KnownSchemaType { + /** Xml schema type. */ + Xml = "xml", + /** Json schema type. */ + Json = "json" +} + +/** + * Defines values for SchemaType. \ + * {@link KnownSchemaType} can be used interchangeably with SchemaType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **xml**: Xml schema type. \ + * **json**: Json schema type. + */ +export type SchemaType = string; + /** Known values of {@link SettingsTypeName} that the service accepts. */ export enum KnownSettingsTypeName { Public = "public" @@ -9844,6 +9908,68 @@ export interface ReportsListByTimeNextOptionalParams /** Contains response data for the listByTimeNext operation. */ export type ReportsListByTimeNextResponse = ReportCollection; +/** Optional parameters. */ +export interface GlobalSchemaListByServiceOptionalParams + extends coreClient.OperationOptions { + /** | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
*/ + filter?: string; + /** Number of records to return. */ + top?: number; + /** Number of records to skip. */ + skip?: number; +} + +/** Contains response data for the listByService operation. */ +export type GlobalSchemaListByServiceResponse = GlobalSchemaCollection; + +/** Optional parameters. */ +export interface GlobalSchemaGetEntityTagOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getEntityTag operation. */ +export type GlobalSchemaGetEntityTagResponse = GlobalSchemaGetEntityTagHeaders; + +/** Optional parameters. */ +export interface GlobalSchemaGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type GlobalSchemaGetResponse = GlobalSchemaGetHeaders & + GlobalSchemaContract; + +/** Optional parameters. */ +export interface GlobalSchemaCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** ETag of the Entity. Not required when creating an entity, but required when updating an entity. */ + ifMatch?: string; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type GlobalSchemaCreateOrUpdateResponse = GlobalSchemaCreateOrUpdateHeaders & + GlobalSchemaContract; + +/** Optional parameters. */ +export interface GlobalSchemaDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface GlobalSchemaListByServiceNextOptionalParams + extends coreClient.OperationOptions { + /** | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
*/ + filter?: string; + /** Number of records to return. */ + top?: number; + /** Number of records to skip. */ + skip?: number; +} + +/** Contains response data for the listByServiceNext operation. */ +export type GlobalSchemaListByServiceNextResponse = GlobalSchemaCollection; + /** Optional parameters. */ export interface TenantSettingsListByServiceOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/apimanagement/arm-apimanagement/src/models/mappers.ts b/sdk/apimanagement/arm-apimanagement/src/models/mappers.ts index e8d4930b3d6c..017218f96337 100644 --- a/sdk/apimanagement/arm-apimanagement/src/models/mappers.ts +++ b/sdk/apimanagement/arm-apimanagement/src/models/mappers.ts @@ -8044,6 +8044,46 @@ export const RequestReportRecordContract: coreClient.CompositeMapper = { } }; +export const GlobalSchemaCollection: coreClient.CompositeMapper = { + serializedName: "GlobalSchemaCollection", + type: { + name: "Composite", + className: "GlobalSchemaCollection", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + xmlName: "value", + xmlElementName: "GlobalSchemaContract", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GlobalSchemaContract" + } + } + } + }, + count: { + serializedName: "count", + xmlName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + xmlName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const TenantSettingsCollection: coreClient.CompositeMapper = { serializedName: "TenantSettingsCollection", type: { @@ -10896,9 +10936,7 @@ export const ContentItemContract: coreClient.CompositeMapper = { xmlName: "properties", type: { name: "Dictionary", - value: { - type: { name: "Dictionary", value: { type: { name: "any" } } } - } + value: { type: { name: "any" } } } } } @@ -12220,6 +12258,46 @@ export const SubscriptionContract: coreClient.CompositeMapper = { } }; +export const GlobalSchemaContract: coreClient.CompositeMapper = { + serializedName: "GlobalSchemaContract", + type: { + name: "Composite", + className: "GlobalSchemaContract", + modelProperties: { + ...Resource.type.modelProperties, + schemaType: { + serializedName: "properties.schemaType", + xmlName: "properties.schemaType", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + xmlName: "properties.description", + type: { + name: "String" + } + }, + value: { + serializedName: "properties.value", + xmlName: "properties.value", + type: { + name: "any" + } + }, + document: { + serializedName: "properties.document", + xmlName: "properties.document", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + export const TenantSettingsContract: coreClient.CompositeMapper = { serializedName: "TenantSettingsContract", type: { @@ -16440,6 +16518,57 @@ export const ProductPolicyCreateOrUpdateHeaders: coreClient.CompositeMapper = { } }; +export const GlobalSchemaGetEntityTagHeaders: coreClient.CompositeMapper = { + serializedName: "GlobalSchema_getEntityTagHeaders", + type: { + name: "Composite", + className: "GlobalSchemaGetEntityTagHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const GlobalSchemaGetHeaders: coreClient.CompositeMapper = { + serializedName: "GlobalSchema_getHeaders", + type: { + name: "Composite", + className: "GlobalSchemaGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const GlobalSchemaCreateOrUpdateHeaders: coreClient.CompositeMapper = { + serializedName: "GlobalSchema_createOrUpdateHeaders", + type: { + name: "Composite", + className: "GlobalSchemaCreateOrUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + } + } + } +}; + export const TenantSettingsGetHeaders: coreClient.CompositeMapper = { serializedName: "TenantSettings_getHeaders", type: { diff --git a/sdk/apimanagement/arm-apimanagement/src/models/parameters.ts b/sdk/apimanagement/arm-apimanagement/src/models/parameters.ts index 154cf17b3420..e3b4552924ee 100644 --- a/sdk/apimanagement/arm-apimanagement/src/models/parameters.ts +++ b/sdk/apimanagement/arm-apimanagement/src/models/parameters.ts @@ -67,6 +67,7 @@ import { ProductContract as ProductContractMapper, ProductUpdateParameters as ProductUpdateParametersMapper, QuotaCounterValueUpdateContract as QuotaCounterValueUpdateContractMapper, + GlobalSchemaContract as GlobalSchemaContractMapper, SubscriptionCreateParameters as SubscriptionCreateParametersMapper, SubscriptionUpdateParameters as SubscriptionUpdateParametersMapper, AccessInformationCreateParameters as AccessInformationCreateParametersMapper, @@ -473,7 +474,6 @@ export const schemaId: OperationURLParameter = { parameterPath: "schemaId", mapper: { constraints: { - Pattern: new RegExp("^[^*#&+:<>?]+$"), MaxLength: 80, MinLength: 1 }, @@ -1326,6 +1326,11 @@ export const interval: OperationQueryParameter = { } }; +export const parameters53: OperationParameter = { + parameterPath: "parameters", + mapper: GlobalSchemaContractMapper +}; + export const settingsType: OperationURLParameter = { parameterPath: "settingsType", mapper: { @@ -1354,7 +1359,7 @@ export const sid: OperationURLParameter = { } }; -export const parameters53: OperationParameter = { +export const parameters54: OperationParameter = { parameterPath: "parameters", mapper: SubscriptionCreateParametersMapper }; @@ -1381,7 +1386,7 @@ export const appType: OperationQueryParameter = { } }; -export const parameters54: OperationParameter = { +export const parameters55: OperationParameter = { parameterPath: "parameters", mapper: SubscriptionUpdateParametersMapper }; @@ -1398,17 +1403,17 @@ export const accessName: OperationURLParameter = { } }; -export const parameters55: OperationParameter = { +export const parameters56: OperationParameter = { parameterPath: "parameters", mapper: AccessInformationCreateParametersMapper }; -export const parameters56: OperationParameter = { +export const parameters57: OperationParameter = { parameterPath: "parameters", mapper: AccessInformationUpdateParametersMapper }; -export const parameters57: OperationParameter = { +export const parameters58: OperationParameter = { parameterPath: "parameters", mapper: DeployConfigurationParametersMapper }; @@ -1425,22 +1430,22 @@ export const configurationName: OperationURLParameter = { } }; -export const parameters58: OperationParameter = { +export const parameters59: OperationParameter = { parameterPath: "parameters", mapper: SaveConfigurationParameterMapper }; -export const parameters59: OperationParameter = { +export const parameters60: OperationParameter = { parameterPath: "parameters", mapper: UserCreateParametersMapper }; -export const parameters60: OperationParameter = { +export const parameters61: OperationParameter = { parameterPath: "parameters", mapper: UserUpdateParametersMapper }; -export const parameters61: OperationParameter = { +export const parameters62: OperationParameter = { parameterPath: "parameters", mapper: UserTokenParametersMapper }; diff --git a/sdk/apimanagement/arm-apimanagement/src/operations/apiSchema.ts b/sdk/apimanagement/arm-apimanagement/src/operations/apiSchema.ts index 5768cc908657..1b031c220bb3 100644 --- a/sdk/apimanagement/arm-apimanagement/src/operations/apiSchema.ts +++ b/sdk/apimanagement/arm-apimanagement/src/operations/apiSchema.ts @@ -149,8 +149,7 @@ export class ApiSchemaImpl implements ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param options The options parameters. */ getEntityTag( @@ -172,8 +171,7 @@ export class ApiSchemaImpl implements ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param options The options parameters. */ get( @@ -195,8 +193,7 @@ export class ApiSchemaImpl implements ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param parameters The schema contents to apply. * @param options The options parameters. */ @@ -270,8 +267,7 @@ export class ApiSchemaImpl implements ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param parameters The schema contents to apply. * @param options The options parameters. */ @@ -300,8 +296,7 @@ export class ApiSchemaImpl implements ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header * response of the GET request or it should be * for unconditional update. * @param options The options parameters. diff --git a/sdk/apimanagement/arm-apimanagement/src/operations/globalSchema.ts b/sdk/apimanagement/arm-apimanagement/src/operations/globalSchema.ts new file mode 100644 index 000000000000..d1af2428ab6f --- /dev/null +++ b/sdk/apimanagement/arm-apimanagement/src/operations/globalSchema.ts @@ -0,0 +1,475 @@ +/* + * 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 } from "@azure/core-paging"; +import { GlobalSchema } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ApiManagementClient } from "../apiManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + GlobalSchemaContract, + GlobalSchemaListByServiceNextOptionalParams, + GlobalSchemaListByServiceOptionalParams, + GlobalSchemaListByServiceResponse, + GlobalSchemaGetEntityTagOptionalParams, + GlobalSchemaGetEntityTagResponse, + GlobalSchemaGetOptionalParams, + GlobalSchemaGetResponse, + GlobalSchemaCreateOrUpdateOptionalParams, + GlobalSchemaCreateOrUpdateResponse, + GlobalSchemaDeleteOptionalParams, + GlobalSchemaListByServiceNextResponse +} from "../models"; + +/// +/** Class containing GlobalSchema operations. */ +export class GlobalSchemaImpl implements GlobalSchema { + private readonly client: ApiManagementClient; + + /** + * Initialize a new instance of the class GlobalSchema class. + * @param client Reference to the service client + */ + constructor(client: ApiManagementClient) { + this.client = client; + } + + /** + * Lists a collection of schemas registered with service instance. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param options The options parameters. + */ + public listByService( + resourceGroupName: string, + serviceName: string, + options?: GlobalSchemaListByServiceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByServicePagingAll( + resourceGroupName, + serviceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByServicePagingPage( + resourceGroupName, + serviceName, + options + ); + } + }; + } + + private async *listByServicePagingPage( + resourceGroupName: string, + serviceName: string, + options?: GlobalSchemaListByServiceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByService( + resourceGroupName, + serviceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByServiceNext( + resourceGroupName, + serviceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByServicePagingAll( + resourceGroupName: string, + serviceName: string, + options?: GlobalSchemaListByServiceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByServicePagingPage( + resourceGroupName, + serviceName, + options + )) { + yield* page; + } + } + + /** + * Lists a collection of schemas registered with service instance. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param options The options parameters. + */ + private _listByService( + resourceGroupName: string, + serviceName: string, + options?: GlobalSchemaListByServiceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + listByServiceOperationSpec + ); + } + + /** + * Gets the entity state (Etag) version of the Schema specified by its identifier. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param options The options parameters. + */ + getEntityTag( + resourceGroupName: string, + serviceName: string, + schemaId: string, + options?: GlobalSchemaGetEntityTagOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, schemaId, options }, + getEntityTagOperationSpec + ); + } + + /** + * Gets the details of the Schema specified by its identifier. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + schemaId: string, + options?: GlobalSchemaGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, schemaId, options }, + getOperationSpec + ); + } + + /** + * Creates new or updates existing specified Schema of the API Management service instance. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + serviceName: string, + schemaId: string, + parameters: GlobalSchemaContract, + options?: GlobalSchemaCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + GlobalSchemaCreateOrUpdateResponse + > + > { + 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, serviceName, schemaId, parameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + } + + /** + * Creates new or updates existing specified Schema of the API Management service instance. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + serviceName: string, + schemaId: string, + parameters: GlobalSchemaContract, + options?: GlobalSchemaCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + serviceName, + schemaId, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes specific Schema. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header + * response of the GET request or it should be * for unconditional update. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + schemaId: string, + ifMatch: string, + options?: GlobalSchemaDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, schemaId, ifMatch, options }, + deleteOperationSpec + ); + } + + /** + * ListByServiceNext + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param nextLink The nextLink from the previous successful call to the ListByService method. + * @param options The options parameters. + */ + private _listByServiceNext( + resourceGroupName: string, + serviceName: string, + nextLink: string, + options?: GlobalSchemaListByServiceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, nextLink, options }, + listByServiceNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByServiceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GlobalSchemaCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.skip, + Parameters.apiVersion + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const getEntityTagOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}", + httpMethod: "HEAD", + responses: { + 200: { + headersMapper: Mappers.GlobalSchemaGetEntityTagHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.subscriptionId, + Parameters.schemaId + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GlobalSchemaContract, + headersMapper: Mappers.GlobalSchemaGetHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.subscriptionId, + Parameters.schemaId + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.GlobalSchemaContract, + headersMapper: Mappers.GlobalSchemaCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.GlobalSchemaContract, + headersMapper: Mappers.GlobalSchemaCreateOrUpdateHeaders + }, + 202: { + bodyMapper: Mappers.GlobalSchemaContract, + headersMapper: Mappers.GlobalSchemaCreateOrUpdateHeaders + }, + 204: { + bodyMapper: Mappers.GlobalSchemaContract, + headersMapper: Mappers.GlobalSchemaCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters53, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.subscriptionId, + Parameters.schemaId + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.ifMatch + ], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.subscriptionId, + Parameters.schemaId + ], + headerParameters: [Parameters.accept, Parameters.ifMatch1], + serializer +}; +const listByServiceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GlobalSchemaCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.filter, + Parameters.top, + Parameters.skip, + Parameters.apiVersion + ], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/apimanagement/arm-apimanagement/src/operations/index.ts b/sdk/apimanagement/arm-apimanagement/src/operations/index.ts index ad235419a765..24d2feb9be63 100644 --- a/sdk/apimanagement/arm-apimanagement/src/operations/index.ts +++ b/sdk/apimanagement/arm-apimanagement/src/operations/index.ts @@ -68,6 +68,7 @@ export * from "./quotaByCounterKeys"; export * from "./quotaByPeriodKeys"; export * from "./region"; export * from "./reports"; +export * from "./globalSchema"; export * from "./tenantSettings"; export * from "./apiManagementSkus"; export * from "./subscription"; diff --git a/sdk/apimanagement/arm-apimanagement/src/operations/subscription.ts b/sdk/apimanagement/arm-apimanagement/src/operations/subscription.ts index e5e222d16d34..d9b8c9df2082 100644 --- a/sdk/apimanagement/arm-apimanagement/src/operations/subscription.ts +++ b/sdk/apimanagement/arm-apimanagement/src/operations/subscription.ts @@ -407,7 +407,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters53, + requestBody: Parameters.parameters54, queryParameters: [ Parameters.apiVersion, Parameters.notify, @@ -441,7 +441,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters54, + requestBody: Parameters.parameters55, queryParameters: [ Parameters.apiVersion, Parameters.notify, diff --git a/sdk/apimanagement/arm-apimanagement/src/operations/tenantAccess.ts b/sdk/apimanagement/arm-apimanagement/src/operations/tenantAccess.ts index eec40d025d9c..e8f18fe46ddf 100644 --- a/sdk/apimanagement/arm-apimanagement/src/operations/tenantAccess.ts +++ b/sdk/apimanagement/arm-apimanagement/src/operations/tenantAccess.ts @@ -397,7 +397,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters55, + requestBody: Parameters.parameters56, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -427,7 +427,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters56, + requestBody: Parameters.parameters57, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/apimanagement/arm-apimanagement/src/operations/tenantConfiguration.ts b/sdk/apimanagement/arm-apimanagement/src/operations/tenantConfiguration.ts index 1c03a18454dd..7423f5aaf083 100644 --- a/sdk/apimanagement/arm-apimanagement/src/operations/tenantConfiguration.ts +++ b/sdk/apimanagement/arm-apimanagement/src/operations/tenantConfiguration.ts @@ -395,7 +395,7 @@ const deployOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters57, + requestBody: Parameters.parameters58, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -429,7 +429,7 @@ const saveOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters58, + requestBody: Parameters.parameters59, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -463,7 +463,7 @@ const validateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters57, + requestBody: Parameters.parameters58, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/apimanagement/arm-apimanagement/src/operations/user.ts b/sdk/apimanagement/arm-apimanagement/src/operations/user.ts index b5945c622206..b6a5f3c0799f 100644 --- a/sdk/apimanagement/arm-apimanagement/src/operations/user.ts +++ b/sdk/apimanagement/arm-apimanagement/src/operations/user.ts @@ -397,7 +397,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters59, + requestBody: Parameters.parameters60, queryParameters: [Parameters.apiVersion, Parameters.notify], urlParameters: [ Parameters.$host, @@ -427,7 +427,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters60, + requestBody: Parameters.parameters61, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -506,7 +506,7 @@ const getSharedAccessTokenOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters61, + requestBody: Parameters.parameters62, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/apiSchema.ts b/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/apiSchema.ts index 0b320d5f788b..35d79f66a387 100644 --- a/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/apiSchema.ts +++ b/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/apiSchema.ts @@ -43,8 +43,7 @@ export interface ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param options The options parameters. */ getEntityTag( @@ -60,8 +59,7 @@ export interface ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param options The options parameters. */ get( @@ -77,8 +75,7 @@ export interface ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param parameters The schema contents to apply. * @param options The options parameters. */ @@ -101,8 +98,7 @@ export interface ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param parameters The schema contents to apply. * @param options The options parameters. */ @@ -120,8 +116,7 @@ export interface ApiSchema { * @param serviceName The name of the API Management service. * @param apiId API revision identifier. Must be unique in the current API Management service instance. * Non-current revision has ;rev=n as a suffix where n is the revision number. - * @param schemaId Schema identifier within an API. Must be unique in the current API Management - * service instance. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header * response of the GET request or it should be * for unconditional update. * @param options The options parameters. diff --git a/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/globalSchema.ts b/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/globalSchema.ts new file mode 100644 index 000000000000..48f2f7894751 --- /dev/null +++ b/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/globalSchema.ts @@ -0,0 +1,114 @@ +/* + * 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 } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + GlobalSchemaContract, + GlobalSchemaListByServiceOptionalParams, + GlobalSchemaGetEntityTagOptionalParams, + GlobalSchemaGetEntityTagResponse, + GlobalSchemaGetOptionalParams, + GlobalSchemaGetResponse, + GlobalSchemaCreateOrUpdateOptionalParams, + GlobalSchemaCreateOrUpdateResponse, + GlobalSchemaDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a GlobalSchema. */ +export interface GlobalSchema { + /** + * Lists a collection of schemas registered with service instance. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param options The options parameters. + */ + listByService( + resourceGroupName: string, + serviceName: string, + options?: GlobalSchemaListByServiceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the entity state (Etag) version of the Schema specified by its identifier. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param options The options parameters. + */ + getEntityTag( + resourceGroupName: string, + serviceName: string, + schemaId: string, + options?: GlobalSchemaGetEntityTagOptionalParams + ): Promise; + /** + * Gets the details of the Schema specified by its identifier. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + schemaId: string, + options?: GlobalSchemaGetOptionalParams + ): Promise; + /** + * Creates new or updates existing specified Schema of the API Management service instance. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + serviceName: string, + schemaId: string, + parameters: GlobalSchemaContract, + options?: GlobalSchemaCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + GlobalSchemaCreateOrUpdateResponse + > + >; + /** + * Creates new or updates existing specified Schema of the API Management service instance. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param parameters Create or update parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + serviceName: string, + schemaId: string, + parameters: GlobalSchemaContract, + options?: GlobalSchemaCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes specific Schema. + * @param resourceGroupName The name of the resource group. + * @param serviceName The name of the API Management service. + * @param schemaId Schema id identifier. Must be unique in the current API Management service instance. + * @param ifMatch ETag of the Entity. ETag should match the current entity state from the header + * response of the GET request or it should be * for unconditional update. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + schemaId: string, + ifMatch: string, + options?: GlobalSchemaDeleteOptionalParams + ): Promise; +} diff --git a/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/index.ts b/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/index.ts index ad235419a765..24d2feb9be63 100644 --- a/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/index.ts +++ b/sdk/apimanagement/arm-apimanagement/src/operationsInterfaces/index.ts @@ -68,6 +68,7 @@ export * from "./quotaByCounterKeys"; export * from "./quotaByPeriodKeys"; export * from "./region"; export * from "./reports"; +export * from "./globalSchema"; export * from "./tenantSettings"; export * from "./apiManagementSkus"; export * from "./subscription"; diff --git a/sdk/apimanagement/arm-apimanagement/test/sampleTest.ts b/sdk/apimanagement/arm-apimanagement/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/apimanagement/arm-apimanagement/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/apimanagement/arm-apimanagement/tsconfig.json b/sdk/apimanagement/arm-apimanagement/tsconfig.json index 6e3251194117..3e6ae96443f3 100644 --- a/sdk/apimanagement/arm-apimanagement/tsconfig.json +++ b/sdk/apimanagement/arm-apimanagement/tsconfig.json @@ -9,11 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/apimanagement/ci.mgmt.yml b/sdk/apimanagement/ci.mgmt.yml index 97ed6a95139e..698649bfd0e8 100644 --- a/sdk/apimanagement/ci.mgmt.yml +++ b/sdk/apimanagement/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -10,7 +10,7 @@ trigger: include: - sdk/apimanagement/ci.mgmt.yml - sdk/apimanagement/arm-apimanagement/ - + - sdk/apimanagement/arm-apimanagement pr: branches: include: @@ -24,11 +24,11 @@ pr: include: - sdk/apimanagement/ci.mgmt.yml - sdk/apimanagement/arm-apimanagement/ - + - sdk/apimanagement/arm-apimanagement extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: apimanagement Artifacts: - name: azure-arm-apimanagement - safeName: azurearmapimanagement \ No newline at end of file + safeName: azurearmapimanagement