diff --git a/sdk/networkfunction/arm-networkfunction/CHANGELOG.md b/sdk/networkfunction/arm-networkfunction/CHANGELOG.md index 2dd4e1251cf4..04e69fba87d3 100644 --- a/sdk/networkfunction/arm-networkfunction/CHANGELOG.md +++ b/sdk/networkfunction/arm-networkfunction/CHANGELOG.md @@ -1,5 +1,18 @@ # Release History +## 1.1.0 (2022-07-26) + +**Features** + + - Added Type Alias ApiVersionParameter + - Added Type Alias AzureTrafficCollector + - Added Type Alias CollectorPolicy + - Added Type Alias TrackedResourceSystemData + - Interface CollectorPoliciesCreateOrUpdateOptionalParams has a new optional parameter location + - Interface CollectorPoliciesCreateOrUpdateOptionalParams has a new optional parameter tags + - Added Enum KnownApiVersionParameter + + ## 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..0bcc817f5d47 100644 --- a/sdk/networkfunction/arm-networkfunction/_meta.json +++ b/sdk/networkfunction/arm-networkfunction/_meta.json @@ -1,8 +1,8 @@ { - "commit": "96c6e14d4dfd2aef59a69a43185308567fec8c07", + "commit": "341d0cda9c5c82a4e82bbd1fe6f3133265c6717c", "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": "", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", - "use": "@autorest/typescript@6.0.0-rc.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.1", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/networkfunction/arm-networkfunction/package.json b/sdk/networkfunction/arm-networkfunction/package.json index 839b1ecbf5e5..425b9daf6a43 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.0", + "version": "1.1.0", "engines": { "node": ">=12.0.0" }, @@ -43,8 +43,6 @@ "@azure-tools/test-recorder": "^2.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "@types/chai": "^4.2.8", - "chai": "^4.2.0", "cross-env": "^7.0.2", "@azure/dev-tool": "^1.0.0" }, @@ -98,7 +96,8 @@ "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "integration-test:browser": "echo skipped" + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -109,13 +108,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..dac9d368baa9 100644 --- a/sdk/networkfunction/arm-networkfunction/review/arm-networkfunction.api.md +++ b/sdk/networkfunction/arm-networkfunction/review/arm-networkfunction.api.md @@ -11,12 +11,15 @@ import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; // @public -export interface AzureTrafficCollector extends TrackedResource { - collectorPolicies?: CollectorPolicy[]; +export type ApiVersionParameter = string; + +// @public +export type AzureTrafficCollector = TrackedResource & { readonly etag?: string; - readonly provisioningState?: ProvisioningState; + collectorPolicies?: CollectorPolicy[]; virtualHub?: ResourceReference; -} + readonly provisioningState?: ProvisioningState; +}; // @public (undocumented) export class AzureTrafficCollectorClient extends coreClient.ServiceClient { @@ -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,13 +204,12 @@ export interface CollectorPoliciesListOptionalParams extends coreClient.Operatio export type CollectorPoliciesListResponse = CollectorPolicyListResult; // @public -export interface CollectorPolicy extends ProxyResource { - emissionPolicies?: EmissionPoliciesPropertiesFormat[]; +export type CollectorPolicy = TrackedResource & { readonly etag?: string; ingestionPolicy?: IngestionPolicyPropertiesFormat; + emissionPolicies?: EmissionPoliciesPropertiesFormat[]; readonly provisioningState?: ProvisioningState; - readonly systemData?: CollectorPolicySystemData; -} +}; // @public export interface CollectorPolicyListResult { @@ -211,10 +217,6 @@ export interface CollectorPolicyListResult { value?: CollectorPolicy[]; } -// @public -export interface CollectorPolicySystemData extends SystemData { -} - // @public export type CreatedByType = string; @@ -250,39 +252,59 @@ export interface IngestionSourcesPropertiesFormat { // @public export type IngestionType = string; +// @public +export enum KnownApiVersionParameter { + // (undocumented) + TwoThousandTwentyTwo0501 = "2022-05-01", + // (undocumented) + TwoThousandTwentyTwo0801 = "2022-08-01" +} + // @public export enum KnownCreatedByType { + // (undocumented) Application = "Application", + // (undocumented) Key = "Key", + // (undocumented) ManagedIdentity = "ManagedIdentity", + // (undocumented) User = "User" } // @public export enum KnownDestinationType { + // (undocumented) AzureMonitor = "AzureMonitor" } // @public export enum KnownEmissionType { + // (undocumented) Ipfix = "IPFIX" } // @public export enum KnownIngestionType { + // (undocumented) Ipfix = "IPFIX" } // @public export enum KnownProvisioningState { + // (undocumented) Deleting = "Deleting", + // (undocumented) Failed = "Failed", + // (undocumented) Succeeded = "Succeeded", + // (undocumented) Updating = "Updating" } // @public export enum KnownSourceType { + // (undocumented) Resource = "Resource" } @@ -367,8 +389,7 @@ export interface TrackedResource { } // @public -export interface TrackedResourceSystemData extends SystemData { -} +export type TrackedResourceSystemData = SystemData & {}; // (No @packageDocumentation comment for this package) diff --git a/sdk/networkfunction/arm-networkfunction/src/azureTrafficCollectorClient.ts b/sdk/networkfunction/arm-networkfunction/src/azureTrafficCollectorClient.ts index a50f23cda497..24c2970c1b02 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.0`; + const packageDetails = `azsdk-js-arm-networkfunction/1.1.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 @@ -137,7 +137,7 @@ export class AzureTrafficCollectorClient extends coreClient.ServiceClient { if (param.length > 1) { const newParams = param[1].split("&").map((item) => { if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; + return item.replace(/(?<==).*$/, apiVersion); } else { return item; } diff --git a/sdk/networkfunction/arm-networkfunction/src/models/index.ts b/sdk/networkfunction/arm-networkfunction/src/models/index.ts index aeefbe1e13c3..4c852df4e806 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 type CollectorPolicy = 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. */ @@ -213,10 +202,10 @@ export interface CollectorPolicy extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; -} +}; /** Azure Traffic Collector resource. */ -export interface AzureTrafficCollector extends TrackedResource { +export type AzureTrafficCollector = 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. @@ -231,11 +220,13 @@ export interface AzureTrafficCollector extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; -} +}; + +/** Metadata pertaining to creation and last modification of the resource. */ +export type TrackedResourceSystemData = SystemData & {}; /** Known values of {@link IngestionType} that the service accepts. */ export enum KnownIngestionType { - /** Ipfix */ Ipfix = "IPFIX" } @@ -250,7 +241,6 @@ export type IngestionType = string; /** Known values of {@link SourceType} that the service accepts. */ export enum KnownSourceType { - /** Resource */ Resource = "Resource" } @@ -265,7 +255,6 @@ export type SourceType = string; /** Known values of {@link EmissionType} that the service accepts. */ export enum KnownEmissionType { - /** Ipfix */ Ipfix = "IPFIX" } @@ -280,7 +269,6 @@ export type EmissionType = string; /** Known values of {@link DestinationType} that the service accepts. */ export enum KnownDestinationType { - /** AzureMonitor */ AzureMonitor = "AzureMonitor" } @@ -295,13 +283,9 @@ export type DestinationType = string; /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { - /** Succeeded */ Succeeded = "Succeeded", - /** Updating */ Updating = "Updating", - /** Deleting */ Deleting = "Deleting", - /** Failed */ Failed = "Failed" } @@ -319,13 +303,9 @@ export type ProvisioningState = 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" } @@ -341,6 +321,22 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link ApiVersionParameter} that the service accepts. */ +export enum KnownApiVersionParameter { + TwoThousandTwentyTwo0501 = "2022-05-01", + 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 +432,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"