diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3e51b0a56286..6cafda08abf9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -11414,7 +11414,7 @@ packages: dev: false file:projects/arm-dns.tgz: - resolution: {integrity: sha512-oMp5u+IM0Sd2+2Bq9HDhWui5fVmPfHRJ2BxRcE5Lns1TCVeKJPBRrWIvgT1x908Kh8waE0gnIlr+NOCHI0hmHA==, tarball: file:projects/arm-dns.tgz} + resolution: {integrity: sha512-r+5RMPQB/otJA+ODLrZ7lS7e29XHMVgrvBKPAuiiU58ec6yPJsLAPJzXBy1rXMjzuT0djzMyZ0fY5wIJhLmqlg==, tarball: file:projects/arm-dns.tgz} name: '@rush-temp/arm-dns' version: 0.0.0 dependencies: @@ -11428,13 +11428,14 @@ packages: '@types/node': 14.18.46 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_m742s5qpci6ulntpyriekwplh4 tslib: 2.5.0 - typescript: 5.0.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - supports-color diff --git a/sdk/dns/arm-dns/CHANGELOG.md b/sdk/dns/arm-dns/CHANGELOG.md index 8223906e5298..a4b34eaa5d4d 100644 --- a/sdk/dns/arm-dns/CHANGELOG.md +++ b/sdk/dns/arm-dns/CHANGELOG.md @@ -1,15 +1,50 @@ # Release History + +## 6.0.0-beta.1 (2023-05-17) + +**Features** -## 5.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group DnssecConfigs + - Added Interface DelegationSignerInfo + - Added Interface Digest + - Added Interface DnssecConfig + - Added Interface DnssecConfigListResult + - Added Interface DnssecConfigsCreateOrUpdateOptionalParams + - Added Interface DnssecConfigsDeleteHeaders + - Added Interface DnssecConfigsDeleteOptionalParams + - Added Interface DnssecConfigsGetOptionalParams + - Added Interface DnssecConfigsListByDnsZoneNextOptionalParams + - Added Interface DnssecConfigsListByDnsZoneOptionalParams + - Added Interface DsRecord + - Added Interface NaptrRecord + - Added Interface SigningKey + - Added Interface SystemData + - Added Interface TlsaRecord + - Added Interface ZonesDeleteHeaders + - Added Type Alias CreatedByType + - Added Type Alias DnssecConfigsCreateOrUpdateResponse + - Added Type Alias DnssecConfigsGetResponse + - Added Type Alias DnssecConfigsListByDnsZoneNextResponse + - Added Type Alias DnssecConfigsListByDnsZoneResponse + - Interface RecordSet has a new optional parameter dsRecords + - Interface RecordSet has a new optional parameter naptrRecords + - Interface RecordSet has a new optional parameter tlsaRecords + - Interface Zone has a new optional parameter signingKeys + - Interface Zone has a new optional parameter systemData + - Added Enum KnownCreatedByType -### Other Changes +**Breaking Changes** + - Interface RecordSetsListAllByDnsZoneNextOptionalParams no longer has parameter recordSetNameSuffix + - Interface RecordSetsListAllByDnsZoneNextOptionalParams no longer has parameter top + - Interface RecordSetsListByDnsZoneNextOptionalParams no longer has parameter recordsetnamesuffix + - Interface RecordSetsListByDnsZoneNextOptionalParams no longer has parameter top + - Interface RecordSetsListByTypeNextOptionalParams no longer has parameter recordsetnamesuffix + - Interface RecordSetsListByTypeNextOptionalParams no longer has parameter top + - Interface ZonesListByResourceGroupNextOptionalParams no longer has parameter top + - Interface ZonesListNextOptionalParams no longer has parameter top + + ## 5.1.0 (2022-11-22) **Features** diff --git a/sdk/dns/arm-dns/LICENSE b/sdk/dns/arm-dns/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/dns/arm-dns/LICENSE +++ b/sdk/dns/arm-dns/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 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/dns/arm-dns/README.md b/sdk/dns/arm-dns/README.md index d025447258b8..1a8d3de524fa 100644 --- a/sdk/dns/arm-dns/README.md +++ b/sdk/dns/arm-dns/README.md @@ -6,7 +6,7 @@ The DNS Management Client. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-dns) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dns) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dns?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/dns/arm-dns/_meta.json b/sdk/dns/arm-dns/_meta.json index 62bb5cac0934..6f1a3f373243 100644 --- a/sdk/dns/arm-dns/_meta.json +++ b/sdk/dns/arm-dns/_meta.json @@ -1,8 +1,8 @@ { - "commit": "20df2424a278ca19437e437a7dbf3a7857a0dd9d", + "commit": "fba4c8f5cb6b307f10d6844655031ec2e4b705ed", "readme": "specification/dns/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\dns\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/dns/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/dns/arm-dns/package.json b/sdk/dns/arm-dns/package.json index 9d88f77f7653..6fd6bbed6faf 100644 --- a/sdk/dns/arm-dns/package.json +++ b/sdk/dns/arm-dns/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DnsManagementClient.", - "version": "5.1.1", + "version": "6.0.0-beta.1", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,12 +33,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~5.0.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -49,7 +50,6 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -111,12 +111,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-dns?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dns/arm-dns" +} \ No newline at end of file diff --git a/sdk/dns/arm-dns/review/arm-dns.api.md b/sdk/dns/arm-dns/review/arm-dns.api.md index a5b61162778b..4d62e160d7f8 100644 --- a/sdk/dns/arm-dns/review/arm-dns.api.md +++ b/sdk/dns/arm-dns/review/arm-dns.api.md @@ -6,9 +6,9 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public export interface AaaaRecord { @@ -45,6 +45,22 @@ export interface CnameRecord { cname?: string; } +// @public +export type CreatedByType = string; + +// @public +export interface DelegationSignerInfo { + readonly digestAlgorithmType?: number; + readonly digestValue?: string; + readonly record?: string; +} + +// @public +export interface Digest { + algorithmType?: number; + value?: string; +} + // @public (undocumented) export class DnsManagementClient extends coreClient.ServiceClient { // (undocumented) @@ -55,6 +71,8 @@ export class DnsManagementClient extends coreClient.ServiceClient { // (undocumented) dnsResourceReferenceOperations: DnsResourceReferenceOperations; // (undocumented) + dnssecConfigs: DnssecConfigs; + // (undocumented) recordSets: RecordSets; // (undocumented) subscriptionId: string; @@ -97,15 +115,111 @@ export interface DnsResourceReferenceResult { dnsResourceReferences?: DnsResourceReference[]; } +// @public +export interface DnssecConfig { + etag?: string; + readonly id?: string; + readonly name?: string; + readonly provisioningState?: string; + readonly signingKeys?: SigningKey[]; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface DnssecConfigListResult { + readonly nextLink?: string; + value?: DnssecConfig[]; +} + +// @public +export interface DnssecConfigs { + beginCreateOrUpdate(resourceGroupName: string, zoneName: string, options?: DnssecConfigsCreateOrUpdateOptionalParams): Promise, DnssecConfigsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, zoneName: string, options?: DnssecConfigsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, zoneName: string, options?: DnssecConfigsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, zoneName: string, options?: DnssecConfigsDeleteOptionalParams): Promise; + get(resourceGroupName: string, zoneName: string, options?: DnssecConfigsGetOptionalParams): Promise; + listByDnsZone(resourceGroupName: string, zoneName: string, options?: DnssecConfigsListByDnsZoneOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DnssecConfigsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + ifNoneMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DnssecConfigsCreateOrUpdateResponse = DnssecConfig; + +// @public +export interface DnssecConfigsDeleteHeaders { + location?: string; +} + +// @public +export interface DnssecConfigsDeleteOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DnssecConfigsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DnssecConfigsGetResponse = DnssecConfig; + +// @public +export interface DnssecConfigsListByDnsZoneNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DnssecConfigsListByDnsZoneNextResponse = DnssecConfigListResult; + +// @public +export interface DnssecConfigsListByDnsZoneOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DnssecConfigsListByDnsZoneResponse = DnssecConfigListResult; + +// @public +export interface DsRecord { + algorithm?: number; + digest?: Digest; + keyTag?: number; +} + // @public export function getContinuationToken(page: unknown): string | undefined; +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + // @public export interface MxRecord { exchange?: string; preference?: number; } +// @public +export interface NaptrRecord { + flags?: string; + order?: number; + preference?: number; + regexp?: string; + replacement?: string; + services?: string; +} + // @public export interface NsRecord { nsdname?: string; @@ -122,6 +236,7 @@ export interface RecordSet { aRecords?: ARecord[]; caaRecords?: CaaRecord[]; cnameRecord?: CnameRecord; + dsRecords?: DsRecord[]; etag?: string; readonly fqdn?: string; readonly id?: string; @@ -130,12 +245,14 @@ export interface RecordSet { }; mxRecords?: MxRecord[]; readonly name?: string; + naptrRecords?: NaptrRecord[]; nsRecords?: NsRecord[]; readonly provisioningState?: string; ptrRecords?: PtrRecord[]; soaRecord?: SoaRecord; srvRecords?: SrvRecord[]; targetResource?: SubResource; + tlsaRecords?: TlsaRecord[]; ttl?: number; txtRecords?: TxtRecord[]; readonly type?: string; @@ -181,8 +298,6 @@ export type RecordSetsGetResponse = RecordSet; // @public export interface RecordSetsListAllByDnsZoneNextOptionalParams extends coreClient.OperationOptions { - recordSetNameSuffix?: string; - top?: number; } // @public @@ -199,8 +314,6 @@ export type RecordSetsListAllByDnsZoneResponse = RecordSetListResult; // @public export interface RecordSetsListByDnsZoneNextOptionalParams extends coreClient.OperationOptions { - recordsetnamesuffix?: string; - top?: number; } // @public @@ -217,8 +330,6 @@ export type RecordSetsListByDnsZoneResponse = RecordSetListResult; // @public export interface RecordSetsListByTypeNextOptionalParams extends coreClient.OperationOptions { - recordsetnamesuffix?: string; - top?: number; } // @public @@ -247,7 +358,7 @@ export interface RecordSetUpdateParameters { } // @public -export type RecordType = "A" | "AAAA" | "CAA" | "CNAME" | "MX" | "NS" | "PTR" | "SOA" | "SRV" | "TXT"; +export type RecordType = "A" | "AAAA" | "CAA" | "CNAME" | "MX" | "NS" | "PTR" | "SOA" | "SRV" | "TXT" | "TLSA" | "DS" | "NAPTR"; // @public export interface Resource { @@ -260,6 +371,16 @@ export interface Resource { readonly type?: string; } +// @public +export interface SigningKey { + readonly delegationSignerInfo?: DelegationSignerInfo[]; + readonly flags?: number; + readonly keyTag?: number; + readonly protocol?: number; + readonly publicKey?: string; + readonly securityAlgorithmType?: number; +} + // @public export interface SoaRecord { email?: string; @@ -284,6 +405,24 @@ export interface SubResource { id?: string; } +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TlsaRecord { + certAssociationData?: string; + matchingType?: number; + selector?: number; + usage?: number; +} + // @public export interface TxtRecord { value?: string[]; @@ -298,6 +437,8 @@ export interface Zone extends Resource { readonly numberOfRecordSets?: number; registrationVirtualNetworks?: SubResource[]; resolutionVirtualNetworks?: SubResource[]; + readonly signingKeys?: SigningKey[]; + readonly systemData?: SystemData; zoneType?: ZoneType; } @@ -309,7 +450,7 @@ export interface ZoneListResult { // @public export interface Zones { - beginDelete(resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams): Promise; createOrUpdate(resourceGroupName: string, zoneName: string, parameters: Zone, options?: ZonesCreateOrUpdateOptionalParams): Promise; get(resourceGroupName: string, zoneName: string, options?: ZonesGetOptionalParams): Promise; @@ -327,6 +468,11 @@ export interface ZonesCreateOrUpdateOptionalParams extends coreClient.OperationO // @public export type ZonesCreateOrUpdateResponse = Zone; +// @public +export interface ZonesDeleteHeaders { + location?: string; +} + // @public export interface ZonesDeleteOptionalParams extends coreClient.OperationOptions { ifMatch?: string; @@ -343,7 +489,6 @@ export type ZonesGetResponse = Zone; // @public export interface ZonesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public @@ -359,7 +504,6 @@ export type ZonesListByResourceGroupResponse = ZoneListResult; // @public export interface ZonesListNextOptionalParams extends coreClient.OperationOptions { - top?: number; } // @public diff --git a/sdk/dns/arm-dns/src/dnsManagementClient.ts b/sdk/dns/arm-dns/src/dnsManagementClient.ts index fffaf8fc4abf..489dd99670e7 100644 --- a/sdk/dns/arm-dns/src/dnsManagementClient.ts +++ b/sdk/dns/arm-dns/src/dnsManagementClient.ts @@ -15,11 +15,13 @@ import { } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { + DnssecConfigsImpl, RecordSetsImpl, ZonesImpl, DnsResourceReferenceOperationsImpl } from "./operations"; import { + DnssecConfigs, RecordSets, Zones, DnsResourceReferenceOperations @@ -34,8 +36,7 @@ export class DnsManagementClient extends coreClient.ServiceClient { /** * Initializes a new instance of the DnsManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId Specifies the Azure subscription ID, which uniquely identifies the Microsoft - * Azure subscription. + * @param subscriptionId The ID of the target subscription. * @param options The parameter options */ constructor( @@ -59,7 +60,7 @@ export class DnsManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-dns/5.1.1`; + const packageDetails = `azsdk-js-arm-dns/6.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -112,7 +113,8 @@ export class DnsManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2018-05-01"; + this.apiVersion = options.apiVersion || "2023-07-01-preview"; + this.dnssecConfigs = new DnssecConfigsImpl(this); this.recordSets = new RecordSetsImpl(this); this.zones = new ZonesImpl(this); this.dnsResourceReferenceOperations = new DnsResourceReferenceOperationsImpl( @@ -149,6 +151,7 @@ export class DnsManagementClient extends coreClient.ServiceClient { this.pipeline.addPolicy(apiVersionPolicy); } + dnssecConfigs: DnssecConfigs; recordSets: RecordSets; zones: Zones; dnsResourceReferenceOperations: DnsResourceReferenceOperations; diff --git a/sdk/dns/arm-dns/src/lroImpl.ts b/sdk/dns/arm-dns/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/dns/arm-dns/src/lroImpl.ts +++ b/sdk/dns/arm-dns/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; } diff --git a/sdk/dns/arm-dns/src/models/index.ts b/sdk/dns/arm-dns/src/models/index.ts index 9ebfbf2d1ae5..fd3996569950 100644 --- a/sdk/dns/arm-dns/src/models/index.ts +++ b/sdk/dns/arm-dns/src/models/index.ts @@ -8,6 +8,140 @@ import * as coreClient from "@azure/core-client"; +/** Represents the DNSSEC configuration. */ +export interface DnssecConfig { + /** + * The ID of the DNSSEC configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the DNSSEC configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the DNSSEC configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** The etag of the DNSSEC configuration. */ + etag?: string; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** + * Provisioning State of the DNSSEC configuration. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * The list of signing keys. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly signingKeys?: SigningKey[]; +} + +/** Represents the signing key. */ +export interface SigningKey { + /** + * The delegation signer information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly delegationSignerInfo?: DelegationSignerInfo[]; + /** + * The flags specifies how the key is used. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly flags?: number; + /** + * The key tag value of the DNSKEY Resource Record. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly keyTag?: number; + /** + * The protocol value. The value is always 3. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly protocol?: number; + /** + * The public key, represented as a Base64 encoding. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publicKey?: string; + /** + * The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly securityAlgorithmType?: number; +} + +/** The delegation signer information. */ +export interface DelegationSignerInfo { + /** + * The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly digestAlgorithmType?: number; + /** + * The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly digestValue?: string; + /** + * The record represents a delegation signer (DS) record. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly record?: string; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** An error response from the service. */ +export interface CloudError { + /** Cloud error body. */ + error?: CloudErrorBody; +} + +/** An error response from the service. */ +export interface CloudErrorBody { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code?: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message?: string; + /** The target of the particular error. For example, the name of the property in error. */ + target?: string; + /** A list of additional details about the error. */ + details?: CloudErrorBody[]; +} + +/** The response to a List DNSSEC configurations operation. */ +export interface DnssecConfigListResult { + /** Information about the DNSSEC configurations in the response. */ + value?: DnssecConfig[]; + /** + * The continuation token for the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + /** Describes a DNS record set (a collection of DNS records with the same name and type). */ export interface RecordSet { /** @@ -63,6 +197,12 @@ export interface RecordSet { soaRecord?: SoaRecord; /** The list of CAA records in the record set. */ caaRecords?: CaaRecord[]; + /** The list of DS records in the record set. */ + dsRecords?: DsRecord[]; + /** The list of TLSA records in the record set. */ + tlsaRecords?: TlsaRecord[]; + /** The list of NAPTR records in the record set. */ + naptrRecords?: NaptrRecord[]; } /** A reference to a another resource */ @@ -155,22 +295,50 @@ export interface CaaRecord { value?: string; } -/** An error response from the service. */ -export interface CloudError { - /** Cloud error body. */ - error?: CloudErrorBody; +/** A DS record. For more information about the DS record format, see RFC 4034: https://www.rfc-editor.org/rfc/rfc4034 */ +export interface DsRecord { + /** The key tag value is used to determine which DNSKEY Resource Record is used for signature verification. */ + keyTag?: number; + /** The security algorithm type represents the standard security algorithm number of the DNSKEY Resource Record. See: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml */ + algorithm?: number; + /** The digest entity. */ + digest?: Digest; } -/** An error response from the service. */ -export interface CloudErrorBody { - /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the error, intended to be suitable for display in a user interface. */ - message?: string; - /** The target of the particular error. For example, the name of the property in error. */ - target?: string; - /** A list of additional details about the error. */ - details?: CloudErrorBody[]; +/** A digest. */ +export interface Digest { + /** The digest algorithm type represents the standard digest algorithm number used to construct the digest. See: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml */ + algorithmType?: number; + /** The digest value is a cryptographic hash value of the referenced DNSKEY Resource Record. */ + value?: string; +} + +/** A TLSA record. For more information about the TLSA record format, see RFC 6698: https://www.rfc-editor.org/rfc/rfc6698 */ +export interface TlsaRecord { + /** The usage specifies the provided association that will be used to match the certificate presented in the TLS handshake. */ + usage?: number; + /** The selector specifies which part of the TLS certificate presented by the server will be matched against the association data. */ + selector?: number; + /** The matching type specifies how the certificate association is presented. */ + matchingType?: number; + /** This specifies the certificate association data to be matched. */ + certAssociationData?: string; +} + +/** A NAPTR record. For more information about the NAPTR record format, see RFC 3403: https://www.rfc-editor.org/rfc/rfc3403 */ +export interface NaptrRecord { + /** The order in which the NAPTR records MUST be processed in order to accurately represent the ordered list of rules. The ordering is from lowest to highest. Valid values: 0-65535. */ + order?: number; + /** The preference specifies the order in which NAPTR records with equal 'order' values should be processed, low numbers being processed before high numbers. Valid values: 0-65535. */ + preference?: number; + /** The flags specific to DDDS applications. Values currently defined in RFC 3404 are uppercase and lowercase letters "A", "P", "S", and "U", and the empty string, "". Enclose Flags in quotation marks. */ + flags?: string; + /** The services specific to DDDS applications. Enclose Services in quotation marks. */ + services?: string; + /** The regular expression that the DDDS application uses to convert an input value into an output value. For example: an IP phone system might use a regular expression to convert a phone number that is entered by a user into a SIP URI. Enclose the regular expression in quotation marks. Specify either a value for 'regexp' or a value for 'replacement'. */ + regexp?: string; + /** The replacement is a fully qualified domain name (FQDN) of the next domain name that you want the DDDS application to submit a DNS query for. The DDDS application replaces the input value with the value specified for replacement. Specify either a value for 'regexp' or a value for 'replacement'. If you specify a value for 'regexp', specify a dot (.) for 'replacement'. */ + replacement?: string; } /** The response to a record set List operation. */ @@ -254,6 +422,11 @@ export interface RecordSetUpdateParameters { export interface Zone extends Resource { /** The etag of the zone. */ etag?: string; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; /** * The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -280,8 +453,48 @@ export interface Zone extends Resource { registrationVirtualNetworks?: SubResource[]; /** A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. */ resolutionVirtualNetworks?: SubResource[]; -} - + /** + * The list of signing keys. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly signingKeys?: SigningKey[]; +} + +/** Defines headers for DnssecConfigs_delete operation. */ +export interface DnssecConfigsDeleteHeaders { + /** Location URI to poll for result */ + location?: string; +} + +/** Defines headers for Zones_delete operation. */ +export interface ZonesDeleteHeaders { + /** Location URI to poll for result */ + location?: string; +} + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; /** Defines values for RecordType. */ export type RecordType = | "A" @@ -293,10 +506,61 @@ export type RecordType = | "PTR" | "SOA" | "SRV" - | "TXT"; + | "TXT" + | "TLSA" + | "DS" + | "NAPTR"; /** Defines values for ZoneType. */ export type ZoneType = "Public" | "Private"; +/** Optional parameters. */ +export interface DnssecConfigsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** The etag of the DNSSEC configuration. Omit this value to always overwrite the DNSSEC configuration. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. */ + ifMatch?: string; + /** Set to '*' to allow this DNSSEC configuration to be created, but to prevent updating existing DNSSEC configuration. Other values will be ignored. */ + ifNoneMatch?: 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 DnssecConfigsCreateOrUpdateResponse = DnssecConfig; + +/** Optional parameters. */ +export interface DnssecConfigsDeleteOptionalParams + extends coreClient.OperationOptions { + /** The etag of this DNSSEC configuration. Omit this value to always delete the DNSSEC configuration. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. */ + 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; +} + +/** Optional parameters. */ +export interface DnssecConfigsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DnssecConfigsGetResponse = DnssecConfig; + +/** Optional parameters. */ +export interface DnssecConfigsListByDnsZoneOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByDnsZone operation. */ +export type DnssecConfigsListByDnsZoneResponse = DnssecConfigListResult; + +/** Optional parameters. */ +export interface DnssecConfigsListByDnsZoneNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByDnsZoneNext operation. */ +export type DnssecConfigsListByDnsZoneNextResponse = DnssecConfigListResult; + /** Optional parameters. */ export interface RecordSetsUpdateOptionalParams extends coreClient.OperationOptions { @@ -371,36 +635,21 @@ export type RecordSetsListAllByDnsZoneResponse = RecordSetListResult; /** Optional parameters. */ export interface RecordSetsListByTypeNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ - top?: number; - /** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with . */ - recordsetnamesuffix?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByTypeNext operation. */ export type RecordSetsListByTypeNextResponse = RecordSetListResult; /** Optional parameters. */ export interface RecordSetsListByDnsZoneNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ - top?: number; - /** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with . */ - recordsetnamesuffix?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByDnsZoneNext operation. */ export type RecordSetsListByDnsZoneNextResponse = RecordSetListResult; /** Optional parameters. */ export interface RecordSetsListAllByDnsZoneNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ - top?: number; - /** The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with . */ - recordSetNameSuffix?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAllByDnsZoneNext operation. */ export type RecordSetsListAllByDnsZoneNextResponse = RecordSetListResult; @@ -463,20 +712,14 @@ export type ZonesListResponse = ZoneListResult; /** Optional parameters. */ export interface ZonesListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ export type ZonesListByResourceGroupNextResponse = ZoneListResult; /** Optional parameters. */ export interface ZonesListNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of DNS zones to return. If not specified, returns up to 100 zones. */ - top?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ZonesListNextResponse = ZoneListResult; diff --git a/sdk/dns/arm-dns/src/models/mappers.ts b/sdk/dns/arm-dns/src/models/mappers.ts index a50750dc54e4..83c7090dde2f 100644 --- a/sdk/dns/arm-dns/src/models/mappers.ts +++ b/sdk/dns/arm-dns/src/models/mappers.ts @@ -8,6 +8,284 @@ import * as coreClient from "@azure/core-client"; +export const DnssecConfig: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DnssecConfig", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + signingKeys: { + serializedName: "properties.signingKeys", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SigningKey" + } + } + } + } + } + } +}; + +export const SigningKey: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SigningKey", + modelProperties: { + delegationSignerInfo: { + serializedName: "delegationSignerInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DelegationSignerInfo" + } + } + } + }, + flags: { + serializedName: "flags", + readOnly: true, + type: { + name: "Number" + } + }, + keyTag: { + serializedName: "keyTag", + readOnly: true, + type: { + name: "Number" + } + }, + protocol: { + serializedName: "protocol", + readOnly: true, + type: { + name: "Number" + } + }, + publicKey: { + serializedName: "publicKey", + readOnly: true, + type: { + name: "String" + } + }, + securityAlgorithmType: { + serializedName: "securityAlgorithmType", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const DelegationSignerInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DelegationSignerInfo", + modelProperties: { + digestAlgorithmType: { + serializedName: "digestAlgorithmType", + readOnly: true, + type: { + name: "Number" + } + }, + digestValue: { + serializedName: "digestValue", + readOnly: true, + type: { + name: "String" + } + }, + record: { + serializedName: "record", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const CloudError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "CloudErrorBody" + } + } + } + } +}; + +export const CloudErrorBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudErrorBody", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CloudErrorBody" + } + } + } + } + } + } +}; + +export const DnssecConfigListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DnssecConfigListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DnssecConfig" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const RecordSet: coreClient.CompositeMapper = { type: { name: "Composite", @@ -183,6 +461,42 @@ export const RecordSet: coreClient.CompositeMapper = { } } } + }, + dsRecords: { + serializedName: "properties.DSRecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DsRecord" + } + } + } + }, + tlsaRecords: { + serializedName: "properties.TLSARecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TlsaRecord" + } + } + } + }, + naptrRecords: { + serializedName: "properties.NAPTRRecords", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NaptrRecord" + } + } + } } } } @@ -430,55 +744,127 @@ export const CaaRecord: coreClient.CompositeMapper = { } }; -export const CloudError: coreClient.CompositeMapper = { +export const DsRecord: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudError", + className: "DsRecord", modelProperties: { - error: { - serializedName: "error", + keyTag: { + serializedName: "keyTag", + type: { + name: "Number" + } + }, + algorithm: { + serializedName: "algorithm", + type: { + name: "Number" + } + }, + digest: { + serializedName: "digest", type: { name: "Composite", - className: "CloudErrorBody" + className: "Digest" } } } } }; -export const CloudErrorBody: coreClient.CompositeMapper = { +export const Digest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudErrorBody", + className: "Digest", modelProperties: { - code: { - serializedName: "code", + algorithmType: { + serializedName: "algorithmType", + type: { + name: "Number" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const TlsaRecord: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TlsaRecord", + modelProperties: { + usage: { + serializedName: "usage", + type: { + name: "Number" + } + }, + selector: { + serializedName: "selector", + type: { + name: "Number" + } + }, + matchingType: { + serializedName: "matchingType", + type: { + name: "Number" + } + }, + certAssociationData: { + serializedName: "certAssociationData", type: { name: "String" } + } + } + } +}; + +export const NaptrRecord: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NaptrRecord", + modelProperties: { + order: { + serializedName: "order", + type: { + name: "Number" + } }, - message: { - serializedName: "message", + preference: { + serializedName: "preference", + type: { + name: "Number" + } + }, + flags: { + serializedName: "flags", type: { name: "String" } }, - target: { - serializedName: "target", + services: { + serializedName: "services", type: { name: "String" } }, - details: { - serializedName: "details", + regexp: { + serializedName: "regexp", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudErrorBody" - } - } + name: "String" + } + }, + replacement: { + serializedName: "replacement", + type: { + name: "String" } } } @@ -699,6 +1085,13 @@ export const Zone: coreClient.CompositeMapper = { name: "String" } }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, maxNumberOfRecordSets: { serializedName: "properties.maxNumberOfRecordSets", readOnly: true, @@ -763,6 +1156,49 @@ export const Zone: coreClient.CompositeMapper = { } } } + }, + signingKeys: { + serializedName: "properties.signingKeys", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SigningKey" + } + } + } + } + } + } +}; + +export const DnssecConfigsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DnssecConfigsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ZonesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ZonesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } } } } diff --git a/sdk/dns/arm-dns/src/models/parameters.ts b/sdk/dns/arm-dns/src/models/parameters.ts index f2f09e1baba3..5dd120e72b04 100644 --- a/sdk/dns/arm-dns/src/models/parameters.ts +++ b/sdk/dns/arm-dns/src/models/parameters.ts @@ -18,23 +18,6 @@ import { DnsResourceReferenceRequest as DnsResourceReferenceRequestMapper } from "../models/mappers"; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } - } -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: RecordSetMapper -}; - export const accept: OperationParameter = { parameterPath: "accept", mapper: { @@ -62,6 +45,10 @@ export const $host: OperationURLParameter = { export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { + constraints: { + MaxLength: 90, + MinLength: 1 + }, serializedName: "resourceGroupName", required: true, type: { @@ -81,45 +68,20 @@ export const zoneName: OperationURLParameter = { } }; -export const relativeRecordSetName: OperationURLParameter = { - parameterPath: "relativeRecordSetName", +export const ifMatch: OperationParameter = { + parameterPath: ["options", "ifMatch"], mapper: { - serializedName: "relativeRecordSetName", - required: true, + serializedName: "If-Match", type: { name: "String" } - }, - skipEncoding: true -}; - -export const recordType: OperationURLParameter = { - parameterPath: "recordType", - mapper: { - serializedName: "recordType", - required: true, - type: { - name: "Enum", - allowedValues: [ - "A", - "AAAA", - "CAA", - "CNAME", - "MX", - "NS", - "PTR", - "SOA", - "SRV", - "TXT" - ] - } } }; -export const ifMatch: OperationParameter = { - parameterPath: ["options", "ifMatch"], +export const ifNoneMatch: OperationParameter = { + parameterPath: ["options", "ifNoneMatch"], mapper: { - serializedName: "If-Match", + serializedName: "If-None-Match", type: { name: "String" } @@ -129,7 +91,7 @@ export const ifMatch: OperationParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2018-05-01", + defaultValue: "2023-07-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -141,6 +103,9 @@ export const apiVersion: OperationQueryParameter = { export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { + constraints: { + MinLength: 1 + }, serializedName: "subscriptionId", required: true, type: { @@ -149,16 +114,73 @@ export const subscriptionId: OperationURLParameter = { } }; -export const ifNoneMatch: OperationParameter = { - parameterPath: ["options", "ifNoneMatch"], +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { - serializedName: "If-None-Match", + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: RecordSetMapper +}; + +export const relativeRecordSetName: OperationURLParameter = { + parameterPath: "relativeRecordSetName", + mapper: { + serializedName: "relativeRecordSetName", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const recordType: OperationURLParameter = { + parameterPath: "recordType", + mapper: { + serializedName: "recordType", + required: true, + type: { + name: "Enum", + allowedValues: [ + "A", + "AAAA", + "CAA", + "CNAME", + "MX", + "NS", + "PTR", + "SOA", + "SRV", + "TXT", + "TLSA", + "DS", + "NAPTR" + ] + } + } +}; + export const top: OperationQueryParameter = { parameterPath: ["options", "top"], mapper: { @@ -189,18 +211,6 @@ export const recordSetNameSuffix: OperationQueryParameter = { } }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String" - } - }, - skipEncoding: true -}; - export const parameters1: OperationParameter = { parameterPath: "parameters", mapper: ZoneMapper diff --git a/sdk/dns/arm-dns/src/operations/dnsResourceReferenceOperations.ts b/sdk/dns/arm-dns/src/operations/dnsResourceReferenceOperations.ts index cd888a059a4f..66338631e94f 100644 --- a/sdk/dns/arm-dns/src/operations/dnsResourceReferenceOperations.ts +++ b/sdk/dns/arm-dns/src/operations/dnsResourceReferenceOperations.ts @@ -63,7 +63,7 @@ const getByTargetResourcesOperationSpec: coreClient.OperationSpec = { requestBody: Parameters.parameters3, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.contentType, Parameters.accept], + headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", serializer }; diff --git a/sdk/dns/arm-dns/src/operations/dnssecConfigs.ts b/sdk/dns/arm-dns/src/operations/dnssecConfigs.ts new file mode 100644 index 000000000000..0a7025c2d62d --- /dev/null +++ b/sdk/dns/arm-dns/src/operations/dnssecConfigs.ts @@ -0,0 +1,474 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { DnssecConfigs } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DnsManagementClient } from "../dnsManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + DnssecConfig, + DnssecConfigsListByDnsZoneNextOptionalParams, + DnssecConfigsListByDnsZoneOptionalParams, + DnssecConfigsListByDnsZoneResponse, + DnssecConfigsCreateOrUpdateOptionalParams, + DnssecConfigsCreateOrUpdateResponse, + DnssecConfigsDeleteOptionalParams, + DnssecConfigsGetOptionalParams, + DnssecConfigsGetResponse, + DnssecConfigsListByDnsZoneNextResponse +} from "../models"; + +/// +/** Class containing DnssecConfigs operations. */ +export class DnssecConfigsImpl implements DnssecConfigs { + private readonly client: DnsManagementClient; + + /** + * Initialize a new instance of the class DnssecConfigs class. + * @param client Reference to the service client + */ + constructor(client: DnsManagementClient) { + this.client = client; + } + + /** + * Lists the DNSSEC configurations in a DNS zone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + public listByDnsZone( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsListByDnsZoneOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByDnsZonePagingAll( + resourceGroupName, + zoneName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByDnsZonePagingPage( + resourceGroupName, + zoneName, + options, + settings + ); + } + }; + } + + private async *listByDnsZonePagingPage( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsListByDnsZoneOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: DnssecConfigsListByDnsZoneResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByDnsZone(resourceGroupName, zoneName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByDnsZoneNext( + resourceGroupName, + zoneName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByDnsZonePagingAll( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsListByDnsZoneOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByDnsZonePagingPage( + resourceGroupName, + zoneName, + options + )) { + yield* page; + } + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + DnssecConfigsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, zoneName, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + DnssecConfigsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + zoneName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, zoneName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete(resourceGroupName, zoneName, options); + return poller.pollUntilDone(); + } + + /** + * Gets the DNSSEC configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + get( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, zoneName, options }, + getOperationSpec + ); + } + + /** + * Lists the DNSSEC configurations in a DNS zone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + private _listByDnsZone( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsListByDnsZoneOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, zoneName, options }, + listByDnsZoneOperationSpec + ); + } + + /** + * ListByDnsZoneNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param nextLink The nextLink from the previous successful call to the ListByDnsZone method. + * @param options The options parameters. + */ + private _listByDnsZoneNext( + resourceGroupName: string, + zoneName: string, + nextLink: string, + options?: DnssecConfigsListByDnsZoneNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, zoneName, nextLink, options }, + listByDnsZoneNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DnssecConfig + }, + 201: { + bodyMapper: Mappers.DnssecConfig + }, + 202: { + bodyMapper: Mappers.DnssecConfig + }, + 204: { + bodyMapper: Mappers.DnssecConfig + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, + Parameters.subscriptionId + ], + headerParameters: [ + Parameters.accept, + Parameters.ifMatch, + Parameters.ifNoneMatch + ], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept, Parameters.ifMatch], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DnssecConfig + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDnsZoneOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/dnssecConfigs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DnssecConfigListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByDnsZoneNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DnssecConfigListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.zoneName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/dns/arm-dns/src/operations/index.ts b/sdk/dns/arm-dns/src/operations/index.ts index 249eca50d8e6..9ca54c721bf2 100644 --- a/sdk/dns/arm-dns/src/operations/index.ts +++ b/sdk/dns/arm-dns/src/operations/index.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./dnssecConfigs"; export * from "./recordSets"; export * from "./zones"; export * from "./dnsResourceReferenceOperations"; diff --git a/sdk/dns/arm-dns/src/operations/recordSets.ts b/sdk/dns/arm-dns/src/operations/recordSets.ts index cd2c8fec50bd..d8a6b3db70c5 100644 --- a/sdk/dns/arm-dns/src/operations/recordSets.ts +++ b/sdk/dns/arm-dns/src/operations/recordSets.ts @@ -52,9 +52,9 @@ export class RecordSetsImpl implements RecordSets { /** * Lists the record sets of a specified type in a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. + * @param recordType The type of DNS record in this record set. * @param options The options parameters. */ public listByType( @@ -145,7 +145,7 @@ export class RecordSetsImpl implements RecordSets { /** * Lists all record sets in a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -225,7 +225,7 @@ export class RecordSetsImpl implements RecordSets { /** * Lists all record sets in a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -309,7 +309,7 @@ export class RecordSetsImpl implements RecordSets { /** * Updates a record set within a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. * @param recordType The type of DNS record in this record set. @@ -338,12 +338,12 @@ export class RecordSetsImpl implements RecordSets { } /** - * Creates or updates a record set within a DNS zone. - * @param resourceGroupName The name of the resource group. + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not + * created (they are created when the DNS zone is created). + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated - * but not created (they are created when the DNS zone is created). + * @param recordType The type of DNS record in this record set. * @param parameters Parameters supplied to the CreateOrUpdate operation. * @param options The options parameters. */ @@ -369,12 +369,12 @@ export class RecordSetsImpl implements RecordSets { } /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * @param resourceGroupName The name of the resource group. + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA + * cannot be deleted (they are deleted when the DNS zone is deleted). + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be - * deleted (they are deleted when the DNS zone is deleted). + * @param recordType The type of DNS record in this record set. * @param options The options parameters. */ delete( @@ -398,7 +398,7 @@ export class RecordSetsImpl implements RecordSets { /** * Gets a record set. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. * @param recordType The type of DNS record in this record set. @@ -425,9 +425,9 @@ export class RecordSetsImpl implements RecordSets { /** * Lists the record sets of a specified type in a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. + * @param recordType The type of DNS record in this record set. * @param options The options parameters. */ private _listByType( @@ -444,7 +444,7 @@ export class RecordSetsImpl implements RecordSets { /** * Lists all record sets in a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -461,7 +461,7 @@ export class RecordSetsImpl implements RecordSets { /** * Lists all record sets in a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -478,9 +478,9 @@ export class RecordSetsImpl implements RecordSets { /** * ListByTypeNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. + * @param recordType The type of DNS record in this record set. * @param nextLink The nextLink from the previous successful call to the ListByType method. * @param options The options parameters. */ @@ -499,7 +499,7 @@ export class RecordSetsImpl implements RecordSets { /** * ListByDnsZoneNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param nextLink The nextLink from the previous successful call to the ListByDnsZone method. * @param options The options parameters. @@ -518,7 +518,7 @@ export class RecordSetsImpl implements RecordSets { /** * ListAllByDnsZoneNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param nextLink The nextLink from the previous successful call to the ListAllByDnsZone method. * @param options The options parameters. @@ -556,14 +556,14 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, + Parameters.subscriptionId, Parameters.relativeRecordSetName, - Parameters.recordType, - Parameters.subscriptionId + Parameters.recordType ], headerParameters: [ - Parameters.contentType, Parameters.accept, - Parameters.ifMatch + Parameters.ifMatch, + Parameters.contentType ], mediaType: "json", serializer @@ -589,15 +589,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, + Parameters.subscriptionId, Parameters.relativeRecordSetName, - Parameters.recordType, - Parameters.subscriptionId + Parameters.recordType ], headerParameters: [ - Parameters.contentType, Parameters.accept, Parameters.ifMatch, - Parameters.ifNoneMatch + Parameters.ifNoneMatch, + Parameters.contentType ], mediaType: "json", serializer @@ -618,9 +618,9 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, + Parameters.subscriptionId, Parameters.relativeRecordSetName, - Parameters.recordType, - Parameters.subscriptionId + Parameters.recordType ], headerParameters: [Parameters.accept, Parameters.ifMatch], serializer @@ -642,9 +642,9 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, + Parameters.subscriptionId, Parameters.relativeRecordSetName, - Parameters.recordType, - Parameters.subscriptionId + Parameters.recordType ], headerParameters: [Parameters.accept], serializer @@ -670,8 +670,8 @@ const listByTypeOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, - Parameters.recordType, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.recordType ], headerParameters: [Parameters.accept], serializer @@ -739,18 +739,13 @@ const listByTypeNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.top, - Parameters.recordsetnamesuffix - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.zoneName, - Parameters.recordType, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, + Parameters.recordType ], headerParameters: [Parameters.accept], serializer @@ -766,11 +761,6 @@ const listByDnsZoneNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.top, - Parameters.recordsetnamesuffix - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -792,11 +782,6 @@ const listAllByDnsZoneNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.top, - Parameters.recordSetNameSuffix - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/dns/arm-dns/src/operations/zones.ts b/sdk/dns/arm-dns/src/operations/zones.ts index b0944aa02ffd..8630ea29b864 100644 --- a/sdk/dns/arm-dns/src/operations/zones.ts +++ b/sdk/dns/arm-dns/src/operations/zones.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { DnsManagementClient } from "../dnsManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Zone, ZonesListByResourceGroupNextOptionalParams, @@ -50,7 +54,7 @@ export class ZonesImpl implements Zones { /** * Lists the DNS zones within a resource group. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ public listByResourceGroup( @@ -173,7 +177,7 @@ export class ZonesImpl implements Zones { /** * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param parameters Parameters supplied to the CreateOrUpdate operation. * @param options The options parameters. @@ -193,7 +197,7 @@ export class ZonesImpl implements Zones { /** * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot * be undone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -201,14 +205,14 @@ export class ZonesImpl implements Zones { resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -241,13 +245,13 @@ export class ZonesImpl implements Zones { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, zoneName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, zoneName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -257,7 +261,7 @@ export class ZonesImpl implements Zones { /** * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot * be undone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -272,7 +276,7 @@ export class ZonesImpl implements Zones { /** * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -289,7 +293,7 @@ export class ZonesImpl implements Zones { /** * Updates a DNS zone. Does not modify DNS records within the zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param parameters Parameters supplied to the Update operation. * @param options The options parameters. @@ -308,7 +312,7 @@ export class ZonesImpl implements Zones { /** * Lists the DNS zones within a resource group. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ private _listByResourceGroup( @@ -331,7 +335,7 @@ export class ZonesImpl implements Zones { /** * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. * @param options The options parameters. */ @@ -388,10 +392,10 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId ], headerParameters: [ - Parameters.contentType, Parameters.accept, Parameters.ifMatch, - Parameters.ifNoneMatch + Parameters.ifNoneMatch, + Parameters.contentType ], mediaType: "json", serializer @@ -462,9 +466,9 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId ], headerParameters: [ - Parameters.contentType, Parameters.accept, - Parameters.ifMatch + Parameters.ifMatch, + Parameters.contentType ], mediaType: "json", serializer @@ -517,7 +521,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -538,7 +541,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.top], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/dns/arm-dns/src/operationsInterfaces/dnssecConfigs.ts b/sdk/dns/arm-dns/src/operationsInterfaces/dnssecConfigs.ts new file mode 100644 index 000000000000..01281d5dd924 --- /dev/null +++ b/sdk/dns/arm-dns/src/operationsInterfaces/dnssecConfigs.ts @@ -0,0 +1,95 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + DnssecConfig, + DnssecConfigsListByDnsZoneOptionalParams, + DnssecConfigsCreateOrUpdateOptionalParams, + DnssecConfigsCreateOrUpdateResponse, + DnssecConfigsDeleteOptionalParams, + DnssecConfigsGetOptionalParams, + DnssecConfigsGetResponse +} from "../models"; + +/// +/** Interface representing a DnssecConfigs. */ +export interface DnssecConfigs { + /** + * Lists the DNSSEC configurations in a DNS zone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + listByDnsZone( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsListByDnsZoneOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + DnssecConfigsCreateOrUpdateResponse + > + >; + /** + * Creates or updates the DNSSEC configuration on a DNS zone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the DNSSEC configuration on a DNS zone. This operation cannot be undone. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsDeleteOptionalParams + ): Promise; + /** + * Gets the DNSSEC configuration. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param zoneName The name of the DNS zone (without a terminating dot). + * @param options The options parameters. + */ + get( + resourceGroupName: string, + zoneName: string, + options?: DnssecConfigsGetOptionalParams + ): Promise; +} diff --git a/sdk/dns/arm-dns/src/operationsInterfaces/index.ts b/sdk/dns/arm-dns/src/operationsInterfaces/index.ts index 249eca50d8e6..9ca54c721bf2 100644 --- a/sdk/dns/arm-dns/src/operationsInterfaces/index.ts +++ b/sdk/dns/arm-dns/src/operationsInterfaces/index.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./dnssecConfigs"; export * from "./recordSets"; export * from "./zones"; export * from "./dnsResourceReferenceOperations"; diff --git a/sdk/dns/arm-dns/src/operationsInterfaces/recordSets.ts b/sdk/dns/arm-dns/src/operationsInterfaces/recordSets.ts index a3c98a9f173b..ff9b6af3e4e8 100644 --- a/sdk/dns/arm-dns/src/operationsInterfaces/recordSets.ts +++ b/sdk/dns/arm-dns/src/operationsInterfaces/recordSets.ts @@ -27,9 +27,9 @@ import { export interface RecordSets { /** * Lists the record sets of a specified type in a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). - * @param recordType The type of record sets to enumerate. + * @param recordType The type of DNS record in this record set. * @param options The options parameters. */ listByType( @@ -40,7 +40,7 @@ export interface RecordSets { ): PagedAsyncIterableIterator; /** * Lists all record sets in a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -51,7 +51,7 @@ export interface RecordSets { ): PagedAsyncIterableIterator; /** * Lists all record sets in a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -62,7 +62,7 @@ export interface RecordSets { ): PagedAsyncIterableIterator; /** * Updates a record set within a DNS zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. * @param recordType The type of DNS record in this record set. @@ -78,12 +78,12 @@ export interface RecordSets { options?: RecordSetsUpdateOptionalParams ): Promise; /** - * Creates or updates a record set within a DNS zone. - * @param resourceGroupName The name of the resource group. + * Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not + * created (they are created when the DNS zone is created). + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA can be updated - * but not created (they are created when the DNS zone is created). + * @param recordType The type of DNS record in this record set. * @param parameters Parameters supplied to the CreateOrUpdate operation. * @param options The options parameters. */ @@ -96,12 +96,12 @@ export interface RecordSets { options?: RecordSetsCreateOrUpdateOptionalParams ): Promise; /** - * Deletes a record set from a DNS zone. This operation cannot be undone. - * @param resourceGroupName The name of the resource group. + * Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA + * cannot be deleted (they are deleted when the DNS zone is deleted). + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. - * @param recordType The type of DNS record in this record set. Record sets of type SOA cannot be - * deleted (they are deleted when the DNS zone is deleted). + * @param recordType The type of DNS record in this record set. * @param options The options parameters. */ delete( @@ -113,7 +113,7 @@ export interface RecordSets { ): Promise; /** * Gets a record set. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param relativeRecordSetName The name of the record set, relative to the name of the zone. * @param recordType The type of DNS record in this record set. diff --git a/sdk/dns/arm-dns/src/operationsInterfaces/zones.ts b/sdk/dns/arm-dns/src/operationsInterfaces/zones.ts index 2de4bd98877a..82e966604004 100644 --- a/sdk/dns/arm-dns/src/operationsInterfaces/zones.ts +++ b/sdk/dns/arm-dns/src/operationsInterfaces/zones.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Zone, ZonesListByResourceGroupOptionalParams, @@ -27,7 +27,7 @@ import { export interface Zones { /** * Lists the DNS zones within a resource group. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ listByResourceGroup( @@ -41,7 +41,7 @@ export interface Zones { list(options?: ZonesListOptionalParams): PagedAsyncIterableIterator; /** * Creates or updates a DNS zone. Does not modify DNS records within the zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param parameters Parameters supplied to the CreateOrUpdate operation. * @param options The options parameters. @@ -55,7 +55,7 @@ export interface Zones { /** * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot * be undone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -63,11 +63,11 @@ export interface Zones { resourceGroupName: string, zoneName: string, options?: ZonesDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot * be undone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -78,7 +78,7 @@ export interface Zones { ): Promise; /** * Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param options The options parameters. */ @@ -89,7 +89,7 @@ export interface Zones { ): Promise; /** * Updates a DNS zone. Does not modify DNS records within the zone. - * @param resourceGroupName The name of the resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param zoneName The name of the DNS zone (without a terminating dot). * @param parameters Parameters supplied to the Update operation. * @param options The options parameters. diff --git a/sdk/dns/arm-dns/src/pagingHelper.ts b/sdk/dns/arm-dns/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/dns/arm-dns/src/pagingHelper.ts +++ b/sdk/dns/arm-dns/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/dns/arm-dns/tsconfig.json b/sdk/dns/arm-dns/tsconfig.json index 5741b264d59d..3e6ae96443f3 100644 --- a/sdk/dns/arm-dns/tsconfig.json +++ b/sdk/dns/arm-dns/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-dns": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"