From f1cb73cc6341cadcead7789cbc07ca2a9b2ea1e2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 26 Aug 2022 17:46:18 +0000 Subject: [PATCH] CodeGen from PR 20414 in Azure/azure-rest-api-specs Merge e17f533db77eaa2e1c1cea3622fb4512902f81de into 152050002a09b76fd66ddb82dd9e90a41d87906c --- .../arm-networkfunction/CHANGELOG.md | 20 +- .../arm-networkfunction/_meta.json | 6 +- .../arm-networkfunction/package.json | 14 +- .../review/arm-networkfunction.api.md | 20 +- .../src/azureTrafficCollectorClient.ts | 4 +- .../arm-networkfunction/src/models/index.ts | 120 ++++++------ .../arm-networkfunction/src/models/mappers.ts | 173 ++++++++---------- .../src/models/parameters.ts | 12 +- .../src/operations/collectorPolicies.ts | 2 + .../arm-networkfunction/tsconfig.json | 10 +- 10 files changed, 194 insertions(+), 187 deletions(-) diff --git a/sdk/networkfunction/arm-networkfunction/CHANGELOG.md b/sdk/networkfunction/arm-networkfunction/CHANGELOG.md index 4b65829fe942..c17fce6d84ac 100644 --- a/sdk/networkfunction/arm-networkfunction/CHANGELOG.md +++ b/sdk/networkfunction/arm-networkfunction/CHANGELOG.md @@ -1,15 +1,19 @@ # Release History + +## 2.0.0 (2022-08-26) + +**Features** -## 1.0.1 (Unreleased) + - Added Type Alias ApiVersionParameter + - Interface CollectorPoliciesCreateOrUpdateOptionalParams has a new optional parameter location + - Interface CollectorPoliciesCreateOrUpdateOptionalParams has a new optional parameter tags + - Added Enum KnownApiVersionParameter -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +**Breaking Changes** + - Interface CollectorPolicy no longer has parameter systemData + + ## 1.0.0 (2022-07-13) The package of @azure/arm-networkfunction is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/networkfunction/arm-networkfunction/_meta.json b/sdk/networkfunction/arm-networkfunction/_meta.json index 8ec2390a7150..37843d882405 100644 --- a/sdk/networkfunction/arm-networkfunction/_meta.json +++ b/sdk/networkfunction/arm-networkfunction/_meta.json @@ -1,8 +1,8 @@ { - "commit": "96c6e14d4dfd2aef59a69a43185308567fec8c07", + "commit": "46524da75141b904fbfb70bcc08300ca116214fd", "readme": "specification/networkfunction/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --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\\networkfunction\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/networkfunction/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/networkfunction/arm-networkfunction/package.json b/sdk/networkfunction/arm-networkfunction/package.json index 3a2cca8b1d63..79da39e3fa65 100644 --- a/sdk/networkfunction/arm-networkfunction/package.json +++ b/sdk/networkfunction/arm-networkfunction/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AzureTrafficCollectorClient.", - "version": "1.0.1", + "version": "2.0.0", "engines": { "node": ">=12.0.0" }, @@ -109,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-networkfunction?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/networkfunction/arm-networkfunction/review/arm-networkfunction.api.md b/sdk/networkfunction/arm-networkfunction/review/arm-networkfunction.api.md index f731ac8c4ab6..9aa89aeb597d 100644 --- a/sdk/networkfunction/arm-networkfunction/review/arm-networkfunction.api.md +++ b/sdk/networkfunction/arm-networkfunction/review/arm-networkfunction.api.md @@ -10,6 +10,9 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; +// @public +export type ApiVersionParameter = string; + // @public export interface AzureTrafficCollector extends TrackedResource { collectorPolicies?: CollectorPolicy[]; @@ -162,7 +165,11 @@ export interface CollectorPolicies { export interface CollectorPoliciesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { emissionPolicies?: EmissionPoliciesPropertiesFormat[]; ingestionPolicy?: IngestionPolicyPropertiesFormat; + location?: string; resumeFrom?: string; + tags?: { + [propertyName: string]: string; + }; updateIntervalInMs?: number; } @@ -197,12 +204,11 @@ export interface CollectorPoliciesListOptionalParams extends coreClient.Operatio export type CollectorPoliciesListResponse = CollectorPolicyListResult; // @public -export interface CollectorPolicy extends ProxyResource { +export interface CollectorPolicy extends TrackedResource { emissionPolicies?: EmissionPoliciesPropertiesFormat[]; readonly etag?: string; ingestionPolicy?: IngestionPolicyPropertiesFormat; readonly provisioningState?: ProvisioningState; - readonly systemData?: CollectorPolicySystemData; } // @public @@ -211,10 +217,6 @@ export interface CollectorPolicyListResult { value?: CollectorPolicy[]; } -// @public -export interface CollectorPolicySystemData extends SystemData { -} - // @public export type CreatedByType = string; @@ -250,6 +252,12 @@ export interface IngestionSourcesPropertiesFormat { // @public export type IngestionType = string; +// @public +export enum KnownApiVersionParameter { + TwoThousandTwentyTwo0501 = "2022-05-01", + TwoThousandTwentyTwo0801 = "2022-08-01" +} + // @public export enum KnownCreatedByType { Application = "Application", diff --git a/sdk/networkfunction/arm-networkfunction/src/azureTrafficCollectorClient.ts b/sdk/networkfunction/arm-networkfunction/src/azureTrafficCollectorClient.ts index 5041d5ac9da9..fd30693973e9 100644 --- a/sdk/networkfunction/arm-networkfunction/src/azureTrafficCollectorClient.ts +++ b/sdk/networkfunction/arm-networkfunction/src/azureTrafficCollectorClient.ts @@ -62,7 +62,7 @@ export class AzureTrafficCollectorClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-networkfunction/1.0.1`; + const packageDetails = `azsdk-js-arm-networkfunction/2.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -109,7 +109,7 @@ export class AzureTrafficCollectorClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-05-01"; + this.apiVersion = options.apiVersion || "2022-08-01"; this.networkFunction = new NetworkFunctionImpl(this); this.azureTrafficCollectorsBySubscription = new AzureTrafficCollectorsBySubscriptionImpl( this diff --git a/sdk/networkfunction/arm-networkfunction/src/models/index.ts b/sdk/networkfunction/arm-networkfunction/src/models/index.ts index aeefbe1e13c3..4e37e20ac88e 100644 --- a/sdk/networkfunction/arm-networkfunction/src/models/index.ts +++ b/sdk/networkfunction/arm-networkfunction/src/models/index.ts @@ -99,48 +99,6 @@ export interface EmissionPolicyDestination { destinationType?: DestinationType; } -/** 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; -} - -/** An azure resource object */ -export interface ProxyResource { - /** - * Azure resource Id - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Azure resource type - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Azure resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; -} - -/** Resource reference properties. */ -export interface ResourceReference { - /** - * Resource ID. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - /** Common resource representation. */ export interface TrackedResource { /** @@ -169,6 +127,29 @@ export interface TrackedResource { readonly systemData?: TrackedResourceSystemData; } +/** 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; +} + +/** Resource reference properties. */ +export interface ResourceReference { + /** + * Resource ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; +} + /** Tags object for patch operations. */ export interface TagsObject { /** Resource tags. */ @@ -186,24 +167,32 @@ export interface CollectorPolicyListResult { readonly nextLink?: string; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface CollectorPolicySystemData extends SystemData {} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface TrackedResourceSystemData extends SystemData {} +/** An azure resource object */ +export interface ProxyResource { + /** + * Azure resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Azure resource type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure resource name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; +} /** Collector policy resource. */ -export interface CollectorPolicy extends ProxyResource { +export interface CollectorPolicy extends TrackedResource { /** * A unique read-only string that changes whenever the resource is updated. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly 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?: CollectorPolicySystemData; /** Ingestion policies. */ ingestionPolicy?: IngestionPolicyPropertiesFormat; /** Emission policies. */ @@ -233,6 +222,9 @@ export interface AzureTrafficCollector extends TrackedResource { readonly provisioningState?: ProvisioningState; } +/** Metadata pertaining to creation and last modification of the resource. */ +export interface TrackedResourceSystemData extends SystemData {} + /** Known values of {@link IngestionType} that the service accepts. */ export enum KnownIngestionType { /** Ipfix */ @@ -341,6 +333,24 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link ApiVersionParameter} that the service accepts. */ +export enum KnownApiVersionParameter { + /** TwoThousandTwentyTwo0501 */ + TwoThousandTwentyTwo0501 = "2022-05-01", + /** TwoThousandTwentyTwo0801 */ + TwoThousandTwentyTwo0801 = "2022-08-01" +} + +/** + * Defines values for ApiVersionParameter. \ + * {@link KnownApiVersionParameter} can be used interchangeably with ApiVersionParameter, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **2022-05-01** \ + * **2022-08-01** + */ +export type ApiVersionParameter = string; + /** Optional parameters. */ export interface NetworkFunctionListOperationsOptionalParams extends coreClient.OperationOptions {} @@ -436,6 +446,10 @@ export type CollectorPoliciesGetResponse = CollectorPolicy; /** Optional parameters. */ export interface CollectorPoliciesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + /** Resource location. */ + location?: string; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; /** Ingestion policies. */ ingestionPolicy?: IngestionPolicyPropertiesFormat; /** Emission policies. */ diff --git a/sdk/networkfunction/arm-networkfunction/src/models/mappers.ts b/sdk/networkfunction/arm-networkfunction/src/models/mappers.ts index 0432d53758ed..ff35a3609bb1 100644 --- a/sdk/networkfunction/arm-networkfunction/src/models/mappers.ts +++ b/sdk/networkfunction/arm-networkfunction/src/models/mappers.ts @@ -276,83 +276,87 @@ export const EmissionPolicyDestination: coreClient.CompositeMapper = { } }; -export const SystemData: coreClient.CompositeMapper = { +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "TrackedResource", modelProperties: { - createdBy: { - serializedName: "createdBy", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - createdByType: { - serializedName: "createdByType", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - createdAt: { - serializedName: "createdAt", + type: { + serializedName: "type", + readOnly: true, type: { - name: "DateTime" + name: "String" } }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + location: { + serializedName: "location", type: { name: "String" } }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + tags: { + serializedName: "tags", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "TrackedResourceSystemData" } } } } }; -export const ProxyResource: coreClient.CompositeMapper = { +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyResource", + className: "SystemData", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + createdBy: { + serializedName: "createdBy", type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + createdByType: { + serializedName: "createdByType", type: { name: "String" } }, - name: { - serializedName: "name", - readOnly: true, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { name: "String" } - } - } - } -}; - -export const ResourceReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceReference", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { name: "String" } @@ -361,10 +365,10 @@ export const ResourceReference: coreClient.CompositeMapper = { } }; -export const TrackedResource: coreClient.CompositeMapper = { +export const ResourceReference: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "ResourceReference", modelProperties: { id: { serializedName: "id", @@ -372,40 +376,6 @@ export const TrackedResource: coreClient.CompositeMapper = { type: { name: "String" } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "TrackedResourceSystemData" - } } } } @@ -455,22 +425,32 @@ export const CollectorPolicyListResult: coreClient.CompositeMapper = { } }; -export const CollectorPolicySystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CollectorPolicySystemData", - modelProperties: { - ...SystemData.type.modelProperties - } - } -}; - -export const TrackedResourceSystemData: coreClient.CompositeMapper = { +export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResourceSystemData", + className: "ProxyResource", modelProperties: { - ...SystemData.type.modelProperties + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + } } } }; @@ -480,7 +460,7 @@ export const CollectorPolicy: coreClient.CompositeMapper = { name: "Composite", className: "CollectorPolicy", modelProperties: { - ...ProxyResource.type.modelProperties, + ...TrackedResource.type.modelProperties, etag: { serializedName: "etag", readOnly: true, @@ -488,13 +468,6 @@ export const CollectorPolicy: coreClient.CompositeMapper = { name: "String" } }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "CollectorPolicySystemData" - } - }, ingestionPolicy: { serializedName: "properties.ingestionPolicy", type: { @@ -567,3 +540,13 @@ export const AzureTrafficCollector: coreClient.CompositeMapper = { } } }; + +export const TrackedResourceSystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResourceSystemData", + modelProperties: { + ...SystemData.type.modelProperties + } + } +}; diff --git a/sdk/networkfunction/arm-networkfunction/src/models/parameters.ts b/sdk/networkfunction/arm-networkfunction/src/models/parameters.ts index 026880fe15c2..bc57a4022afd 100644 --- a/sdk/networkfunction/arm-networkfunction/src/models/parameters.ts +++ b/sdk/networkfunction/arm-networkfunction/src/models/parameters.ts @@ -44,7 +44,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-05-01", + defaultValue: "2022-08-01", isConstant: true, serializedName: "api-version", type: { @@ -146,6 +146,16 @@ export const collectorPolicyName: OperationURLParameter = { } }; +export const location1: OperationParameter = { + parameterPath: ["options", "location"], + mapper: CollectorPolicyMapper +}; + +export const tags1: OperationParameter = { + parameterPath: ["options", "tags"], + mapper: CollectorPolicyMapper +}; + export const ingestionPolicy: OperationParameter = { parameterPath: ["options", "ingestionPolicy"], mapper: CollectorPolicyMapper diff --git a/sdk/networkfunction/arm-networkfunction/src/operations/collectorPolicies.ts b/sdk/networkfunction/arm-networkfunction/src/operations/collectorPolicies.ts index 7e521971c6ad..07a611a18e8d 100644 --- a/sdk/networkfunction/arm-networkfunction/src/operations/collectorPolicies.ts +++ b/sdk/networkfunction/arm-networkfunction/src/operations/collectorPolicies.ts @@ -433,6 +433,8 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { }, requestBody: { parameterPath: { + location: ["options", "location"], + tags: ["options", "tags"], ingestionPolicy: ["options", "ingestionPolicy"], emissionPolicies: ["options", "emissionPolicies"] }, diff --git a/sdk/networkfunction/arm-networkfunction/tsconfig.json b/sdk/networkfunction/arm-networkfunction/tsconfig.json index 16f2e23a1d30..3e6ae96443f3 100644 --- a/sdk/networkfunction/arm-networkfunction/tsconfig.json +++ b/sdk/networkfunction/arm-networkfunction/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-networkfunction": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"