From 61d8a4c5eeaa46b7475fca3d0424f00a05a56cf2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 25 Jan 2022 03:03:04 +0000 Subject: [PATCH] CodeGen from PR 17482 in Azure/azure-rest-api-specs Merge bfcbe36733eede0480cde560aec531804d281985 into ea1aed264817addfa71d334e56cca3f21a8c37f0 --- .../arm-appinsights/CHANGELOG.md | 4 +- .../arm-appinsights/_meta.json | 6 +- .../arm-appinsights/api-extractor.json | 25 +- .../arm-appinsights/package.json | 28 +- .../review/arm-appinsights.api.md | 39 ++- .../applicationInsightsManagementClient.ts | 6 +- .../arm-appinsights/src/models/index.ts | 117 +++++--- .../arm-appinsights/src/models/mappers.ts | 276 ++++++++++++------ .../arm-appinsights/src/models/parameters.ts | 26 +- .../src/operations/components.ts | 38 ++- .../arm-appinsights/src/operations/index.ts | 1 - .../src/operations/liveToken.ts | 2 +- .../src/operations/operations.ts | 133 --------- .../src/operationsInterfaces/index.ts | 1 - .../src/operationsInterfaces/operations.ts | 22 -- .../arm-appinsights/tsconfig.json | 16 +- 16 files changed, 367 insertions(+), 373 deletions(-) delete mode 100644 sdk/applicationinsights/arm-appinsights/src/operations/operations.ts delete mode 100644 sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/operations.ts diff --git a/sdk/applicationinsights/arm-appinsights/CHANGELOG.md b/sdk/applicationinsights/arm-appinsights/CHANGELOG.md index 62470a621563..e0520f52e329 100644 --- a/sdk/applicationinsights/arm-appinsights/CHANGELOG.md +++ b/sdk/applicationinsights/arm-appinsights/CHANGELOG.md @@ -1,8 +1,8 @@ # Release History -## 5.0.0-beta.1 (2022-01-21) +## 5.0.0-beta.2 (2022-01-25) -The package of @azure/arm-appinsights is using our next generation design principles since version 5.0.0-beta.1, which contains breaking changes. +The package of @azure/arm-appinsights is using our next generation design principles since version 5.0.0-beta.2, which contains breaking changes. To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). diff --git a/sdk/applicationinsights/arm-appinsights/_meta.json b/sdk/applicationinsights/arm-appinsights/_meta.json index 3021b5d9d2b5..779d2d8d7c93 100644 --- a/sdk/applicationinsights/arm-appinsights/_meta.json +++ b/sdk/applicationinsights/arm-appinsights/_meta.json @@ -1,7 +1,7 @@ { - "commit": "f9a6cb686bcc0f1b23761db19f2491c5c4df95cb", + "commit": "e2e596c9f041a0ed8f9d23e4f84b8f506a9345ea", "readme": "specification/applicationinsights/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/applicationinsights/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220114.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/applicationinsights/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220114.1" + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/applicationinsights/arm-appinsights/api-extractor.json b/sdk/applicationinsights/arm-appinsights/api-extractor.json index 8d94522c21e8..c1199353e8d1 100644 --- a/sdk/applicationinsights/arm-appinsights/api-extractor.json +++ b/sdk/applicationinsights/arm-appinsights/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-appinsights.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/applicationinsights/arm-appinsights/package.json b/sdk/applicationinsights/arm-appinsights/package.json index 50d5a2aa6c45..096aada19103 100644 --- a/sdk/applicationinsights/arm-appinsights/package.json +++ b/sdk/applicationinsights/arm-appinsights/package.json @@ -3,8 +3,10 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ApplicationInsightsManagementClient.", - "version": "5.0.0-beta.1", - "engines": { "node": ">=12.0.0" }, + "version": "5.0.0-beta.2", + "engines": { + "node": ">=12.0.0" + }, "dependencies": { "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.0.0", @@ -12,7 +14,13 @@ "@azure/core-rest-pipeline": "^1.1.0", "tslib": "^2.2.0" }, - "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], "license": "MIT", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", @@ -39,7 +47,9 @@ "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, "files": [ "dist/**/*.js", "dist/**/*.js.map", @@ -86,13 +96,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/ApplicationInsightsManagementClient.ts", - "prefix": "packageDetails" - } - ] - }, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/applicationinsights/arm-appinsights/review/arm-appinsights.api.md b/sdk/applicationinsights/arm-appinsights/review/arm-appinsights.api.md index 7b40e42381ee..0fbff25500c8 100644 --- a/sdk/applicationinsights/arm-appinsights/review/arm-appinsights.api.md +++ b/sdk/applicationinsights/arm-appinsights/review/arm-appinsights.api.md @@ -150,8 +150,10 @@ export type APIKeysListResponse = ApplicationInsightsComponentAPIKeyListResult; // @public export type ApplicationInsightsComponent = ComponentsResource & { kind: string; + etag?: string; readonly applicationId?: string; readonly appId?: string; + readonly namePropertiesName?: string; applicationType?: ApplicationType; flowType?: FlowType; requestSource?: RequestSource; @@ -166,10 +168,14 @@ export type ApplicationInsightsComponent = ComponentsResource & { retentionInDays?: number; disableIpMasking?: boolean; immediatePurgeDataOn30Days?: boolean; + workspaceResourceId?: string; + readonly laMigrationDate?: Date; readonly privateLinkScopedResources?: PrivateLinkScopedResource[]; publicNetworkAccessForIngestion?: PublicNetworkAccessType; publicNetworkAccessForQuery?: PublicNetworkAccessType; ingestionMode?: IngestionMode; + disableLocalAuth?: boolean; + forceCustomerStorageForProfiler?: boolean; }; // @public @@ -393,8 +399,6 @@ export class ApplicationInsightsManagementClient extends coreClient.ServiceClien // (undocumented) myWorkbooks: MyWorkbooks; // (undocumented) - operations: Operations; - // (undocumented) proactiveDetectionConfigurations: ProactiveDetectionConfigurations; // (undocumented) subscriptionId: string; @@ -656,6 +660,17 @@ export interface ErrorResponse { message?: string; } +// @public (undocumented) +export interface ErrorResponseComponents { + error?: ErrorResponseComponentsError; +} + +// @public +export interface ErrorResponseComponentsError { + readonly code?: string; + readonly message?: string; +} + // @public (undocumented) export interface ErrorResponseLinkedStorage { error?: ErrorResponseLinkedStorageError; @@ -1158,30 +1173,12 @@ export interface OperationListResult { // @public export interface OperationLive { display?: OperationInfo; + isDataAction?: boolean; name?: string; origin?: string; properties?: Record; } -// @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type OperationsListNextResponse = OperationsListResult; - -// @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type OperationsListResponse = OperationsListResult; - // @public export interface OperationsListResult { nextLink?: string; diff --git a/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClient.ts b/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClient.ts index 94ec76c781ce..2039867a000d 100644 --- a/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClient.ts +++ b/sdk/applicationinsights/arm-appinsights/src/applicationInsightsManagementClient.ts @@ -27,7 +27,6 @@ import { WorkbooksImpl, ComponentsImpl, ComponentLinkedStorageAccountsOperationsImpl, - OperationsImpl, LiveTokenImpl } from "./operations"; import { @@ -49,7 +48,6 @@ import { Workbooks, Components, ComponentLinkedStorageAccountsOperations, - Operations, LiveToken } from "./operationsInterfaces"; import { ApplicationInsightsManagementClientOptionalParams } from "./models"; @@ -85,7 +83,7 @@ export class ApplicationInsightsManagementClient extends coreClient.ServiceClien credential: credentials }; - const packageDetails = `azsdk-js-arm-appinsights/5.0.0-beta.1`; + const packageDetails = `azsdk-js-arm-appinsights/5.0.0-beta.2`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -134,7 +132,6 @@ export class ApplicationInsightsManagementClient extends coreClient.ServiceClien this.componentLinkedStorageAccountsOperations = new ComponentLinkedStorageAccountsOperationsImpl( this ); - this.operations = new OperationsImpl(this); this.liveToken = new LiveTokenImpl(this); } @@ -156,6 +153,5 @@ export class ApplicationInsightsManagementClient extends coreClient.ServiceClien workbooks: Workbooks; components: Components; componentLinkedStorageAccountsOperations: ComponentLinkedStorageAccountsOperations; - operations: Operations; liveToken: LiveToken; } diff --git a/sdk/applicationinsights/arm-appinsights/src/models/index.ts b/sdk/applicationinsights/arm-appinsights/src/models/index.ts index 079a9c7f62ac..2ff1b1ccae2b 100644 --- a/sdk/applicationinsights/arm-appinsights/src/models/index.ts +++ b/sdk/applicationinsights/arm-appinsights/src/models/index.ts @@ -980,6 +980,25 @@ export interface ComponentsResource { tags?: { [propertyName: string]: string }; } +export interface ErrorResponseComponents { + /** Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. */ + error?: ErrorResponseComponentsError; +} + +/** Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. */ +export interface ErrorResponseComponentsError { + /** + * Error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * Error message indicating why the operation failed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; +} + /** Describes the body of a purge request for an App Insights component */ export interface ComponentPurgeBody { /** Table from which to purge data. */ @@ -1037,38 +1056,6 @@ export interface ComponentLinkedStorageAccountsPatch { linkedStorageAccount?: string; } -/** Result of the List Operations operation */ -export interface OperationsListResult { - /** A collection of operations */ - value?: OperationLive[]; - /** URL to get the next set of operation list results if there are any. */ - nextLink?: string; -} - -/** Represents an operation returned by the GetOperations request */ -export interface OperationLive { - /** Name of the operation */ - name?: string; - /** Display name of the operation */ - display?: OperationInfo; - /** Origin of the operation */ - origin?: string; - /** Properties of the operation */ - properties?: Record; -} - -/** Information about an operation */ -export interface OperationInfo { - /** Name of the provider */ - provider?: string; - /** Name of the resource type */ - resource?: string; - /** Name of the operation */ - operation?: string; - /** Description of the operation */ - description?: string; -} - /** The response to a live token query. */ export interface LiveTokenResponse { /** @@ -1130,6 +1117,40 @@ export interface WorkbookInnerErrorTrace { readonly trace?: string[]; } +/** Result of the List Operations operation */ +export interface OperationsListResult { + /** A collection of operations */ + value?: OperationLive[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; +} + +/** Represents an operation returned by the GetOperations request */ +export interface OperationLive { + /** Name of the operation */ + name?: string; + /** Indicates whether the operation is a data action */ + isDataAction?: boolean; + /** Display name of the operation */ + display?: OperationInfo; + /** Origin of the operation */ + origin?: string; + /** Properties of the operation */ + properties?: Record; +} + +/** Information about an operation */ +export interface OperationInfo { + /** Name of the provider */ + provider?: string; + /** Name of the resource type */ + resource?: string; + /** Name of the operation */ + operation?: string; + /** Description of the operation */ + description?: string; +} + /** An Application Insights web test definition. */ export type WebTest = WebtestsResource & { /** The kind of web test that this web test watches. Choices are ping and multistep. */ @@ -1228,6 +1249,8 @@ export type ProxyResource = Resource & {}; export type ApplicationInsightsComponent = ComponentsResource & { /** The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone. */ kind: string; + /** Resource etag */ + etag?: string; /** * The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1238,6 +1261,11 @@ export type ApplicationInsightsComponent = ComponentsResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly appId?: string; + /** + * Application name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly namePropertiesName?: string; /** Type of application being monitored. */ applicationType?: ApplicationType; /** Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API. */ @@ -1284,6 +1312,13 @@ export type ApplicationInsightsComponent = ComponentsResource & { disableIpMasking?: boolean; /** Purge data immediately after 30 days. */ immediatePurgeDataOn30Days?: boolean; + /** Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application with this API version. Applications from older versions will not have this property. */ + workspaceResourceId?: string; + /** + * The date which the component got migrated to LA, in ISO 8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly laMigrationDate?: Date; /** * List of linked private link scope resources. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1295,6 +1330,10 @@ export type ApplicationInsightsComponent = ComponentsResource & { publicNetworkAccessForQuery?: PublicNetworkAccessType; /** Indicates the flow of the ingestion. */ ingestionMode?: IngestionMode; + /** Disable Non-AAD based Auth. */ + disableLocalAuth?: boolean; + /** Force users to create their own storage account for profiler and debugger. */ + forceCustomerStorageForProfiler?: boolean; }; /** An azure resource object */ @@ -2335,20 +2374,6 @@ export type ComponentLinkedStorageAccountsUpdateResponse = ComponentLinkedStorag export interface ComponentLinkedStorageAccountsDeleteOptionalParams extends coreClient.OperationOptions {} -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationsListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationsListResult; - /** Optional parameters. */ export interface LiveTokenGetOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/applicationinsights/arm-appinsights/src/models/mappers.ts b/sdk/applicationinsights/arm-appinsights/src/models/mappers.ts index bae6de63330d..1b0a3199878a 100644 --- a/sdk/applicationinsights/arm-appinsights/src/models/mappers.ts +++ b/sdk/applicationinsights/arm-appinsights/src/models/mappers.ts @@ -2196,6 +2196,45 @@ export const ComponentsResource: coreClient.CompositeMapper = { } }; +export const ErrorResponseComponents: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseComponents", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponseComponentsError" + } + } + } + } +}; + +export const ErrorResponseComponentsError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseComponentsError", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const ComponentPurgeBody: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2344,101 +2383,6 @@ export const ComponentLinkedStorageAccountsPatch: coreClient.CompositeMapper = { } }; -export const OperationsListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationsListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationLive" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - -export const OperationLive: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationLive", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationInfo" - } - }, - origin: { - serializedName: "origin", - type: { - name: "String" - } - }, - properties: { - serializedName: "properties", - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - -export const OperationInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationInfo", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - export const LiveTokenResponse: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2594,6 +2538,107 @@ export const WorkbookInnerErrorTrace: coreClient.CompositeMapper = { } }; +export const OperationsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationsListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationLive" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationLive: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationLive", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationInfo" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const OperationInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationInfo", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + export const WebTest: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2889,6 +2934,12 @@ export const ApplicationInsightsComponent: coreClient.CompositeMapper = { name: "String" } }, + etag: { + serializedName: "etag", + type: { + name: "String" + } + }, applicationId: { serializedName: "properties.ApplicationId", readOnly: true, @@ -2903,6 +2954,13 @@ export const ApplicationInsightsComponent: coreClient.CompositeMapper = { name: "String" } }, + namePropertiesName: { + serializedName: "properties.Name", + readOnly: true, + type: { + name: "String" + } + }, applicationType: { defaultValue: "web", serializedName: "properties.Application_Type", @@ -2979,7 +3037,6 @@ export const ApplicationInsightsComponent: coreClient.CompositeMapper = { } }, retentionInDays: { - defaultValue: 90, serializedName: "properties.RetentionInDays", type: { name: "Number" @@ -2997,6 +3054,19 @@ export const ApplicationInsightsComponent: coreClient.CompositeMapper = { name: "Boolean" } }, + workspaceResourceId: { + serializedName: "properties.WorkspaceResourceId", + type: { + name: "String" + } + }, + laMigrationDate: { + serializedName: "properties.LaMigrationDate", + readOnly: true, + type: { + name: "DateTime" + } + }, privateLinkScopedResources: { serializedName: "properties.PrivateLinkScopedResources", readOnly: true, @@ -3025,11 +3095,23 @@ export const ApplicationInsightsComponent: coreClient.CompositeMapper = { } }, ingestionMode: { - defaultValue: "ApplicationInsights", + defaultValue: "LogAnalytics", serializedName: "properties.IngestionMode", type: { name: "String" } + }, + disableLocalAuth: { + serializedName: "properties.DisableLocalAuth", + type: { + name: "Boolean" + } + }, + forceCustomerStorageForProfiler: { + serializedName: "properties.ForceCustomerStorageForProfiler", + type: { + name: "Boolean" + } } } } diff --git a/sdk/applicationinsights/arm-appinsights/src/models/parameters.ts b/sdk/applicationinsights/arm-appinsights/src/models/parameters.ts index ee1eede7e29b..6efff1734966 100644 --- a/sdk/applicationinsights/arm-appinsights/src/models/parameters.ts +++ b/sdk/applicationinsights/arm-appinsights/src/models/parameters.ts @@ -508,7 +508,7 @@ export const revisionId: OperationURLParameter = { export const apiVersion4: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2018-05-01-preview", + defaultValue: "2020-02-02", isConstant: true, serializedName: "api-version", type: { @@ -576,18 +576,6 @@ export const linkedStorageAccountsProperties1: OperationParameter = { mapper: ComponentLinkedStorageAccountsPatchMapper }; -export const apiVersion6: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2020-06-02-preview", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - export const resourceUri: OperationURLParameter = { parameterPath: "resourceUri", mapper: { @@ -599,3 +587,15 @@ export const resourceUri: OperationURLParameter = { }, skipEncoding: true }; + +export const apiVersion6: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-10-14", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/components.ts b/sdk/applicationinsights/arm-appinsights/src/operations/components.ts index c64a1cb7411c..d4f18070132c 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/components.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/components.ts @@ -331,6 +331,9 @@ const listOperationSpec: coreClient.OperationSpec = { responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseComponents } }, queryParameters: [Parameters.apiVersion4], @@ -345,6 +348,9 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseComponents } }, queryParameters: [Parameters.apiVersion4], @@ -360,7 +366,13 @@ const deleteOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}", httpMethod: "DELETE", - responses: { 200: {}, 204: {} }, + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseComponents + } + }, queryParameters: [Parameters.apiVersion4], urlParameters: [ Parameters.$host, @@ -368,6 +380,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceName ], + headerParameters: [Parameters.accept], serializer }; const getOperationSpec: coreClient.OperationSpec = { @@ -377,6 +390,9 @@ const getOperationSpec: coreClient.OperationSpec = { responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponent + }, + default: { + bodyMapper: Mappers.ErrorResponseComponents } }, queryParameters: [Parameters.apiVersion4], @@ -397,8 +413,8 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.ApplicationInsightsComponent }, - 201: { - bodyMapper: Mappers.ApplicationInsightsComponent + default: { + bodyMapper: Mappers.ErrorResponseComponents } }, requestBody: Parameters.insightProperties, @@ -421,8 +437,8 @@ const updateTagsOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.ApplicationInsightsComponent }, - 201: { - bodyMapper: Mappers.ApplicationInsightsComponent + default: { + bodyMapper: Mappers.ErrorResponseComponents } }, requestBody: Parameters.componentTags, @@ -444,6 +460,9 @@ const purgeOperationSpec: coreClient.OperationSpec = { responses: { 202: { bodyMapper: Mappers.ComponentPurgeResponse + }, + default: { + bodyMapper: Mappers.ErrorResponseComponents } }, requestBody: Parameters.body, @@ -465,6 +484,9 @@ const getPurgeStatusOperationSpec: coreClient.OperationSpec = { responses: { 200: { bodyMapper: Mappers.ComponentPurgeStatusResponse + }, + default: { + bodyMapper: Mappers.ErrorResponseComponents } }, queryParameters: [Parameters.apiVersion4], @@ -484,6 +506,9 @@ const listNextOperationSpec: coreClient.OperationSpec = { responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseComponents } }, queryParameters: [Parameters.apiVersion4], @@ -501,6 +526,9 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { responses: { 200: { bodyMapper: Mappers.ApplicationInsightsComponentListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseComponents } }, queryParameters: [Parameters.apiVersion4], diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/index.ts b/sdk/applicationinsights/arm-appinsights/src/operations/index.ts index 22f0c430dc3b..d273af781cd5 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/index.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/index.ts @@ -24,5 +24,4 @@ export * from "./myWorkbooks"; export * from "./workbooks"; export * from "./components"; export * from "./componentLinkedStorageAccountsOperations"; -export * from "./operations"; export * from "./liveToken"; diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/liveToken.ts b/sdk/applicationinsights/arm-appinsights/src/operations/liveToken.ts index 7b2d791f2b37..b5e5efb50c24 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operations/liveToken.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operations/liveToken.ts @@ -44,7 +44,7 @@ export class LiveTokenImpl implements LiveToken { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/microsoft.insights/generatelivetoken", + path: "/{resourceUri}/providers/Microsoft.Insights/generatelivetoken", httpMethod: "POST", responses: { 200: { diff --git a/sdk/applicationinsights/arm-appinsights/src/operations/operations.ts b/sdk/applicationinsights/arm-appinsights/src/operations/operations.ts deleted file mode 100644 index 085c42a0403f..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/operations/operations.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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 { Operations } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ApplicationInsightsManagementClient } from "../applicationInsightsManagementClient"; -import { - OperationLive, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse -} from "../models"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: ApplicationInsightsManagementClient; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: ApplicationInsightsManagementClient) { - this.client = client; - } - - /** - * List the available operations supported by the resource provider. - * @param options The options parameters. - */ - public list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(options); - } - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * List the available operations supported by the resource provider. - * @param options The options parameters. - */ - private _list( - options?: OperationsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: OperationsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/microsoft.insights/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationsListResult - }, - default: {} - }, - queryParameters: [Parameters.apiVersion6], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationsListResult - }, - default: {} - }, - queryParameters: [Parameters.apiVersion6], - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/index.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/index.ts index 22f0c430dc3b..d273af781cd5 100644 --- a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/index.ts +++ b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/index.ts @@ -24,5 +24,4 @@ export * from "./myWorkbooks"; export * from "./workbooks"; export * from "./components"; export * from "./componentLinkedStorageAccountsOperations"; -export * from "./operations"; export * from "./liveToken"; diff --git a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/operations.ts b/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/operations.ts deleted file mode 100644 index 4578cf770899..000000000000 --- a/sdk/applicationinsights/arm-appinsights/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 { OperationLive, OperationsListOptionalParams } from "../models"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * List the available operations supported by the resource provider. - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/applicationinsights/arm-appinsights/tsconfig.json b/sdk/applicationinsights/arm-appinsights/tsconfig.json index 6e3251194117..3e6ae96443f3 100644 --- a/sdk/applicationinsights/arm-appinsights/tsconfig.json +++ b/sdk/applicationinsights/arm-appinsights/tsconfig.json @@ -9,11 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file