From b8f14a6a57c607d104bf2979a6710612458d9604 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 5 Dec 2022 21:20:58 +0000 Subject: [PATCH] CodeGen from PR 21757 in Azure/azure-rest-api-specs Merge 7063fb575705fc4fb2d2309362209159e2071961 into 89a1da5c735d5ef2107488fb5291dc3947cd7f79 --- common/config/rush/pnpm-lock.yaml | 14 +- .../arm-resourcehealth/CHANGELOG.md | 98 ++- .../arm-resourcehealth/README.md | 2 +- .../arm-resourcehealth/_meta.json | 10 +- .../arm-resourcehealth/package.json | 19 +- .../review/arm-resourcehealth.api.md | 381 +++++++--- .../arm-resourcehealth/src/index.ts | 1 + .../src/microsoftResourceHealth.ts | 75 +- .../arm-resourcehealth/src/models/index.ts | 663 ++++++++++++---- .../arm-resourcehealth/src/models/mappers.ts | 712 +++++++++++++++--- .../src/models/parameters.ts | 35 +- .../src/operations/availabilityStatuses.ts | 124 +-- .../operations/childAvailabilityStatuses.ts | 210 ------ .../src/operations/childResources.ts | 168 ----- .../src/operations/emergingIssues.ts | 165 ---- .../src/operations/eventOperations.ts | 110 +++ .../src/operations/eventsOperations.ts | 434 +++++++++++ .../src/operations/impactedResources.ts | 229 ++++++ .../src/operations/index.ts | 6 +- .../availabilityStatuses.ts | 9 +- .../childAvailabilityStatuses.ts | 43 -- .../operationsInterfaces/childResources.ts | 30 - .../operationsInterfaces/emergingIssues.ts | 34 - .../operationsInterfaces/eventOperations.ts | 36 + .../operationsInterfaces/eventsOperations.ts | 47 ++ .../operationsInterfaces/impactedResources.ts | 40 + .../src/operationsInterfaces/index.ts | 6 +- .../arm-resourcehealth/src/pagingHelper.ts | 39 + .../arm-resourcehealth/tsconfig.json | 10 +- 29 files changed, 2627 insertions(+), 1123 deletions(-) delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operations/childAvailabilityStatuses.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operations/childResources.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts create mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operations/eventOperations.ts create mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operations/eventsOperations.ts create mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operations/impactedResources.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childAvailabilityStatuses.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childResources.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts create mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/eventOperations.ts create mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/eventsOperations.ts create mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/impactedResources.ts create mode 100644 sdk/resourcehealth/arm-resourcehealth/src/pagingHelper.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 766be3b29c30..c077ed99854f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3934,7 +3934,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20221204 + typescript: 5.0.0-dev.20221205 dev: false /downlevel-dts/0.8.0: @@ -8979,8 +8979,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20221204: - resolution: {integrity: sha512-6luaUPpnzzwTjG+UrdMsftnvyxkj2nhPR/LrZlZInnuMNuNyhz3TVH7SpxampW990Xw6usgYdhpf/cWBO1MOQw==} + /typescript/5.0.0-dev.20221205: + resolution: {integrity: sha512-afHkcfhaQqUk+Hjn+lUKtMqMttizIy5K2r75cz8l7/K+m0k6Yx9IoHRC5v8cjxB77ub2COdbr+0xsNodB7q6dg==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -14417,7 +14417,7 @@ packages: dev: false file:projects/arm-resourcehealth.tgz: - resolution: {integrity: sha512-Wgl98neDnGlahm6+x5H/b22PmI9RmUy4DJzmR97JTM/oO8EWyAHiM4eVG9fvZnQR1QggVkAXCqzl8hFKHSLoVw==, tarball: file:projects/arm-resourcehealth.tgz} + resolution: {integrity: sha512-HM+IwIjB2qouQsji8DAR0kepKgesfg1s4Byq+o5hybOMnzL0Tb6Jn8R+4SX5ANvWZ1O+bhFg2uoSrPL3D5n1Eg==, tarball: file:projects/arm-resourcehealth.tgz} name: '@rush-temp/arm-resourcehealth' version: 0.0.0 dependencies: @@ -14428,18 +14428,18 @@ packages: '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 + '@types/node': 14.18.33 chai: 4.3.7 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 + rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - - '@types/node' - supports-color dev: false diff --git a/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md index 662fa5c48772..35265247f518 100644 --- a/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md +++ b/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md @@ -1,15 +1,97 @@ # Release History + +## 4.0.0-beta.1 (2022-12-05) + +**Features** -## 3.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group EventOperations + - Added operation group EventsOperations + - Added operation group ImpactedResources + - Added Interface AvailabilityStatusPropertiesRecentlyResolved + - Added Interface Event_2 + - Added Interface EventGetBySubscriptionIdAndTrackingIdOptionalParams + - Added Interface EventGetByTenantIdAndTrackingIdOptionalParams + - Added Interface EventImpactedResource + - Added Interface EventImpactedResourceListResult + - Added Interface EventPropertiesAdditionalInformation + - Added Interface EventPropertiesArticle + - Added Interface EventPropertiesRecommendedActions + - Added Interface EventPropertiesRecommendedActionsItem + - Added Interface Events + - Added Interface EventsListBySingleResourceNextOptionalParams + - Added Interface EventsListBySingleResourceOptionalParams + - Added Interface EventsListBySubscriptionIdNextOptionalParams + - Added Interface EventsListBySubscriptionIdOptionalParams + - Added Interface EventsListByTenantIdNextOptionalParams + - Added Interface EventsListByTenantIdOptionalParams + - Added Interface Faq + - Added Interface Impact + - Added Interface ImpactedResourcesGetOptionalParams + - Added Interface ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams + - Added Interface ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + - Added Interface ImpactedResourceStatus + - Added Interface ImpactedServiceRegion + - Added Interface KeyValueItem + - Added Interface Link + - Added Interface LinkDisplayText + - Added Interface ProxyResource + - Added Interface SystemData + - Added Interface Update + - Added Type Alias CreatedByType + - Added Type Alias EventGetBySubscriptionIdAndTrackingIdResponse + - Added Type Alias EventGetByTenantIdAndTrackingIdResponse + - Added Type Alias EventLevelValues + - Added Type Alias EventsListBySingleResourceNextResponse + - Added Type Alias EventsListBySingleResourceResponse + - Added Type Alias EventsListBySubscriptionIdNextResponse + - Added Type Alias EventsListBySubscriptionIdResponse + - Added Type Alias EventsListByTenantIdNextResponse + - Added Type Alias EventsListByTenantIdResponse + - Added Type Alias EventSourceValues + - Added Type Alias EventStatusValues + - Added Type Alias EventTypeValues + - Added Type Alias ImpactedResourcesGetResponse + - Added Type Alias ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse + - Added Type Alias ImpactedResourcesListBySubscriptionIdAndEventIdResponse + - Added Type Alias LevelValues + - Added Type Alias LinkTypeValues + - Added Type Alias ReasonTypeValues + - Interface AvailabilityStatusProperties has a new optional parameter recentlyResolved + - Interface AvailabilityStatusProperties has a new optional parameter title + - Interface Resource has a new optional parameter systemData + - Class MicrosoftResourceHealth has a new parameter eventOperations + - Class MicrosoftResourceHealth has a new parameter eventsOperations + - Class MicrosoftResourceHealth has a new parameter impactedResources + - Added Enum KnownAvailabilityStateValues + - Added Enum KnownCreatedByType + - Added Enum KnownEventLevelValues + - Added Enum KnownEventSourceValues + - Added Enum KnownEventStatusValues + - Added Enum KnownEventTypeValues + - Added Enum KnownLevelValues + - Added Enum KnownLinkTypeValues + - Added Enum KnownReasonChronicityTypes + - Added Enum KnownReasonTypeValues -### Other Changes +**Breaking Changes** + - Removed operation group ChildAvailabilityStatuses + - Removed operation group ChildResources + - Removed operation group EmergingIssues + - Interface AvailabilityStatusesListByResourceGroupNextOptionalParams no longer has parameter expand + - Interface AvailabilityStatusesListByResourceGroupNextOptionalParams no longer has parameter filter + - Interface AvailabilityStatusesListBySubscriptionIdNextOptionalParams no longer has parameter expand + - Interface AvailabilityStatusesListBySubscriptionIdNextOptionalParams no longer has parameter filter + - Interface AvailabilityStatusesListNextOptionalParams no longer has parameter expand + - Interface AvailabilityStatusesListNextOptionalParams no longer has parameter filter + - Interface AvailabilityStatusProperties no longer has parameter recentlyResolvedState + - Class MicrosoftResourceHealth no longer has parameter childAvailabilityStatuses + - Class MicrosoftResourceHealth no longer has parameter childResources + - Class MicrosoftResourceHealth no longer has parameter emergingIssues + - Removed Enum KnownSeverityValues + - Removed Enum KnownStageValues + + ## 3.1.0 (2022-07-14) **Features** diff --git a/sdk/resourcehealth/arm-resourcehealth/README.md b/sdk/resourcehealth/arm-resourcehealth/README.md index 00c23d812391..2b7431c61050 100644 --- a/sdk/resourcehealth/arm-resourcehealth/README.md +++ b/sdk/resourcehealth/arm-resourcehealth/README.md @@ -6,7 +6,7 @@ The Resource Health Client. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcehealth/arm-resourcehealth) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourcehealth) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourcehealth) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourcehealth?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/resourcehealth/arm-resourcehealth/_meta.json b/sdk/resourcehealth/arm-resourcehealth/_meta.json index 72e1b723251d..f3a4963880a9 100644 --- a/sdk/resourcehealth/arm-resourcehealth/_meta.json +++ b/sdk/resourcehealth/arm-resourcehealth/_meta.json @@ -1,8 +1,8 @@ { - "commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf", - "readme": "specification\\resourcehealth\\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\\resourcehealth\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1 --generate-sample=true", + "commit": "364f5e3fbfb14b628fe48eccfa8d3dee13ece240", + "readme": "specification/resourcehealth/resource-manager/readme.md", + "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/resourcehealth/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.4", "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.5.2", + "use": "@autorest/typescript@6.0.0-rc.4" } \ No newline at end of file diff --git a/sdk/resourcehealth/arm-resourcehealth/package.json b/sdk/resourcehealth/arm-resourcehealth/package.json index 6bba2826da54..3ac2d3a70bf3 100644 --- a/sdk/resourcehealth/arm-resourcehealth/package.json +++ b/sdk/resourcehealth/arm-resourcehealth/package.json @@ -3,13 +3,13 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for MicrosoftResourceHealth.", - "version": "3.1.1", + "version": "4.0.0-beta.1", "engines": { "node": ">=14.0.0" }, "dependencies": { "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.5.0", + "@azure/core-client": "^1.6.1", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -34,7 +34,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -44,6 +44,7 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", + "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcehealth/arm-resourcehealth", @@ -107,13 +108,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resourcehealth?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/resourcehealth/arm-resourcehealth/review/arm-resourcehealth.api.md b/sdk/resourcehealth/arm-resourcehealth/review/arm-resourcehealth.api.md index dcea2e328bc1..dcfb537ed360 100644 --- a/sdk/resourcehealth/arm-resourcehealth/review/arm-resourcehealth.api.md +++ b/sdk/resourcehealth/arm-resourcehealth/review/arm-resourcehealth.api.md @@ -9,7 +9,7 @@ import * as coreClient from '@azure/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; // @public -export type AvailabilityStateValues = "Available" | "Unavailable" | "Unknown"; +export type AvailabilityStateValues = string; // @public export interface AvailabilityStatus { @@ -39,8 +39,6 @@ export type AvailabilityStatusesGetByResourceResponse = AvailabilityStatus; // @public export interface AvailabilityStatusesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; } // @public @@ -57,8 +55,6 @@ export type AvailabilityStatusesListByResourceGroupResponse = AvailabilityStatus // @public export interface AvailabilityStatusesListBySubscriptionIdNextOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; } // @public @@ -75,8 +71,6 @@ export type AvailabilityStatusesListBySubscriptionIdResponse = AvailabilityStatu // @public export interface AvailabilityStatusesListNextOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; } // @public @@ -108,152 +102,365 @@ export interface AvailabilityStatusProperties { occuredTime?: Date; reasonChronicity?: ReasonChronicityTypes; reasonType?: string; - recentlyResolvedState?: AvailabilityStatusPropertiesRecentlyResolvedState; + recentlyResolved?: AvailabilityStatusPropertiesRecentlyResolved; recommendedActions?: RecommendedAction[]; reportedTime?: Date; resolutionETA?: Date; rootCauseAttributionTime?: Date; serviceImpactingEvents?: ServiceImpactingEvent[]; summary?: string; + title?: string; } // @public -export interface AvailabilityStatusPropertiesRecentlyResolvedState { +export interface AvailabilityStatusPropertiesRecentlyResolved { resolvedTime?: Date; - unavailabilitySummary?: string; - unavailableOccurredTime?: Date; + unavailableOccuredTime?: Date; + unavailableSummary?: string; } // @public -export interface ChildAvailabilityStatuses { - getByResource(resourceUri: string, options?: ChildAvailabilityStatusesGetByResourceOptionalParams): Promise; - list(resourceUri: string, options?: ChildAvailabilityStatusesListOptionalParams): PagedAsyncIterableIterator; +export type CreatedByType = string; + +// @public +export interface ErrorResponse { + readonly code?: string; + readonly details?: string; + readonly message?: string; } // @public -export interface ChildAvailabilityStatusesGetByResourceOptionalParams extends coreClient.OperationOptions { - expand?: string; +interface Event_2 extends ProxyResource { + additionalInformation?: EventPropertiesAdditionalInformation; + article?: EventPropertiesArticle; + description?: string; + duration?: number; + enableChatWithUs?: boolean; + enableMicrosoftSupport?: boolean; + eventLevel?: EventLevelValues; + eventSource?: EventSourceValues; + eventType?: EventTypeValues; + externalIncidentId?: string; + faqs?: Faq[]; + header?: string; + hirStage?: string; + impact?: Impact[]; + impactMitigationTime?: Date; + impactStartTime?: Date; + impactType?: string; + isHIR?: boolean; + lastUpdateTime?: Date; + level?: LevelValues; + links?: Link[]; + platformInitiated?: boolean; + priority?: number; + recommendedActions?: EventPropertiesRecommendedActions; + status?: EventStatusValues; + summary?: string; + title?: string; +} +export { Event_2 as Event } + +// @public +export interface EventGetBySubscriptionIdAndTrackingIdOptionalParams extends coreClient.OperationOptions { filter?: string; + queryStartTime?: string; } // @public -export type ChildAvailabilityStatusesGetByResourceResponse = AvailabilityStatus; +export type EventGetBySubscriptionIdAndTrackingIdResponse = Event_2; // @public -export interface ChildAvailabilityStatusesListNextOptionalParams extends coreClient.OperationOptions { - expand?: string; +export interface EventGetByTenantIdAndTrackingIdOptionalParams extends coreClient.OperationOptions { filter?: string; + queryStartTime?: string; } // @public -export type ChildAvailabilityStatusesListNextResponse = AvailabilityStatusListResult; +export type EventGetByTenantIdAndTrackingIdResponse = Event_2; // @public -export interface ChildAvailabilityStatusesListOptionalParams extends coreClient.OperationOptions { - expand?: string; +export interface EventImpactedResource extends ProxyResource { + info?: KeyValueItem[]; + readonly targetRegion?: string; + readonly targetResourceId?: string; + readonly targetResourceType?: string; +} + +// @public +export interface EventImpactedResourceListResult { + nextLink?: string; + value: EventImpactedResource[]; +} + +// @public +export type EventLevelValues = string; + +// @public +export interface EventOperations { + getBySubscriptionIdAndTrackingId(eventTrackingId: string, options?: EventGetBySubscriptionIdAndTrackingIdOptionalParams): Promise; + getByTenantIdAndTrackingId(eventTrackingId: string, options?: EventGetByTenantIdAndTrackingIdOptionalParams): Promise; +} + +// @public +export interface EventPropertiesAdditionalInformation { + message?: string; +} + +// @public +export interface EventPropertiesArticle { + articleContent?: string; +} + +// @public +export interface EventPropertiesRecommendedActions { + actions?: EventPropertiesRecommendedActionsItem[]; + localeCode?: string; + message?: string; +} + +// @public +export interface EventPropertiesRecommendedActionsItem { + actionText?: string; + groupId?: number; +} + +// @public +export interface Events { + nextLink?: string; + value: Event_2[]; +} + +// @public +export interface EventsListBySingleResourceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventsListBySingleResourceNextResponse = Events; + +// @public +export interface EventsListBySingleResourceOptionalParams extends coreClient.OperationOptions { filter?: string; } // @public -export type ChildAvailabilityStatusesListResponse = AvailabilityStatusListResult; +export type EventsListBySingleResourceResponse = Events; // @public -export interface ChildResources { - list(resourceUri: string, options?: ChildResourcesListOptionalParams): PagedAsyncIterableIterator; +export interface EventsListBySubscriptionIdNextOptionalParams extends coreClient.OperationOptions { } // @public -export interface ChildResourcesListNextOptionalParams extends coreClient.OperationOptions { - expand?: string; +export type EventsListBySubscriptionIdNextResponse = Events; + +// @public +export interface EventsListBySubscriptionIdOptionalParams extends coreClient.OperationOptions { filter?: string; + queryStartTime?: string; } // @public -export type ChildResourcesListNextResponse = AvailabilityStatusListResult; +export type EventsListBySubscriptionIdResponse = Events; // @public -export interface ChildResourcesListOptionalParams extends coreClient.OperationOptions { - expand?: string; +export interface EventsListByTenantIdNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventsListByTenantIdNextResponse = Events; + +// @public +export interface EventsListByTenantIdOptionalParams extends coreClient.OperationOptions { filter?: string; + queryStartTime?: string; +} + +// @public +export type EventsListByTenantIdResponse = Events; + +// @public +export interface EventsOperations { + listBySingleResource(resourceUri: string, options?: EventsListBySingleResourceOptionalParams): PagedAsyncIterableIterator; + listBySubscriptionId(options?: EventsListBySubscriptionIdOptionalParams): PagedAsyncIterableIterator; + listByTenantId(options?: EventsListByTenantIdOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export type EventSourceValues = string; + +// @public +export type EventStatusValues = string; + +// @public +export type EventTypeValues = string; + +// @public +export interface Faq { + answer?: string; + localeCode?: string; + question?: string; } // @public -export type ChildResourcesListResponse = AvailabilityStatusListResult; +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export interface Impact { + impactedRegions?: ImpactedServiceRegion[]; + impactedService?: string; +} // @public -export interface EmergingIssueImpact { +export interface ImpactedRegion { id?: string; name?: string; - regions?: ImpactedRegion[]; } // @public -export interface EmergingIssueListResult { - nextLink?: string; - value?: EmergingIssuesGetResult[]; +export interface ImpactedResources { + get(eventTrackingId: string, impactedResourceName: string, options?: ImpactedResourcesGetOptionalParams): Promise; + listBySubscriptionIdAndEventId(eventTrackingId: string, options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams): PagedAsyncIterableIterator; } // @public -export interface EmergingIssues { - get(options?: EmergingIssuesGetOptionalParams): Promise; - list(options?: EmergingIssuesListOptionalParams): PagedAsyncIterableIterator; +export interface ImpactedResourcesGetOptionalParams extends coreClient.OperationOptions { } // @public -export interface EmergingIssuesGetOptionalParams extends coreClient.OperationOptions { +export type ImpactedResourcesGetResponse = EventImpactedResource; + +// @public +export interface ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams extends coreClient.OperationOptions { } // @public -export type EmergingIssuesGetResponse = EmergingIssuesGetResult; +export type ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse = EventImpactedResourceListResult; // @public -export interface EmergingIssuesGetResult extends Resource { - refreshTimestamp?: Date; - statusActiveEvents?: StatusActiveEvent[]; - statusBanners?: StatusBanner[]; +export interface ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public -export interface EmergingIssuesListNextOptionalParams extends coreClient.OperationOptions { -} +export type ImpactedResourcesListBySubscriptionIdAndEventIdResponse = EventImpactedResourceListResult; // @public -export type EmergingIssuesListNextResponse = EmergingIssueListResult; +export interface ImpactedResourceStatus extends ProxyResource { + availabilityState?: AvailabilityStateValues; + occurredTime?: Date; + reasonType?: ReasonTypeValues; + summary?: string; + title?: string; +} // @public -export interface EmergingIssuesListOptionalParams extends coreClient.OperationOptions { +export interface ImpactedServiceRegion { + impactedRegion?: string; + impactedSubscriptions?: string[]; + impactedTenants?: string[]; + lastUpdateTime?: Date; + status?: EventStatusValues; + updates?: Update[]; } // @public -export type EmergingIssuesListResponse = EmergingIssueListResult; +export interface KeyValueItem { + readonly key?: string; + readonly value?: string; +} // @public -export interface ErrorResponse { - readonly code?: string; - readonly details?: string; - readonly message?: string; +export enum KnownAvailabilityStateValues { + Available = "Available", + Degraded = "Degraded", + Unavailable = "Unavailable", + Unknown = "Unknown" } // @public -export interface ImpactedRegion { - id?: string; - name?: string; +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" } // @public -export enum KnownSeverityValues { +export enum KnownEventLevelValues { + Critical = "Critical", Error = "Error", - Information = "Information", + Informational = "Informational", Warning = "Warning" } // @public -export enum KnownStageValues { +export enum KnownEventSourceValues { + ResourceHealth = "ResourceHealth", + ServiceHealth = "ServiceHealth" +} + +// @public +export enum KnownEventStatusValues { Active = "Active", - Archived = "Archived", - Resolve = "Resolve" + Resolved = "Resolved" +} + +// @public +export enum KnownEventTypeValues { + EmergingIssues = "EmergingIssues", + HealthAdvisory = "HealthAdvisory", + PlannedMaintenance = "PlannedMaintenance", + RCA = "RCA", + SecurityAdvisory = "SecurityAdvisory", + ServiceIssue = "ServiceIssue" +} + +// @public +export enum KnownLevelValues { + Critical = "Critical", + Warning = "Warning" +} + +// @public +export enum KnownLinkTypeValues { + Button = "Button", + Hyperlink = "Hyperlink" } +// @public +export enum KnownReasonChronicityTypes { + Persistent = "Persistent", + Transient = "Transient" +} + +// @public +export enum KnownReasonTypeValues { + Planned = "Planned", + Unplanned = "Unplanned", + UserInitiated = "UserInitiated" +} + +// @public +export type LevelValues = string; + +// @public +export interface Link { + bladeName?: string; + displayText?: LinkDisplayText; + extensionName?: string; + parameters?: Record; + type?: LinkTypeValues; +} + +// @public +export interface LinkDisplayText { + localizedValue?: string; + value?: string; +} + +// @public +export type LinkTypeValues = string; + // @public (undocumented) export class MicrosoftResourceHealth extends coreClient.ServiceClient { // (undocumented) @@ -264,11 +471,11 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { // (undocumented) availabilityStatuses: AvailabilityStatuses; // (undocumented) - childAvailabilityStatuses: ChildAvailabilityStatuses; + eventOperations: EventOperations; // (undocumented) - childResources: ChildResources; + eventsOperations: EventsOperations; // (undocumented) - emergingIssues: EmergingIssues; + impactedResources: ImpactedResources; // (undocumented) operations: Operations; // (undocumented) @@ -314,7 +521,14 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption export type OperationsListResponse = OperationListResult; // @public -export type ReasonChronicityTypes = "Transient" | "Persistent"; +export interface ProxyResource extends Resource { +} + +// @public +export type ReasonChronicityTypes = string; + +// @public +export type ReasonTypeValues = string; // @public export interface RecommendedAction { @@ -327,6 +541,7 @@ export interface RecommendedAction { export interface Resource { readonly id?: string; readonly name?: string; + readonly systemData?: SystemData; readonly type?: string; } @@ -353,31 +568,27 @@ export interface ServiceImpactingEventStatus { } // @public -export type SeverityValues = string; - -// @public -export type StageValues = string; - -// @public -export interface StatusActiveEvent { +export interface StatusBanner { cloud?: string; - description?: string; - impacts?: EmergingIssueImpact[]; lastModifiedTime?: Date; - published?: boolean; - severity?: SeverityValues; - stage?: StageValues; - startTime?: Date; + message?: string; title?: string; - trackingId?: string; } // @public -export interface StatusBanner { - cloud?: string; - lastModifiedTime?: Date; - message?: string; - title?: string; +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface Update { + summary?: string; + updateDateTime?: Date; } // (No @packageDocumentation comment for this package) diff --git a/sdk/resourcehealth/arm-resourcehealth/src/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/index.ts index f057e9af223a..b880a83403bf 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/index.ts @@ -7,6 +7,7 @@ */ /// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { MicrosoftResourceHealth } from "./microsoftResourceHealth"; export * from "./operationsInterfaces"; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts b/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts index 3683b2c47eaf..cf676618c8c7 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts @@ -16,17 +16,17 @@ import { import * as coreAuth from "@azure/core-auth"; import { AvailabilityStatusesImpl, - ChildAvailabilityStatusesImpl, - ChildResourcesImpl, OperationsImpl, - EmergingIssuesImpl + ImpactedResourcesImpl, + EventsOperationsImpl, + EventOperationsImpl } from "./operations"; import { AvailabilityStatuses, - ChildAvailabilityStatuses, - ChildResources, Operations, - EmergingIssues + ImpactedResources, + EventsOperations, + EventOperations } from "./operationsInterfaces"; import { MicrosoftResourceHealthOptionalParams } from "./models"; @@ -38,8 +38,7 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { /** * Initializes a new instance of the MicrosoftResourceHealth class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. - * The subscription ID forms part of the URI for every service call. + * @param subscriptionId The ID of the target subscription. * @param options The parameter options */ constructor( @@ -63,59 +62,65 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resourcehealth/3.1.1`; + const packageDetails = `azsdk-js-arm-resourcehealth/4.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - baseUri: + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2017-07-01"; + this.apiVersion = options.apiVersion || "2022-10-01-preview"; this.availabilityStatuses = new AvailabilityStatusesImpl(this); - this.childAvailabilityStatuses = new ChildAvailabilityStatusesImpl(this); - this.childResources = new ChildResourcesImpl(this); this.operations = new OperationsImpl(this); - this.emergingIssues = new EmergingIssuesImpl(this); + this.impactedResources = new ImpactedResourcesImpl(this); + this.eventsOperations = new EventsOperationsImpl(this); + this.eventOperations = new EventOperationsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -148,8 +153,8 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { } availabilityStatuses: AvailabilityStatuses; - childAvailabilityStatuses: ChildAvailabilityStatuses; - childResources: ChildResources; operations: Operations; - emergingIssues: EmergingIssues; + impactedResources: ImpactedResources; + eventsOperations: EventsOperations; + eventOperations: EventOperations; } diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts index 3598bd89f230..e7d2d4a015b2 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts @@ -34,6 +34,8 @@ export interface AvailabilityStatus { export interface AvailabilityStatusProperties { /** Availability status of the resource. When it is null, this availabilityStatus object represents an availability impacting event */ availabilityState?: AvailabilityStateValues; + /** Title description of the availability status. */ + title?: string; /** Summary description of the availability status. */ summary?: string; /** Details of the availability status. */ @@ -59,7 +61,7 @@ export interface AvailabilityStatusProperties { /** Timestamp for when the health was last checked. */ reportedTime?: Date; /** An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned */ - recentlyResolvedState?: AvailabilityStatusPropertiesRecentlyResolvedState; + recentlyResolved?: AvailabilityStatusPropertiesRecentlyResolved; /** Lists actions the user can take based on the current availabilityState of the resource. */ recommendedActions?: RecommendedAction[]; /** Lists the service impacting events that may be affecting the health of the resource. */ @@ -67,13 +69,13 @@ export interface AvailabilityStatusProperties { } /** An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned */ -export interface AvailabilityStatusPropertiesRecentlyResolvedState { +export interface AvailabilityStatusPropertiesRecentlyResolved { /** Timestamp for when the availabilityState changed to Unavailable */ - unavailableOccurredTime?: Date; + unavailableOccuredTime?: Date; /** Timestamp when the availabilityState changes to Available. */ resolvedTime?: Date; /** Brief description of cause of the resource becoming unavailable. */ - unavailabilitySummary?: string; + unavailableSummary?: string; } /** Lists actions the user can take based on the current availabilityState of the resource. */ @@ -163,6 +165,170 @@ export interface OperationDisplay { description?: string; } +/** The List of eventImpactedResources operation response. */ +export interface EventImpactedResourceListResult { + /** The list of eventImpactedResources. */ + value: EventImpactedResource[]; + /** The URI to fetch the next page of events. Call ListNext() with this URI to fetch the next page of impacted resource. */ + nextLink?: string; +} + +/** Key value tuple. */ +export interface KeyValueItem { + /** + * Key of tuple. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly key?: string; + /** + * Value of tuple. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** 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; +} + +/** The List events operation response. */ +export interface Events { + /** The list of event. */ + value: Event[]; + /** The URI to fetch the next page of events. Call ListNext() with this URI to fetch the next page of events. */ + nextLink?: string; +} + +/** Article of event. */ +export interface EventPropertiesArticle { + /** Article content of event. */ + articleContent?: string; +} + +/** Useful links for service health event. */ +export interface Link { + /** Type of link. */ + type?: LinkTypeValues; + /** Display text of link. */ + displayText?: LinkDisplayText; + /** It provides the name of portal extension to produce link for given service health event. */ + extensionName?: string; + /** It provides the name of portal extension blade to produce link for given service health event. */ + bladeName?: string; + /** It provides a map of parameter name and value for portal extension blade to produce lik for given service health event. */ + parameters?: Record; +} + +/** Display text of link. */ +export interface LinkDisplayText { + /** Display text of link. */ + value?: string; + /** Localized display text of link. */ + localizedValue?: string; +} + +/** Azure service impacted by the service health event. */ +export interface Impact { + /** Impacted service name. */ + impactedService?: string; + /** List regions impacted by the service health event. */ + impactedRegions?: ImpactedServiceRegion[]; +} + +/** Azure region impacted by the service health event. */ +export interface ImpactedServiceRegion { + /** Impacted region name. */ + impactedRegion?: string; + /** Current status of event in the region. */ + status?: EventStatusValues; + /** List subscription impacted by the service health event. */ + impactedSubscriptions?: string[]; + /** List tenant impacted by the service health event. */ + impactedTenants?: string[]; + /** It provides the Timestamp for when the last update for the service health event. */ + lastUpdateTime?: Date; + /** List of updates for given service health event. */ + updates?: Update[]; +} + +/** Update for service health event. */ +export interface Update { + /** Summary text for the given update for the service health event. */ + summary?: string; + /** It provides the Timestamp for the given update for the service health event. */ + updateDateTime?: Date; +} + +/** Recommended actions of event. */ +export interface EventPropertiesRecommendedActions { + /** Recommended action title for the service health event. */ + message?: string; + /** Recommended actions for the service health event. */ + actions?: EventPropertiesRecommendedActionsItem[]; + /** Recommended action locale for the service health event. */ + localeCode?: string; +} + +/** Recommended action for the service health event. */ +export interface EventPropertiesRecommendedActionsItem { + /** Recommended action group Id for the service health event. */ + groupId?: number; + /** Recommended action text */ + actionText?: string; +} + +/** Frequently asked question for the service health event */ +export interface Faq { + /** FAQ question for the service health event. */ + question?: string; + /** FAQ answer for the service health event. */ + answer?: string; + /** FAQ locale for the service health event. */ + localeCode?: string; +} + +/** Additional information */ +export interface EventPropertiesAdditionalInformation { + /** Additional information Message */ + message?: string; +} + /** Banner type of emerging issue. */ export interface StatusBanner { /** The banner title. */ @@ -175,40 +341,6 @@ export interface StatusBanner { lastModifiedTime?: Date; } -/** Active event type of emerging issue. */ -export interface StatusActiveEvent { - /** The active event title. */ - title?: string; - /** The details of active event. */ - description?: string; - /** The tracking id of this active event. */ - trackingId?: string; - /** The impact start time on this active event. */ - startTime?: Date; - /** The cloud type of this active event. */ - cloud?: string; - /** The severity level of this active event. */ - severity?: SeverityValues; - /** The stage of this active event. */ - stage?: StageValues; - /** The boolean value of this active event if published or not. */ - published?: boolean; - /** The last time modified on this banner. */ - lastModifiedTime?: Date; - /** The list of emerging issues impacts. */ - impacts?: EmergingIssueImpact[]; -} - -/** Object of the emerging issue impact on services and regions. */ -export interface EmergingIssueImpact { - /** The impacted service id. */ - id?: string; - /** The impacted service name. */ - name?: string; - /** The list of impacted regions for corresponding emerging issues. */ - regions?: ImpactedRegion[]; -} - /** Object of impacted region. */ export interface ImpactedRegion { /** The impacted region id. */ @@ -217,88 +349,314 @@ export interface ImpactedRegion { name?: string; } -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** Impacted resource for an event. */ +export interface EventImpactedResource extends ProxyResource { /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * Resource type within Microsoft cloud. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly id?: string; + readonly targetResourceType?: string; /** - * The name of the resource + * Identity for resource within Microsoft cloud. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly targetResourceId?: string; /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * Impacted resource region name. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly targetRegion?: string; + /** Additional information. */ + info?: KeyValueItem[]; +} + +/** Service health event */ +export interface Event extends ProxyResource { + /** Type of event. */ + eventType?: EventTypeValues; + /** Source of event. */ + eventSource?: EventSourceValues; + /** Current status of event. */ + status?: EventStatusValues; + /** Title text of event. */ + title?: string; + /** Summary text of event. */ + summary?: string; + /** Header text of event. */ + header?: string; + /** Level of insight. */ + level?: LevelValues; + /** Level of event. */ + eventLevel?: EventLevelValues; + /** The id of the Incident */ + externalIncidentId?: string; + /** Article of event. */ + article?: EventPropertiesArticle; + /** Useful links of event. */ + links?: Link[]; + /** It provides the Timestamp for when the health impacting event started. */ + impactStartTime?: Date; + /** It provides the Timestamp for when the health impacting event resolved. */ + impactMitigationTime?: Date; + /** List services impacted by the service health event. */ + impact?: Impact[]; + /** Recommended actions of event. */ + recommendedActions?: EventPropertiesRecommendedActions; + /** Frequently asked questions for the service health event. */ + faqs?: Faq[]; + /** It provides information if the event is High incident rate event or not. */ + isHIR?: boolean; + /** Tells if we want to enable or disable Microsoft Support for this event. */ + enableMicrosoftSupport?: boolean; + /** Contains the communication message for the event, that could include summary, root cause and other details. */ + description?: string; + /** Is true if the event is platform initiated. */ + platformInitiated?: boolean; + /** Tells if we want to enable or disable Microsoft Support for this event. */ + enableChatWithUs?: boolean; + /** Priority level of the event. Has value from 0 to 23. 0 is the highest priority. Service issue events have higher priority followed by planned maintenance and health advisory. Critical events have higher priority followed by error, warning and informational. Furthermore, active events have higher priority than resolved. */ + priority?: number; + /** It provides the Timestamp for when the health impacting event was last updated. */ + lastUpdateTime?: Date; + /** Stage for HIR Document */ + hirStage?: string; + /** Additional information */ + additionalInformation?: EventPropertiesAdditionalInformation; + /** duration in seconds */ + duration?: number; + /** The type of the impact */ + impactType?: string; +} + +/** impactedResource with health status */ +export interface ImpactedResourceStatus extends ProxyResource { + /** Impacted resource status of the resource. */ + availabilityState?: AvailabilityStateValues; + /** Title description of the impacted resource status. */ + title?: string; + /** Summary description of the impacted resource status. */ + summary?: string; + /** When the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. */ + reasonType?: ReasonTypeValues; + /** Timestamp for when last change in health status occurred. */ + occurredTime?: Date; } -/** The list of emerging issues. */ -export interface EmergingIssueListResult { - /** The list of emerging issues. */ - value?: EmergingIssuesGetResult[]; - /** The link used to get the next page of emerging issues. */ - nextLink?: string; +/** Known values of {@link AvailabilityStateValues} that the service accepts. */ +export enum KnownAvailabilityStateValues { + /** Available */ + Available = "Available", + /** Unavailable */ + Unavailable = "Unavailable", + /** Degraded */ + Degraded = "Degraded", + /** Unknown */ + Unknown = "Unknown" } -/** The Get EmergingIssues operation response. */ -export interface EmergingIssuesGetResult extends Resource { - /** Timestamp for when last time refreshed for ongoing emerging issue. */ - refreshTimestamp?: Date; - /** The list of emerging issues of banner type. */ - statusBanners?: StatusBanner[]; - /** The list of emerging issues of active event type. */ - statusActiveEvents?: StatusActiveEvent[]; +/** + * Defines values for AvailabilityStateValues. \ + * {@link KnownAvailabilityStateValues} can be used interchangeably with AvailabilityStateValues, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Available** \ + * **Unavailable** \ + * **Degraded** \ + * **Unknown** + */ +export type AvailabilityStateValues = string; + +/** Known values of {@link ReasonChronicityTypes} that the service accepts. */ +export enum KnownReasonChronicityTypes { + /** Transient */ + Transient = "Transient", + /** Persistent */ + Persistent = "Persistent" } -/** Known values of {@link SeverityValues} that the service accepts. */ -export enum KnownSeverityValues { - /** Information */ - Information = "Information", - /** Warning */ - Warning = "Warning", - /** Error */ - Error = "Error" +/** + * Defines values for ReasonChronicityTypes. \ + * {@link KnownReasonChronicityTypes} can be used interchangeably with ReasonChronicityTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Transient** \ + * **Persistent** + */ +export type ReasonChronicityTypes = 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 SeverityValues. \ - * {@link KnownSeverityValues} can be used interchangeably with SeverityValues, + * 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 - * **Information** \ - * **Warning** \ - * **Error** + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link EventTypeValues} that the service accepts. */ +export enum KnownEventTypeValues { + /** ServiceIssue */ + ServiceIssue = "ServiceIssue", + /** PlannedMaintenance */ + PlannedMaintenance = "PlannedMaintenance", + /** HealthAdvisory */ + HealthAdvisory = "HealthAdvisory", + /** RCA */ + RCA = "RCA", + /** EmergingIssues */ + EmergingIssues = "EmergingIssues", + /** SecurityAdvisory */ + SecurityAdvisory = "SecurityAdvisory" +} + +/** + * Defines values for EventTypeValues. \ + * {@link KnownEventTypeValues} can be used interchangeably with EventTypeValues, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ServiceIssue** \ + * **PlannedMaintenance** \ + * **HealthAdvisory** \ + * **RCA** \ + * **EmergingIssues** \ + * **SecurityAdvisory** + */ +export type EventTypeValues = string; + +/** Known values of {@link EventSourceValues} that the service accepts. */ +export enum KnownEventSourceValues { + /** ResourceHealth */ + ResourceHealth = "ResourceHealth", + /** ServiceHealth */ + ServiceHealth = "ServiceHealth" +} + +/** + * Defines values for EventSourceValues. \ + * {@link KnownEventSourceValues} can be used interchangeably with EventSourceValues, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ResourceHealth** \ + * **ServiceHealth** */ -export type SeverityValues = string; +export type EventSourceValues = string; -/** Known values of {@link StageValues} that the service accepts. */ -export enum KnownStageValues { +/** Known values of {@link EventStatusValues} that the service accepts. */ +export enum KnownEventStatusValues { /** Active */ Active = "Active", - /** Resolve */ - Resolve = "Resolve", - /** Archived */ - Archived = "Archived" + /** Resolved */ + Resolved = "Resolved" } /** - * Defines values for StageValues. \ - * {@link KnownStageValues} can be used interchangeably with StageValues, + * Defines values for EventStatusValues. \ + * {@link KnownEventStatusValues} can be used interchangeably with EventStatusValues, * this enum contains the known values that the service supports. * ### Known values supported by the service * **Active** \ - * **Resolve** \ - * **Archived** + * **Resolved** + */ +export type EventStatusValues = string; + +/** Known values of {@link LevelValues} that the service accepts. */ +export enum KnownLevelValues { + /** Critical */ + Critical = "Critical", + /** Warning */ + Warning = "Warning" +} + +/** + * Defines values for LevelValues. \ + * {@link KnownLevelValues} can be used interchangeably with LevelValues, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Critical** \ + * **Warning** + */ +export type LevelValues = string; + +/** Known values of {@link EventLevelValues} that the service accepts. */ +export enum KnownEventLevelValues { + /** Critical */ + Critical = "Critical", + /** Error */ + Error = "Error", + /** Warning */ + Warning = "Warning", + /** Informational */ + Informational = "Informational" +} + +/** + * Defines values for EventLevelValues. \ + * {@link KnownEventLevelValues} can be used interchangeably with EventLevelValues, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Critical** \ + * **Error** \ + * **Warning** \ + * **Informational** + */ +export type EventLevelValues = string; + +/** Known values of {@link LinkTypeValues} that the service accepts. */ +export enum KnownLinkTypeValues { + /** Button */ + Button = "Button", + /** Hyperlink */ + Hyperlink = "Hyperlink" +} + +/** + * Defines values for LinkTypeValues. \ + * {@link KnownLinkTypeValues} can be used interchangeably with LinkTypeValues, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Button** \ + * **Hyperlink** */ -export type StageValues = string; -/** Defines values for AvailabilityStateValues. */ -export type AvailabilityStateValues = "Available" | "Unavailable" | "Unknown"; -/** Defines values for ReasonChronicityTypes. */ -export type ReasonChronicityTypes = "Transient" | "Persistent"; +export type LinkTypeValues = string; + +/** Known values of {@link ReasonTypeValues} that the service accepts. */ +export enum KnownReasonTypeValues { + /** Unplanned */ + Unplanned = "Unplanned", + /** Planned */ + Planned = "Planned", + /** UserInitiated */ + UserInitiated = "UserInitiated" +} + +/** + * Defines values for ReasonTypeValues. \ + * {@link KnownReasonTypeValues} can be used interchangeably with ReasonTypeValues, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unplanned** \ + * **Planned** \ + * **UserInitiated** + */ +export type ReasonTypeValues = string; /** Optional parameters. */ export interface AvailabilityStatusesListBySubscriptionIdOptionalParams @@ -350,127 +708,134 @@ export type AvailabilityStatusesListResponse = AvailabilityStatusListResult; /** Optional parameters. */ export interface AvailabilityStatusesListBySubscriptionIdNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ - filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionIdNext operation. */ export type AvailabilityStatusesListBySubscriptionIdNextResponse = AvailabilityStatusListResult; /** Optional parameters. */ export interface AvailabilityStatusesListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ - filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ export type AvailabilityStatusesListByResourceGroupNextResponse = AvailabilityStatusListResult; /** Optional parameters. */ export interface AvailabilityStatusesListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ - filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type AvailabilityStatusesListNextResponse = AvailabilityStatusListResult; /** Optional parameters. */ -export interface ChildAvailabilityStatusesGetByResourceOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ - filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; -} +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} -/** Contains response data for the getByResource operation. */ -export type ChildAvailabilityStatusesGetByResourceResponse = AvailabilityStatus; +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; /** Optional parameters. */ -export interface ChildAvailabilityStatusesListOptionalParams +export interface ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; } -/** Contains response data for the list operation. */ -export type ChildAvailabilityStatusesListResponse = AvailabilityStatusListResult; +/** Contains response data for the listBySubscriptionIdAndEventId operation. */ +export type ImpactedResourcesListBySubscriptionIdAndEventIdResponse = EventImpactedResourceListResult; /** Optional parameters. */ -export interface ChildAvailabilityStatusesListNextOptionalParams +export interface ImpactedResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ImpactedResourcesGetResponse = EventImpactedResource; + +/** Optional parameters. */ +export interface ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionIdAndEventIdNext operation. */ +export type ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse = EventImpactedResourceListResult; + +/** Optional parameters. */ +export interface EventsListBySubscriptionIdOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; + /** Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020 */ + queryStartTime?: string; } -/** Contains response data for the listNext operation. */ -export type ChildAvailabilityStatusesListNextResponse = AvailabilityStatusListResult; +/** Contains response data for the listBySubscriptionId operation. */ +export type EventsListBySubscriptionIdResponse = Events; /** Optional parameters. */ -export interface ChildResourcesListOptionalParams +export interface EventsListByTenantIdOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; + /** Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020 */ + queryStartTime?: string; } -/** Contains response data for the list operation. */ -export type ChildResourcesListResponse = AvailabilityStatusListResult; +/** Contains response data for the listByTenantId operation. */ +export type EventsListByTenantIdResponse = Events; /** Optional parameters. */ -export interface ChildResourcesListNextOptionalParams +export interface EventsListBySingleResourceOptionalParams extends coreClient.OperationOptions { /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; } -/** Contains response data for the listNext operation. */ -export type ChildResourcesListNextResponse = AvailabilityStatusListResult; +/** Contains response data for the listBySingleResource operation. */ +export type EventsListBySingleResourceResponse = Events; /** Optional parameters. */ -export interface OperationsListOptionalParams +export interface EventsListBySubscriptionIdNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; +/** Contains response data for the listBySubscriptionIdNext operation. */ +export type EventsListBySubscriptionIdNextResponse = Events; /** Optional parameters. */ -export interface EmergingIssuesGetOptionalParams +export interface EventsListByTenantIdNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type EmergingIssuesGetResponse = EmergingIssuesGetResult; +/** Contains response data for the listByTenantIdNext operation. */ +export type EventsListByTenantIdNextResponse = Events; /** Optional parameters. */ -export interface EmergingIssuesListOptionalParams +export interface EventsListBySingleResourceNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type EmergingIssuesListResponse = EmergingIssueListResult; +/** Contains response data for the listBySingleResourceNext operation. */ +export type EventsListBySingleResourceNextResponse = Events; /** Optional parameters. */ -export interface EmergingIssuesListNextOptionalParams - extends coreClient.OperationOptions {} +export interface EventGetBySubscriptionIdAndTrackingIdOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ + filter?: string; + /** Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020 */ + queryStartTime?: string; +} -/** Contains response data for the listNext operation. */ -export type EmergingIssuesListNextResponse = EmergingIssueListResult; +/** Contains response data for the getBySubscriptionIdAndTrackingId operation. */ +export type EventGetBySubscriptionIdAndTrackingIdResponse = Event; + +/** Optional parameters. */ +export interface EventGetByTenantIdAndTrackingIdOptionalParams + extends coreClient.OperationOptions { + /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ + filter?: string; + /** Specifies from when to return events, based on the lastUpdateTime property. For example, queryStartTime = 7/24/2020 OR queryStartTime=7%2F24%2F2020 */ + queryStartTime?: string; +} + +/** Contains response data for the getByTenantIdAndTrackingId operation. */ +export type EventGetByTenantIdAndTrackingIdResponse = Event; /** Optional parameters. */ export interface MicrosoftResourceHealthOptionalParams diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts index 6ae4eaf92675..4332a3180cd8 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts @@ -84,8 +84,13 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { availabilityState: { serializedName: "availabilityState", type: { - name: "Enum", - allowedValues: ["Available", "Unavailable", "Unknown"] + name: "String" + } + }, + title: { + serializedName: "title", + type: { + name: "String" } }, summary: { @@ -151,8 +156,7 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { reasonChronicity: { serializedName: "reasonChronicity", type: { - name: "Enum", - allowedValues: ["Transient", "Persistent"] + name: "String" } }, reportedTime: { @@ -161,11 +165,11 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { name: "DateTime" } }, - recentlyResolvedState: { - serializedName: "recentlyResolvedState", + recentlyResolved: { + serializedName: "recentlyResolved", type: { name: "Composite", - className: "AvailabilityStatusPropertiesRecentlyResolvedState" + className: "AvailabilityStatusPropertiesRecentlyResolved" } }, recommendedActions: { @@ -196,13 +200,13 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { } }; -export const AvailabilityStatusPropertiesRecentlyResolvedState: coreClient.CompositeMapper = { +export const AvailabilityStatusPropertiesRecentlyResolved: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailabilityStatusPropertiesRecentlyResolvedState", + className: "AvailabilityStatusPropertiesRecentlyResolved", modelProperties: { - unavailableOccurredTime: { - serializedName: "unavailableOccurredTime", + unavailableOccuredTime: { + serializedName: "unavailableOccuredTime", type: { name: "DateTime" } @@ -213,8 +217,8 @@ export const AvailabilityStatusPropertiesRecentlyResolvedState: coreClient.Compo name: "DateTime" } }, - unavailabilitySummary: { - serializedName: "unavailabilitySummary", + unavailableSummary: { + serializedName: "unavailableSummary", type: { name: "String" } @@ -446,106 +450,324 @@ export const OperationDisplay: coreClient.CompositeMapper = { } }; -export const StatusBanner: coreClient.CompositeMapper = { +export const EventImpactedResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StatusBanner", + className: "EventImpactedResourceListResult", modelProperties: { - title: { - serializedName: "title", + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EventImpactedResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const KeyValueItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyValueItem", + modelProperties: { + key: { + serializedName: "key", + readOnly: true, type: { name: "String" } }, - message: { - serializedName: "message", + value: { + serializedName: "value", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - cloud: { - serializedName: "cloud", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - lastModifiedTime: { - serializedName: "lastModifiedTime", + type: { + serializedName: "type", + readOnly: true, type: { - name: "DateTime" + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" } } } } }; -export const StatusActiveEvent: coreClient.CompositeMapper = { +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StatusActiveEvent", + className: "SystemData", modelProperties: { - title: { - serializedName: "title", + createdBy: { + serializedName: "createdBy", type: { name: "String" } }, - description: { - serializedName: "description", + createdByType: { + serializedName: "createdByType", type: { name: "String" } }, - trackingId: { - serializedName: "trackingId", + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { name: "String" } }, - startTime: { - serializedName: "startTime", + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", type: { name: "DateTime" } + } + } + } +}; + +export const Events: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Events", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Event" + } + } + } }, - cloud: { - serializedName: "cloud", + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const EventPropertiesArticle: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventPropertiesArticle", + modelProperties: { + articleContent: { + serializedName: "articleContent", + type: { + name: "String" + } + } + } + } +}; + +export const Link: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Link", + modelProperties: { + type: { + serializedName: "type", type: { name: "String" } }, - severity: { - serializedName: "severity", + displayText: { + serializedName: "displayText", + type: { + name: "Composite", + className: "LinkDisplayText" + } + }, + extensionName: { + serializedName: "extensionName", type: { name: "String" } }, - stage: { - serializedName: "stage", + bladeName: { + serializedName: "bladeName", type: { name: "String" } }, - published: { - serializedName: "published", + parameters: { + serializedName: "parameters", type: { - name: "Boolean" + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const LinkDisplayText: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LinkDisplayText", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" } }, - lastModifiedTime: { - serializedName: "lastModifiedTime", + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const Impact: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Impact", + modelProperties: { + impactedService: { + serializedName: "impactedService", + type: { + name: "String" + } + }, + impactedRegions: { + serializedName: "impactedRegions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ImpactedServiceRegion" + } + } + } + } + } + } +}; + +export const ImpactedServiceRegion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImpactedServiceRegion", + modelProperties: { + impactedRegion: { + serializedName: "impactedRegion", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + impactedSubscriptions: { + serializedName: "impactedSubscriptions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + impactedTenants: { + serializedName: "impactedTenants", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + lastUpdateTime: { + serializedName: "lastUpdateTime", type: { name: "DateTime" } }, - impacts: { - serializedName: "impacts", + updates: { + serializedName: "updates", type: { name: "Sequence", element: { type: { name: "Composite", - className: "EmergingIssueImpact" + className: "Update" } } } @@ -554,34 +776,151 @@ export const StatusActiveEvent: coreClient.CompositeMapper = { } }; -export const EmergingIssueImpact: coreClient.CompositeMapper = { +export const Update: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EmergingIssueImpact", + className: "Update", modelProperties: { - id: { - serializedName: "id", + summary: { + serializedName: "summary", type: { name: "String" } }, - name: { - serializedName: "name", + updateDateTime: { + serializedName: "updateDateTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const EventPropertiesRecommendedActions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventPropertiesRecommendedActions", + modelProperties: { + message: { + serializedName: "message", type: { name: "String" } }, - regions: { - serializedName: "regions", + actions: { + serializedName: "actions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ImpactedRegion" + className: "EventPropertiesRecommendedActionsItem" } } } + }, + localeCode: { + serializedName: "localeCode", + type: { + name: "String" + } + } + } + } +}; + +export const EventPropertiesRecommendedActionsItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventPropertiesRecommendedActionsItem", + modelProperties: { + groupId: { + serializedName: "groupId", + type: { + name: "Number" + } + }, + actionText: { + serializedName: "actionText", + type: { + name: "String" + } + } + } + } +}; + +export const Faq: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Faq", + modelProperties: { + question: { + serializedName: "question", + type: { + name: "String" + } + }, + answer: { + serializedName: "answer", + type: { + name: "String" + } + }, + localeCode: { + serializedName: "localeCode", + type: { + name: "String" + } + } + } + } +}; + +export const EventPropertiesAdditionalInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventPropertiesAdditionalInformation", + modelProperties: { + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const StatusBanner: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StatusBanner", + modelProperties: { + title: { + serializedName: "title", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + cloud: { + serializedName: "cloud", + type: { + name: "String" + } + }, + lastModifiedTime: { + serializedName: "lastModifiedTime", + type: { + name: "DateTime" + } } } } @@ -608,98 +947,287 @@ export const ImpactedRegion: coreClient.CompositeMapper = { } }; -export const Resource: coreClient.CompositeMapper = { +export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ProxyResource", modelProperties: { - id: { - serializedName: "id", + ...Resource.type.modelProperties + } + } +}; + +export const EventImpactedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventImpactedResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + targetResourceType: { + serializedName: "properties.targetResourceType", readOnly: true, type: { name: "String" } }, - name: { - serializedName: "name", + targetResourceId: { + serializedName: "properties.targetResourceId", readOnly: true, type: { name: "String" } }, - type: { - serializedName: "type", + targetRegion: { + serializedName: "properties.targetRegion", readOnly: true, type: { name: "String" } + }, + info: { + serializedName: "properties.info", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyValueItem" + } + } + } } } } }; -export const EmergingIssueListResult: coreClient.CompositeMapper = { +export const Event: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EmergingIssueListResult", + className: "Event", modelProperties: { - value: { - serializedName: "value", + ...ProxyResource.type.modelProperties, + eventType: { + serializedName: "properties.eventType", + type: { + name: "String" + } + }, + eventSource: { + serializedName: "properties.eventSource", + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + type: { + name: "String" + } + }, + title: { + serializedName: "properties.title", + type: { + name: "String" + } + }, + summary: { + serializedName: "properties.summary", + type: { + name: "String" + } + }, + header: { + serializedName: "properties.header", + type: { + name: "String" + } + }, + level: { + serializedName: "properties.level", + type: { + name: "String" + } + }, + eventLevel: { + serializedName: "properties.eventLevel", + type: { + name: "String" + } + }, + externalIncidentId: { + serializedName: "properties.externalIncidentId", + type: { + name: "String" + } + }, + article: { + serializedName: "properties.article", + type: { + name: "Composite", + className: "EventPropertiesArticle" + } + }, + links: { + serializedName: "properties.links", type: { name: "Sequence", element: { type: { name: "Composite", - className: "EmergingIssuesGetResult" + className: "Link" } } } }, - nextLink: { - serializedName: "nextLink", + impactStartTime: { + serializedName: "properties.impactStartTime", type: { - name: "String" + name: "DateTime" } - } - } - } -}; - -export const EmergingIssuesGetResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EmergingIssuesGetResult", - modelProperties: { - ...Resource.type.modelProperties, - refreshTimestamp: { - serializedName: "properties.refreshTimestamp", + }, + impactMitigationTime: { + serializedName: "properties.impactMitigationTime", type: { name: "DateTime" } }, - statusBanners: { - serializedName: "properties.statusBanners", + impact: { + serializedName: "properties.impact", type: { name: "Sequence", element: { type: { name: "Composite", - className: "StatusBanner" + className: "Impact" } } } }, - statusActiveEvents: { - serializedName: "properties.statusActiveEvents", + recommendedActions: { + serializedName: "properties.recommendedActions", + type: { + name: "Composite", + className: "EventPropertiesRecommendedActions" + } + }, + faqs: { + serializedName: "properties.faqs", type: { name: "Sequence", element: { type: { name: "Composite", - className: "StatusActiveEvent" + className: "Faq" } } } + }, + isHIR: { + serializedName: "properties.isHIR", + type: { + name: "Boolean" + } + }, + enableMicrosoftSupport: { + serializedName: "properties.enableMicrosoftSupport", + type: { + name: "Boolean" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + platformInitiated: { + serializedName: "properties.platformInitiated", + type: { + name: "Boolean" + } + }, + enableChatWithUs: { + serializedName: "properties.enableChatWithUs", + type: { + name: "Boolean" + } + }, + priority: { + serializedName: "properties.priority", + type: { + name: "Number" + } + }, + lastUpdateTime: { + serializedName: "properties.lastUpdateTime", + type: { + name: "DateTime" + } + }, + hirStage: { + serializedName: "properties.hirStage", + type: { + name: "String" + } + }, + additionalInformation: { + serializedName: "properties.additionalInformation", + type: { + name: "Composite", + className: "EventPropertiesAdditionalInformation" + } + }, + duration: { + serializedName: "properties.duration", + type: { + name: "Number" + } + }, + impactType: { + serializedName: "properties.impactType", + type: { + name: "String" + } + } + } + } +}; + +export const ImpactedResourceStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImpactedResourceStatus", + modelProperties: { + ...ProxyResource.type.modelProperties, + availabilityState: { + serializedName: "properties.availabilityState", + type: { + name: "String" + } + }, + title: { + serializedName: "properties.title", + type: { + name: "String" + } + }, + summary: { + serializedName: "properties.summary", + type: { + name: "String" + } + }, + reasonType: { + serializedName: "properties.reasonType", + type: { + name: "String" + } + }, + occurredTime: { + serializedName: "properties.occurredTime", + type: { + name: "DateTime" + } } } } diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/parameters.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/parameters.ts index 6dc6222dc643..1429b2963bf2 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/models/parameters.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/models/parameters.ts @@ -39,7 +39,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2017-07-01", + defaultValue: "2022-10-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -61,6 +61,9 @@ export const filter: OperationQueryParameter = { export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { + constraints: { + MinLength: 1 + }, serializedName: "subscriptionId", required: true, type: { @@ -114,12 +117,32 @@ export const nextLink: OperationURLParameter = { skipEncoding: true }; -export const issueName: OperationURLParameter = { - parameterPath: "issueName", +export const eventTrackingId: OperationURLParameter = { + parameterPath: "eventTrackingId", mapper: { - defaultValue: "default", - isConstant: true, - serializedName: "issueName", + serializedName: "eventTrackingId", + required: true, + type: { + name: "String" + } + } +}; + +export const impactedResourceName: OperationURLParameter = { + parameterPath: "impactedResourceName", + mapper: { + serializedName: "impactedResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const queryStartTime: OperationQueryParameter = { + parameterPath: ["options", "queryStartTime"], + mapper: { + serializedName: "queryStartTime", type: { name: "String" } diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts index 2869f85aca59..597961edbf67 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { AvailabilityStatuses } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,15 +17,15 @@ import { AvailabilityStatus, AvailabilityStatusesListBySubscriptionIdNextOptionalParams, AvailabilityStatusesListBySubscriptionIdOptionalParams, + AvailabilityStatusesListBySubscriptionIdResponse, AvailabilityStatusesListByResourceGroupNextOptionalParams, AvailabilityStatusesListByResourceGroupOptionalParams, + AvailabilityStatusesListByResourceGroupResponse, AvailabilityStatusesListNextOptionalParams, AvailabilityStatusesListOptionalParams, - AvailabilityStatusesListBySubscriptionIdResponse, - AvailabilityStatusesListByResourceGroupResponse, + AvailabilityStatusesListResponse, AvailabilityStatusesGetByResourceOptionalParams, AvailabilityStatusesGetByResourceResponse, - AvailabilityStatusesListResponse, AvailabilityStatusesListBySubscriptionIdNextResponse, AvailabilityStatusesListByResourceGroupNextResponse, AvailabilityStatusesListNextResponse @@ -44,8 +45,7 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { } /** - * Lists the current availability status for all the resources in the subscription. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the subscription. * @param options The options parameters. */ public listBySubscriptionId( @@ -59,22 +59,34 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionIdPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionIdPagingPage(options, settings); } }; } private async *listBySubscriptionIdPagingPage( - options?: AvailabilityStatusesListBySubscriptionIdOptionalParams + options?: AvailabilityStatusesListBySubscriptionIdOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscriptionId(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: AvailabilityStatusesListBySubscriptionIdResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscriptionId(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionIdNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -87,8 +99,7 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { } /** - * Lists the current availability status for all the resources in the resource group. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the resource group. * @param resourceGroupName The name of the resource group. * @param options The options parameters. */ @@ -104,19 +115,33 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: AvailabilityStatusesListByResourceGroupOptionalParams + options?: AvailabilityStatusesListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: AvailabilityStatusesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -124,7 +149,9 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -141,8 +168,7 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { } /** - * Lists all historical availability transitions and impacting events for a single resource. Use the - * nextLink property in the response to get the next page of availability status + * Lists all historical availability transitions and impacting events for a single resource. * @param resourceUri The fully qualified ID of the resource, including the resource name and resource * type. Currently the API support not nested and one nesting level resource types : * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} @@ -162,23 +188,35 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceUri, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceUri, options, settings); } }; } private async *listPagingPage( resourceUri: string, - options?: AvailabilityStatusesListOptionalParams + options?: AvailabilityStatusesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: AvailabilityStatusesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceUri, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(resourceUri, continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -192,8 +230,7 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { } /** - * Lists the current availability status for all the resources in the subscription. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the subscription. * @param options The options parameters. */ private _listBySubscriptionId( @@ -206,8 +243,7 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { } /** - * Lists the current availability status for all the resources in the resource group. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the resource group. * @param resourceGroupName The name of the resource group. * @param options The options parameters. */ @@ -241,8 +277,7 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { } /** - * Lists all historical availability transitions and impacting events for a single resource. Use the - * nextLink property in the response to get the next page of availability status + * Lists all historical availability transitions and impacting events for a single resource. * @param resourceUri The fully qualified ID of the resource, including the resource name and resource * type. Currently the API support not nested and one nesting level resource types : * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} @@ -415,11 +450,6 @@ const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -439,11 +469,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -464,11 +489,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], urlParameters: [ Parameters.$host, Parameters.resourceUri, diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/childAvailabilityStatuses.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/childAvailabilityStatuses.ts deleted file mode 100644 index 069e458ac30f..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/childAvailabilityStatuses.ts +++ /dev/null @@ -1,210 +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 { ChildAvailabilityStatuses } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { MicrosoftResourceHealth } from "../microsoftResourceHealth"; -import { - AvailabilityStatus, - ChildAvailabilityStatusesListNextOptionalParams, - ChildAvailabilityStatusesListOptionalParams, - ChildAvailabilityStatusesGetByResourceOptionalParams, - ChildAvailabilityStatusesGetByResourceResponse, - ChildAvailabilityStatusesListResponse, - ChildAvailabilityStatusesListNextResponse -} from "../models"; - -/// -/** Class containing ChildAvailabilityStatuses operations. */ -export class ChildAvailabilityStatusesImpl - implements ChildAvailabilityStatuses { - private readonly client: MicrosoftResourceHealth; - - /** - * Initialize a new instance of the class ChildAvailabilityStatuses class. - * @param client Reference to the service client - */ - constructor(client: MicrosoftResourceHealth) { - this.client = client; - } - - /** - * Lists the historical availability statuses for a single child resource. Use the nextLink property in - * the response to get the next page of availability status - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(resourceUri, options); - } - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(resourceUri, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * Gets current availability status for a single resource - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - getByResource( - resourceUri: string, - options?: ChildAvailabilityStatusesGetByResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - getByResourceOperationSpec - ); - } - - /** - * Lists the historical availability statuses for a single child resource. Use the nextLink property in - * the response to get the next page of availability status - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec - ); - } - - /** - * ListNext - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceUri: string, - nextLink: string, - options?: ChildAvailabilityStatusesListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getByResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatus - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatusListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatusListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceUri, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/childResources.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/childResources.ts deleted file mode 100644 index 500dec89921f..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/childResources.ts +++ /dev/null @@ -1,168 +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 { ChildResources } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { MicrosoftResourceHealth } from "../microsoftResourceHealth"; -import { - AvailabilityStatus, - ChildResourcesListNextOptionalParams, - ChildResourcesListOptionalParams, - ChildResourcesListResponse, - ChildResourcesListNextResponse -} from "../models"; - -/// -/** Class containing ChildResources operations. */ -export class ChildResourcesImpl implements ChildResources { - private readonly client: MicrosoftResourceHealth; - - /** - * Initialize a new instance of the class ChildResources class. - * @param client Reference to the service client - */ - constructor(client: MicrosoftResourceHealth) { - this.client = client; - } - - /** - * Lists the all the children and its current health status for a parent resource. Use the nextLink - * property in the response to get the next page of children current health - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(resourceUri, options); - } - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(resourceUri, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * Lists the all the children and its current health status for a parent resource. Use the nextLink - * property in the response to get the next page of children current health - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec - ); - } - - /** - * ListNext - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceUri: string, - nextLink: string, - options?: ChildResourcesListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ResourceHealth/childResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatusListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatusListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceUri, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts deleted file mode 100644 index df507a849b31..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts +++ /dev/null @@ -1,165 +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 { EmergingIssues } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { MicrosoftResourceHealth } from "../microsoftResourceHealth"; -import { - EmergingIssuesGetResult, - EmergingIssuesListNextOptionalParams, - EmergingIssuesListOptionalParams, - EmergingIssuesGetOptionalParams, - EmergingIssuesGetResponse, - EmergingIssuesListResponse, - EmergingIssuesListNextResponse -} from "../models"; - -/// -/** Class containing EmergingIssues operations. */ -export class EmergingIssuesImpl implements EmergingIssues { - private readonly client: MicrosoftResourceHealth; - - /** - * Initialize a new instance of the class EmergingIssues class. - * @param client Reference to the service client - */ - constructor(client: MicrosoftResourceHealth) { - this.client = client; - } - - /** - * Lists Azure services' emerging issues. - * @param options The options parameters. - */ - public list( - options?: EmergingIssuesListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(options); - } - }; - } - - private async *listPagingPage( - options?: EmergingIssuesListOptionalParams - ): 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?: EmergingIssuesListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Gets Azure services' emerging issues. - * @param options The options parameters. - */ - get( - options?: EmergingIssuesGetOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, getOperationSpec); - } - - /** - * Lists Azure services' emerging issues. - * @param options The options parameters. - */ - private _list( - options?: EmergingIssuesListOptionalParams - ): 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?: EmergingIssuesListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EmergingIssuesGetResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.issueName], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.ResourceHealth/emergingIssues", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EmergingIssueListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EmergingIssueListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/eventOperations.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/eventOperations.ts new file mode 100644 index 000000000000..5bb1a74d26e0 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/eventOperations.ts @@ -0,0 +1,110 @@ +/* + * 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 { EventOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftResourceHealth } from "../microsoftResourceHealth"; +import { + EventGetBySubscriptionIdAndTrackingIdOptionalParams, + EventGetBySubscriptionIdAndTrackingIdResponse, + EventGetByTenantIdAndTrackingIdOptionalParams, + EventGetByTenantIdAndTrackingIdResponse +} from "../models"; + +/** Class containing EventOperations operations. */ +export class EventOperationsImpl implements EventOperations { + private readonly client: MicrosoftResourceHealth; + + /** + * Initialize a new instance of the class EventOperations class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftResourceHealth) { + this.client = client; + } + + /** + * Service health event in the subscription by event tracking id + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + getBySubscriptionIdAndTrackingId( + eventTrackingId: string, + options?: EventGetBySubscriptionIdAndTrackingIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, options }, + getBySubscriptionIdAndTrackingIdOperationSpec + ); + } + + /** + * Service health event in the tenant by event tracking id + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + getByTenantIdAndTrackingId( + eventTrackingId: string, + options?: EventGetByTenantIdAndTrackingIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, options }, + getByTenantIdAndTrackingIdOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getBySubscriptionIdAndTrackingIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Event + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.queryStartTime + ], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.eventTrackingId + ], + headerParameters: [Parameters.accept], + serializer +}; +const getByTenantIdAndTrackingIdOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Event + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.queryStartTime + ], + urlParameters: [Parameters.$host, Parameters.eventTrackingId], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/eventsOperations.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/eventsOperations.ts new file mode 100644 index 000000000000..d35faaf456de --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/eventsOperations.ts @@ -0,0 +1,434 @@ +/* + * 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 { EventsOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftResourceHealth } from "../microsoftResourceHealth"; +import { + Event, + EventsListBySubscriptionIdNextOptionalParams, + EventsListBySubscriptionIdOptionalParams, + EventsListBySubscriptionIdResponse, + EventsListByTenantIdNextOptionalParams, + EventsListByTenantIdOptionalParams, + EventsListByTenantIdResponse, + EventsListBySingleResourceNextOptionalParams, + EventsListBySingleResourceOptionalParams, + EventsListBySingleResourceResponse, + EventsListBySubscriptionIdNextResponse, + EventsListByTenantIdNextResponse, + EventsListBySingleResourceNextResponse +} from "../models"; + +/// +/** Class containing EventsOperations operations. */ +export class EventsOperationsImpl implements EventsOperations { + private readonly client: MicrosoftResourceHealth; + + /** + * Initialize a new instance of the class EventsOperations class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftResourceHealth) { + this.client = client; + } + + /** + * Lists service health events in the subscription. + * @param options The options parameters. + */ + public listBySubscriptionId( + options?: EventsListBySubscriptionIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionIdPagingAll(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.listBySubscriptionIdPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionIdPagingPage( + options?: EventsListBySubscriptionIdOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: EventsListBySubscriptionIdResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscriptionId(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionIdNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionIdPagingAll( + options?: EventsListBySubscriptionIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionIdPagingPage(options)) { + yield* page; + } + } + + /** + * Lists current service health events in the tenant. + * @param options The options parameters. + */ + public listByTenantId( + options?: EventsListByTenantIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByTenantIdPagingAll(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.listByTenantIdPagingPage(options, settings); + } + }; + } + + private async *listByTenantIdPagingPage( + options?: EventsListByTenantIdOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: EventsListByTenantIdResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByTenantId(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByTenantIdNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByTenantIdPagingAll( + options?: EventsListByTenantIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByTenantIdPagingPage(options)) { + yield* page; + } + } + + /** + * Lists current service health events for given resource. + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource + * type. Currently the API support not nested and one nesting level resource types : + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * and + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param options The options parameters. + */ + public listBySingleResource( + resourceUri: string, + options?: EventsListBySingleResourceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySingleResourcePagingAll(resourceUri, 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.listBySingleResourcePagingPage( + resourceUri, + options, + settings + ); + } + }; + } + + private async *listBySingleResourcePagingPage( + resourceUri: string, + options?: EventsListBySingleResourceOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: EventsListBySingleResourceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySingleResource(resourceUri, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySingleResourceNext( + resourceUri, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySingleResourcePagingAll( + resourceUri: string, + options?: EventsListBySingleResourceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySingleResourcePagingPage( + resourceUri, + options + )) { + yield* page; + } + } + + /** + * Lists service health events in the subscription. + * @param options The options parameters. + */ + private _listBySubscriptionId( + options?: EventsListBySubscriptionIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionIdOperationSpec + ); + } + + /** + * Lists current service health events in the tenant. + * @param options The options parameters. + */ + private _listByTenantId( + options?: EventsListByTenantIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listByTenantIdOperationSpec + ); + } + + /** + * Lists current service health events for given resource. + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource + * type. Currently the API support not nested and one nesting level resource types : + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * and + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param options The options parameters. + */ + private _listBySingleResource( + resourceUri: string, + options?: EventsListBySingleResourceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, options }, + listBySingleResourceOperationSpec + ); + } + + /** + * ListBySubscriptionIdNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscriptionId method. + * @param options The options parameters. + */ + private _listBySubscriptionIdNext( + nextLink: string, + options?: EventsListBySubscriptionIdNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionIdNextOperationSpec + ); + } + + /** + * ListByTenantIdNext + * @param nextLink The nextLink from the previous successful call to the ListByTenantId method. + * @param options The options parameters. + */ + private _listByTenantIdNext( + nextLink: string, + options?: EventsListByTenantIdNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listByTenantIdNextOperationSpec + ); + } + + /** + * ListBySingleResourceNext + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource + * type. Currently the API support not nested and one nesting level resource types : + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * and + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param nextLink The nextLink from the previous successful call to the ListBySingleResource method. + * @param options The options parameters. + */ + private _listBySingleResourceNext( + resourceUri: string, + nextLink: string, + options?: EventsListBySingleResourceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, nextLink, options }, + listBySingleResourceNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.queryStartTime + ], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByTenantIdOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceHealth/events", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [ + Parameters.apiVersion, + Parameters.filter, + Parameters.queryStartTime + ], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listBySingleResourceOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.ResourceHealth/events", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.resourceUri], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionIdNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByTenantIdNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; +const listBySingleResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Events + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/impactedResources.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/impactedResources.ts new file mode 100644 index 000000000000..5f2eb6c0aecc --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/impactedResources.ts @@ -0,0 +1,229 @@ +/* + * 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 { ImpactedResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftResourceHealth } from "../microsoftResourceHealth"; +import { + EventImpactedResource, + ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams, + ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams, + ImpactedResourcesListBySubscriptionIdAndEventIdResponse, + ImpactedResourcesGetOptionalParams, + ImpactedResourcesGetResponse, + ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse +} from "../models"; + +/// +/** Class containing ImpactedResources operations. */ +export class ImpactedResourcesImpl implements ImpactedResources { + private readonly client: MicrosoftResourceHealth; + + /** + * Initialize a new instance of the class ImpactedResources class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftResourceHealth) { + this.client = client; + } + + /** + * Lists impacted resources in the subscription by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + public listBySubscriptionIdAndEventId( + eventTrackingId: string, + options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionIdAndEventIdPagingAll( + eventTrackingId, + 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.listBySubscriptionIdAndEventIdPagingPage( + eventTrackingId, + options, + settings + ); + } + }; + } + + private async *listBySubscriptionIdAndEventIdPagingPage( + eventTrackingId: string, + options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ImpactedResourcesListBySubscriptionIdAndEventIdResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscriptionIdAndEventId( + eventTrackingId, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionIdAndEventIdNext( + eventTrackingId, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionIdAndEventIdPagingAll( + eventTrackingId: string, + options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionIdAndEventIdPagingPage( + eventTrackingId, + options + )) { + yield* page; + } + } + + /** + * Lists impacted resources in the subscription by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + private _listBySubscriptionIdAndEventId( + eventTrackingId: string, + options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, options }, + listBySubscriptionIdAndEventIdOperationSpec + ); + } + + /** + * Gets the specific impacted resource in the subscription by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param impactedResourceName Name of the Impacted Resource. + * @param options The options parameters. + */ + get( + eventTrackingId: string, + impactedResourceName: string, + options?: ImpactedResourcesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, impactedResourceName, options }, + getOperationSpec + ); + } + + /** + * ListBySubscriptionIdAndEventIdNext + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param nextLink The nextLink from the previous successful call to the ListBySubscriptionIdAndEventId + * method. + * @param options The options parameters. + */ + private _listBySubscriptionIdAndEventIdNext( + eventTrackingId: string, + nextLink: string, + options?: ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, nextLink, options }, + listBySubscriptionIdAndEventIdNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionIdAndEventIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EventImpactedResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.eventTrackingId + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EventImpactedResource + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.eventTrackingId, + Parameters.impactedResourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionIdAndEventIdNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EventImpactedResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.eventTrackingId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts index 7a0013d72250..395c5eb8e415 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts @@ -7,7 +7,7 @@ */ export * from "./availabilityStatuses"; -export * from "./childAvailabilityStatuses"; -export * from "./childResources"; export * from "./operations"; -export * from "./emergingIssues"; +export * from "./impactedResources"; +export * from "./eventsOperations"; +export * from "./eventOperations"; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/availabilityStatuses.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/availabilityStatuses.ts index 5000227ffff5..525fd86aa5ad 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/availabilityStatuses.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/availabilityStatuses.ts @@ -20,16 +20,14 @@ import { /** Interface representing a AvailabilityStatuses. */ export interface AvailabilityStatuses { /** - * Lists the current availability status for all the resources in the subscription. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the subscription. * @param options The options parameters. */ listBySubscriptionId( options?: AvailabilityStatusesListBySubscriptionIdOptionalParams ): PagedAsyncIterableIterator; /** - * Lists the current availability status for all the resources in the resource group. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the resource group. * @param resourceGroupName The name of the resource group. * @param options The options parameters. */ @@ -38,8 +36,7 @@ export interface AvailabilityStatuses { options?: AvailabilityStatusesListByResourceGroupOptionalParams ): PagedAsyncIterableIterator; /** - * Lists all historical availability transitions and impacting events for a single resource. Use the - * nextLink property in the response to get the next page of availability status + * Lists all historical availability transitions and impacting events for a single resource. * @param resourceUri The fully qualified ID of the resource, including the resource name and resource * type. Currently the API support not nested and one nesting level resource types : * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childAvailabilityStatuses.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childAvailabilityStatuses.ts deleted file mode 100644 index d296779a9ed1..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childAvailabilityStatuses.ts +++ /dev/null @@ -1,43 +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 { - AvailabilityStatus, - ChildAvailabilityStatusesListOptionalParams, - ChildAvailabilityStatusesGetByResourceOptionalParams, - ChildAvailabilityStatusesGetByResourceResponse -} from "../models"; - -/// -/** Interface representing a ChildAvailabilityStatuses. */ -export interface ChildAvailabilityStatuses { - /** - * Lists the historical availability statuses for a single child resource. Use the nextLink property in - * the response to get the next page of availability status - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets current availability status for a single resource - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - getByResource( - resourceUri: string, - options?: ChildAvailabilityStatusesGetByResourceOptionalParams - ): Promise; -} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childResources.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childResources.ts deleted file mode 100644 index 330611cfd82a..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childResources.ts +++ /dev/null @@ -1,30 +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 { - AvailabilityStatus, - ChildResourcesListOptionalParams -} from "../models"; - -/// -/** Interface representing a ChildResources. */ -export interface ChildResources { - /** - * Lists the all the children and its current health status for a parent resource. Use the nextLink - * property in the response to get the next page of children current health - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts deleted file mode 100644 index b059382f09f3..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts +++ /dev/null @@ -1,34 +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 { - EmergingIssuesGetResult, - EmergingIssuesListOptionalParams, - EmergingIssuesGetOptionalParams, - EmergingIssuesGetResponse -} from "../models"; - -/// -/** Interface representing a EmergingIssues. */ -export interface EmergingIssues { - /** - * Lists Azure services' emerging issues. - * @param options The options parameters. - */ - list( - options?: EmergingIssuesListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets Azure services' emerging issues. - * @param options The options parameters. - */ - get( - options?: EmergingIssuesGetOptionalParams - ): Promise; -} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/eventOperations.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/eventOperations.ts new file mode 100644 index 000000000000..163e4bc2bad1 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/eventOperations.ts @@ -0,0 +1,36 @@ +/* + * 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 { + EventGetBySubscriptionIdAndTrackingIdOptionalParams, + EventGetBySubscriptionIdAndTrackingIdResponse, + EventGetByTenantIdAndTrackingIdOptionalParams, + EventGetByTenantIdAndTrackingIdResponse +} from "../models"; + +/** Interface representing a EventOperations. */ +export interface EventOperations { + /** + * Service health event in the subscription by event tracking id + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + getBySubscriptionIdAndTrackingId( + eventTrackingId: string, + options?: EventGetBySubscriptionIdAndTrackingIdOptionalParams + ): Promise; + /** + * Service health event in the tenant by event tracking id + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + getByTenantIdAndTrackingId( + eventTrackingId: string, + options?: EventGetByTenantIdAndTrackingIdOptionalParams + ): Promise; +} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/eventsOperations.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/eventsOperations.ts new file mode 100644 index 000000000000..e1cb1b67c184 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/eventsOperations.ts @@ -0,0 +1,47 @@ +/* + * 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 { + Event, + EventsListBySubscriptionIdOptionalParams, + EventsListByTenantIdOptionalParams, + EventsListBySingleResourceOptionalParams +} from "../models"; + +/// +/** Interface representing a EventsOperations. */ +export interface EventsOperations { + /** + * Lists service health events in the subscription. + * @param options The options parameters. + */ + listBySubscriptionId( + options?: EventsListBySubscriptionIdOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists current service health events in the tenant. + * @param options The options parameters. + */ + listByTenantId( + options?: EventsListByTenantIdOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists current service health events for given resource. + * @param resourceUri The fully qualified ID of the resource, including the resource name and resource + * type. Currently the API support not nested and one nesting level resource types : + * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} + * and + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} + * @param options The options parameters. + */ + listBySingleResource( + resourceUri: string, + options?: EventsListBySingleResourceOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/impactedResources.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/impactedResources.ts new file mode 100644 index 000000000000..64b5db35c7e3 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/impactedResources.ts @@ -0,0 +1,40 @@ +/* + * 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 { + EventImpactedResource, + ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams, + ImpactedResourcesGetOptionalParams, + ImpactedResourcesGetResponse +} from "../models"; + +/// +/** Interface representing a ImpactedResources. */ +export interface ImpactedResources { + /** + * Lists impacted resources in the subscription by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + listBySubscriptionIdAndEventId( + eventTrackingId: string, + options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the specific impacted resource in the subscription by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param impactedResourceName Name of the Impacted Resource. + * @param options The options parameters. + */ + get( + eventTrackingId: string, + impactedResourceName: string, + options?: ImpactedResourcesGetOptionalParams + ): Promise; +} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts index 7a0013d72250..395c5eb8e415 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts @@ -7,7 +7,7 @@ */ export * from "./availabilityStatuses"; -export * from "./childAvailabilityStatuses"; -export * from "./childResources"; export * from "./operations"; -export * from "./emergingIssues"; +export * from "./impactedResources"; +export * from "./eventsOperations"; +export * from "./eventOperations"; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/pagingHelper.ts b/sdk/resourcehealth/arm-resourcehealth/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * 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 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) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/resourcehealth/arm-resourcehealth/tsconfig.json b/sdk/resourcehealth/arm-resourcehealth/tsconfig.json index 8db259768606..3e6ae96443f3 100644 --- a/sdk/resourcehealth/arm-resourcehealth/tsconfig.json +++ b/sdk/resourcehealth/arm-resourcehealth/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-resourcehealth": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"