diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 84d91e0ecae0..afa7c5d081d8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -734,6 +734,7 @@ packages: /@azure/ai-form-recognizer/3.1.0-beta.3: resolution: {integrity: sha512-+4QtFKNyxAmdqpcYjuAtmWKm/MuOe9kZsbpS9jA9h0YHzngNj5gc67AA4egV9BXOq9x+1phjYTNC/rxiOUr1uQ==} engines: {node: '>=8.0.0'} + deprecated: Please migrate to a supported (non-beta) version of this package dependencies: '@azure/core-auth': 1.4.0 '@azure/core-http': 1.2.6 @@ -4035,7 +4036,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230327 + typescript: 5.1.0-dev.20230329 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8677,37 +8678,6 @@ packages: hasBin: true dev: false - /ts-node/10.9.1_cda5npvz5vidcibznbsxxfupne: - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.9 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.3 - '@types/node': 14.18.41 - acorn: 8.8.2 - acorn-walk: 8.2.0 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.0.2 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: false - /ts-node/10.9.1_ksn4eycaeggbrckn3ykh37hwf4: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -8913,8 +8883,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230327: - resolution: {integrity: sha512-tzeS6vmUF8qC4zFdvos88Oer1oNVrg0CVlIaxfI//pDrq8rur4nIUTLRWRlEMCeLQporHhD+z9sESoSr5GL+lw==} + /typescript/5.1.0-dev.20230329: + resolution: {integrity: sha512-X8tsIMYvdc0uI4lkvJ6cUblH2ut06J4fkDDuIi5oDlpugnPGxB0iHm7i3nQPgSic7XGxUpp5SzUXD7G4PmhGJQ==} engines: {node: '>=12.20'} hasBin: true dev: false @@ -14409,7 +14379,7 @@ packages: dev: false file:projects/arm-resourcehealth.tgz: - resolution: {integrity: sha512-S6Vpa2sOkOtF6fjBv0pH5RSUoQHbzGKcefgzd6tjXdAvg2hnHVrV/NO81P1W0YblL3RR6W6FZQ80w3js+dMbxg==, tarball: file:projects/arm-resourcehealth.tgz} + resolution: {integrity: sha512-b99D71Jj6qrUgnv0AOCIUpjJE+2Rc7JZH1PQra8RjQ9JOpNRfP+hMwHohd96CYF3hDPfK+J/FDePo7agzPUO4g==, tarball: file:projects/arm-resourcehealth.tgz} name: '@rush-temp/arm-resourcehealth' version: 0.0.0 dependencies: @@ -14423,8 +14393,8 @@ packages: '@types/node': 14.18.41 chai: 4.3.7 cross-env: 7.0.3 - dotenv: 8.6.0 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -16704,7 +16674,7 @@ packages: dev: false file:projects/core-rest-pipeline.tgz: - resolution: {integrity: sha512-llk8IsKEpNaxkyK8gANqZiczBNJ8RfAtGYI9F1YeHtwu0FBmm0LBCbCNOxozYwCxcICfEI88IrbiYXsWbVZsPA==, tarball: file:projects/core-rest-pipeline.tgz} + resolution: {integrity: sha512-OHJWAPHdYuqTx4z66T38yznxJf1rMZmYWLXXfoV5pL0EQsCRdQEF2LVf0RshE2k8NWVDOjjmo+LgfhNAePfwZg==, tarball: file:projects/core-rest-pipeline.tgz} name: '@rush-temp/core-rest-pipeline' version: 0.0.0 dependencies: @@ -17018,7 +16988,7 @@ packages: rollup-plugin-sourcemaps: 0.6.3_qg36w4uagpty5et2swcu4ykn64 rollup-plugin-visualizer: 5.9.0_rollup@2.79.1 semver: 7.3.8 - ts-node: 10.9.1_cda5npvz5vidcibznbsxxfupne + ts-node: 10.9.1_rwcdhhaqkims6irrp2ypnntvry tslib: 2.5.0 typescript: 4.8.4 yaml: 1.10.2 diff --git a/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md index 814b9d872b67..c3a0112dda2d 100644 --- a/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md +++ b/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md @@ -1,15 +1,120 @@ # Release History + +## 4.0.0-beta.1 (2023-03-29) + +**Features** -## 3.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group EventOperations + - Added operation group EventsOperations + - Added operation group ImpactedResources + - Added operation group Metadata + - Added operation group SecurityAdvisoryImpactedResources + - Added Interface AvailabilityStatusPropertiesRecentlyResolved + - Added Interface Event_2 + - Added Interface EventFetchDetailsBySubscriptionIdAndTrackingIdOptionalParams + - Added Interface EventFetchDetailsByTenantIdAndTrackingIdOptionalParams + - 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 ImpactedResourcesGetByTenantIdOptionalParams + - Added Interface ImpactedResourcesGetOptionalParams + - Added Interface ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams + - Added Interface ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + - Added Interface ImpactedResourcesListByTenantIdAndEventIdNextOptionalParams + - Added Interface ImpactedResourcesListByTenantIdAndEventIdOptionalParams + - Added Interface ImpactedResourceStatus + - Added Interface ImpactedServiceRegion + - Added Interface KeyValueItem + - Added Interface Link + - Added Interface LinkDisplayText + - Added Interface MetadataEntity + - Added Interface MetadataEntityListResult + - Added Interface MetadataGetEntityOptionalParams + - Added Interface MetadataListNextOptionalParams + - Added Interface MetadataListOptionalParams + - Added Interface MetadataSupportedValueDetail + - Added Interface ProxyResource + - Added Interface SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams + - Added Interface SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + - Added Interface SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextOptionalParams + - Added Interface SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams + - Added Interface SystemData + - Added Interface Update + - Added Type Alias CreatedByType + - Added Type Alias EventFetchDetailsBySubscriptionIdAndTrackingIdResponse + - Added Type Alias EventFetchDetailsByTenantIdAndTrackingIdResponse + - 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 ImpactedResourcesGetByTenantIdResponse + - Added Type Alias ImpactedResourcesGetResponse + - Added Type Alias ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse + - Added Type Alias ImpactedResourcesListBySubscriptionIdAndEventIdResponse + - Added Type Alias ImpactedResourcesListByTenantIdAndEventIdNextResponse + - Added Type Alias ImpactedResourcesListByTenantIdAndEventIdResponse + - Added Type Alias IssueNameParameter + - Added Type Alias LevelValues + - Added Type Alias LinkTypeValues + - Added Type Alias MetadataGetEntityResponse + - Added Type Alias MetadataListNextResponse + - Added Type Alias MetadataListResponse + - Added Type Alias ReasonTypeValues + - Added Type Alias Scenario + - Added Type Alias SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextResponse + - Added Type Alias SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdResponse + - Added Type Alias SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextResponse + - Added Type Alias SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdResponse + - Interface AvailabilityStatusProperties has a new optional parameter category + - Interface AvailabilityStatusProperties has a new optional parameter context + - Interface AvailabilityStatusProperties has a new optional parameter recentlyResolved + - Interface AvailabilityStatusProperties has a new optional parameter title + - Interface Resource has a new optional parameter systemData + - Added Enum KnownAvailabilityStateValues + - Added Enum KnownCreatedByType + - Added Enum KnownEventLevelValues + - Added Enum KnownEventSourceValues + - Added Enum KnownEventStatusValues + - Added Enum KnownEventTypeValues + - Added Enum KnownIssueNameParameter + - Added Enum KnownLevelValues + - Added Enum KnownLinkTypeValues + - Added Enum KnownReasonChronicityTypes + - Added Enum KnownReasonTypeValues + - Added Enum KnownScenario -### Other Changes +**Breaking Changes** + - Removed operation group ChildAvailabilityStatuses + - Removed operation group ChildResources + - Operation EmergingIssues.get has a new signature + - Interface AvailabilityStatusProperties no longer has parameter recentlyResolvedState + - Class MicrosoftResourceHealth no longer has parameter childAvailabilityStatuses + - Class MicrosoftResourceHealth no longer has parameter childResources + + ## 3.2.0 (2023-02-01) **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 f2f16b84fe38..c181b8ea21c1 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.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resourcehealth\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", + "commit": "bc573342663fc1fafbb3cdc4fad0a5fd7ca807ed", + "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.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.0", - "use": "@autorest/typescript@6.0.0-rc.7" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/resourcehealth/arm-resourcehealth/package.json b/sdk/resourcehealth/arm-resourcehealth/package.json index 1177719fb2fb..cc515f81de22 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.2.1", + "version": "4.0.0-beta.1", "engines": { "node": ">=14.0.0" }, "dependencies": { "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -31,13 +31,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", - "dotenv": "^8.2.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -109,13 +109,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcehealth/arm-resourcehealth", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resourcehealth?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcehealth/arm-resourcehealth" +} \ 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 5824d2b1288c..f404209f0667 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 { @@ -94,6 +94,8 @@ export interface AvailabilityStatusListResult { // @public export interface AvailabilityStatusProperties { availabilityState?: AvailabilityStateValues; + category?: string; + context?: string; detailedStatus?: string; healthEventCategory?: string; healthEventCause?: string; @@ -102,137 +104,444 @@ 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 EmergingIssueImpact { + id?: string; + name?: string; + regions?: ImpactedRegion[]; } // @public -export interface ChildAvailabilityStatusesGetByResourceOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; +export interface EmergingIssueListResult { + nextLink?: string; + value?: EmergingIssuesGetResult[]; } // @public -export type ChildAvailabilityStatusesGetByResourceResponse = AvailabilityStatus; +export interface EmergingIssues { + get(issueName: IssueNameParameter, options?: EmergingIssuesGetOptionalParams): Promise; + list(options?: EmergingIssuesListOptionalParams): PagedAsyncIterableIterator; +} // @public -export interface ChildAvailabilityStatusesListNextOptionalParams extends coreClient.OperationOptions { +export interface EmergingIssuesGetOptionalParams extends coreClient.OperationOptions { } // @public -export type ChildAvailabilityStatusesListNextResponse = AvailabilityStatusListResult; +export type EmergingIssuesGetResponse = EmergingIssuesGetResult; // @public -export interface ChildAvailabilityStatusesListOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; +export interface EmergingIssuesGetResult extends Resource { + refreshTimestamp?: Date; + statusActiveEvents?: StatusActiveEvent[]; + statusBanners?: StatusBanner[]; +} + +// @public +export interface EmergingIssuesListNextOptionalParams extends coreClient.OperationOptions { } // @public -export type ChildAvailabilityStatusesListResponse = AvailabilityStatusListResult; +export type EmergingIssuesListNextResponse = EmergingIssueListResult; // @public -export interface ChildResources { - list(resourceUri: string, options?: ChildResourcesListOptionalParams): PagedAsyncIterableIterator; +export interface EmergingIssuesListOptionalParams extends coreClient.OperationOptions { } // @public -export interface ChildResourcesListNextOptionalParams extends coreClient.OperationOptions { +export type EmergingIssuesListResponse = EmergingIssueListResult; + +// @public +export interface ErrorResponse { + readonly code?: string; + readonly details?: string; + readonly message?: string; } // @public -export type ChildResourcesListNextResponse = AvailabilityStatusListResult; +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 ChildResourcesListOptionalParams extends coreClient.OperationOptions { - expand?: string; +export interface EventFetchDetailsBySubscriptionIdAndTrackingIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventFetchDetailsBySubscriptionIdAndTrackingIdResponse = Event_2; + +// @public +export interface EventFetchDetailsByTenantIdAndTrackingIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventFetchDetailsByTenantIdAndTrackingIdResponse = Event_2; + +// @public +export interface EventGetBySubscriptionIdAndTrackingIdOptionalParams extends coreClient.OperationOptions { filter?: string; + queryStartTime?: string; } // @public -export type ChildResourcesListResponse = AvailabilityStatusListResult; +export type EventGetBySubscriptionIdAndTrackingIdResponse = Event_2; // @public -export interface EmergingIssueImpact { - id?: string; - name?: string; - regions?: ImpactedRegion[]; +export interface EventGetByTenantIdAndTrackingIdOptionalParams extends coreClient.OperationOptions { + filter?: string; + queryStartTime?: string; } // @public -export interface EmergingIssueListResult { +export type EventGetByTenantIdAndTrackingIdResponse = Event_2; + +// @public +export interface EventImpactedResource extends ProxyResource { + info?: KeyValueItem[]; + readonly targetRegion?: string; + readonly targetResourceId?: string; + readonly targetResourceType?: string; +} + +// @public +export interface EventImpactedResourceListResult { nextLink?: string; - value?: EmergingIssuesGetResult[]; + value: EventImpactedResource[]; } // @public -export interface EmergingIssues { - get(options?: EmergingIssuesGetOptionalParams): Promise; - list(options?: EmergingIssuesListOptionalParams): PagedAsyncIterableIterator; +export type EventLevelValues = string; + +// @public +export interface EventOperations { + fetchDetailsBySubscriptionIdAndTrackingId(eventTrackingId: string, options?: EventFetchDetailsBySubscriptionIdAndTrackingIdOptionalParams): Promise; + fetchDetailsByTenantIdAndTrackingId(eventTrackingId: string, options?: EventFetchDetailsByTenantIdAndTrackingIdOptionalParams): Promise; + getBySubscriptionIdAndTrackingId(eventTrackingId: string, options?: EventGetBySubscriptionIdAndTrackingIdOptionalParams): Promise; + getByTenantIdAndTrackingId(eventTrackingId: string, options?: EventGetByTenantIdAndTrackingIdOptionalParams): Promise; } // @public -export interface EmergingIssuesGetOptionalParams extends coreClient.OperationOptions { +export interface EventPropertiesAdditionalInformation { + message?: string; } // @public -export type EmergingIssuesGetResponse = EmergingIssuesGetResult; +export interface EventPropertiesArticle { + articleContent?: string; +} // @public -export interface EmergingIssuesGetResult extends Resource { - refreshTimestamp?: Date; - statusActiveEvents?: StatusActiveEvent[]; - statusBanners?: StatusBanner[]; +export interface EventPropertiesRecommendedActions { + actions?: EventPropertiesRecommendedActionsItem[]; + localeCode?: string; + message?: string; } // @public -export interface EmergingIssuesListNextOptionalParams extends coreClient.OperationOptions { +export interface EventPropertiesRecommendedActionsItem { + actionText?: string; + groupId?: number; } // @public -export type EmergingIssuesListNextResponse = EmergingIssueListResult; +export interface Events { + nextLink?: string; + value: Event_2[]; +} // @public -export interface EmergingIssuesListOptionalParams extends coreClient.OperationOptions { +export interface EventsListBySingleResourceNextOptionalParams extends coreClient.OperationOptions { } // @public -export type EmergingIssuesListResponse = EmergingIssueListResult; +export type EventsListBySingleResourceNextResponse = Events; // @public -export interface ErrorResponse { - readonly code?: string; - readonly details?: string; - readonly message?: string; +export interface EventsListBySingleResourceOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type EventsListBySingleResourceResponse = Events; + +// @public +export interface EventsListBySubscriptionIdNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EventsListBySubscriptionIdNextResponse = Events; + +// @public +export interface EventsListBySubscriptionIdOptionalParams extends coreClient.OperationOptions { + filter?: string; + queryStartTime?: string; +} + +// @public +export type EventsListBySubscriptionIdResponse = Events; + +// @public +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 function getContinuationToken(page: unknown): string | undefined; +// @public +export interface Impact { + impactedRegions?: ImpactedServiceRegion[]; + impactedService?: string; +} + // @public export interface ImpactedRegion { id?: string; name?: string; } +// @public +export interface ImpactedResources { + get(eventTrackingId: string, impactedResourceName: string, options?: ImpactedResourcesGetOptionalParams): Promise; + getByTenantId(eventTrackingId: string, impactedResourceName: string, options?: ImpactedResourcesGetByTenantIdOptionalParams): Promise; + listBySubscriptionIdAndEventId(eventTrackingId: string, options?: ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams): PagedAsyncIterableIterator; + listByTenantIdAndEventId(eventTrackingId: string, options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ImpactedResourcesGetByTenantIdOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImpactedResourcesGetByTenantIdResponse = EventImpactedResource; + +// @public +export interface ImpactedResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImpactedResourcesGetResponse = EventImpactedResource; + +// @public +export interface ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse = EventImpactedResourceListResult; + +// @public +export interface ImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ImpactedResourcesListBySubscriptionIdAndEventIdResponse = EventImpactedResourceListResult; + +// @public +export interface ImpactedResourcesListByTenantIdAndEventIdNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ImpactedResourcesListByTenantIdAndEventIdNextResponse = EventImpactedResourceListResult; + +// @public +export interface ImpactedResourcesListByTenantIdAndEventIdOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type ImpactedResourcesListByTenantIdAndEventIdResponse = EventImpactedResourceListResult; + +// @public +export interface ImpactedResourceStatus extends ProxyResource { + availabilityState?: AvailabilityStateValues; + occurredTime?: Date; + reasonType?: ReasonTypeValues; + summary?: string; + title?: string; +} + +// @public +export interface ImpactedServiceRegion { + impactedRegion?: string; + impactedSubscriptions?: string[]; + impactedTenants?: string[]; + lastUpdateTime?: Date; + status?: EventStatusValues; + updates?: Update[]; +} + +// @public +export type IssueNameParameter = string; + +// @public +export interface KeyValueItem { + readonly key?: string; + readonly value?: string; +} + +// @public +export enum KnownAvailabilityStateValues { + Available = "Available", + Degraded = "Degraded", + Unavailable = "Unavailable", + Unknown = "Unknown" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownEventLevelValues { + Critical = "Critical", + Error = "Error", + Informational = "Informational", + Warning = "Warning" +} + +// @public +export enum KnownEventSourceValues { + ResourceHealth = "ResourceHealth", + ServiceHealth = "ServiceHealth" +} + +// @public +export enum KnownEventStatusValues { + Active = "Active", + Resolved = "Resolved" +} + +// @public +export enum KnownEventTypeValues { + EmergingIssues = "EmergingIssues", + HealthAdvisory = "HealthAdvisory", + PlannedMaintenance = "PlannedMaintenance", + RCA = "RCA", + SecurityAdvisory = "SecurityAdvisory", + ServiceIssue = "ServiceIssue" +} + +// @public +export enum KnownIssueNameParameter { + Default = "default" +} + +// @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 enum KnownScenario { + Alerts = "Alerts" +} + // @public export enum KnownSeverityValues { Error = "Error", @@ -247,6 +556,75 @@ export enum KnownStageValues { Resolve = "Resolve" } +// @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 +export interface Metadata { + getEntity(name: string, options?: MetadataGetEntityOptionalParams): Promise; + list(options?: MetadataListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MetadataEntity extends ProxyResource { + applicableScenarios?: Scenario[]; + dependsOn?: string[]; + displayName?: string; + supportedValues?: MetadataSupportedValueDetail[]; +} + +// @public +export interface MetadataEntityListResult { + nextLink?: string; + value?: MetadataEntity[]; +} + +// @public +export interface MetadataGetEntityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetadataGetEntityResponse = MetadataEntity; + +// @public +export interface MetadataListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetadataListNextResponse = MetadataEntityListResult; + +// @public +export interface MetadataListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetadataListResponse = MetadataEntityListResult; + +// @public +export interface MetadataSupportedValueDetail { + displayName?: string; + id?: string; + resourceTypes?: string[]; +} + // @public (undocumented) export class MicrosoftResourceHealth extends coreClient.ServiceClient { // (undocumented) @@ -257,14 +635,20 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { // (undocumented) availabilityStatuses: AvailabilityStatuses; // (undocumented) - childAvailabilityStatuses: ChildAvailabilityStatuses; + emergingIssues: EmergingIssues; // (undocumented) - childResources: ChildResources; + eventOperations: EventOperations; // (undocumented) - emergingIssues: EmergingIssues; + eventsOperations: EventsOperations; + // (undocumented) + impactedResources: ImpactedResources; + // (undocumented) + metadata: Metadata; // (undocumented) operations: Operations; // (undocumented) + securityAdvisoryImpactedResources: SecurityAdvisoryImpactedResources; + // (undocumented) subscriptionId: string; } @@ -307,7 +691,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 { @@ -320,9 +711,49 @@ export interface RecommendedAction { export interface Resource { readonly id?: string; readonly name?: string; + readonly systemData?: SystemData; readonly type?: string; } +// @public +export type Scenario = string; + +// @public +export interface SecurityAdvisoryImpactedResources { + listBySubscriptionIdAndEventId(eventTrackingId: string, options?: SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams): PagedAsyncIterableIterator; + listByTenantIdAndEventId(eventTrackingId: string, options?: SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextResponse = EventImpactedResourceListResult; + +// @public +export interface SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdResponse = EventImpactedResourceListResult; + +// @public +export interface SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextResponse = EventImpactedResourceListResult; + +// @public +export interface SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdResponse = EventImpactedResourceListResult; + // @public export interface ServiceImpactingEvent { correlationId?: string; @@ -373,6 +804,22 @@ export interface StatusBanner { title?: string; } +// @public +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/microsoftResourceHealth.ts b/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts index 4f595976f7ee..95e208faaa81 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts @@ -16,16 +16,22 @@ import { import * as coreAuth from "@azure/core-auth"; import { AvailabilityStatusesImpl, - ChildAvailabilityStatusesImpl, - ChildResourcesImpl, OperationsImpl, + MetadataImpl, + ImpactedResourcesImpl, + SecurityAdvisoryImpactedResourcesImpl, + EventsOperationsImpl, + EventOperationsImpl, EmergingIssuesImpl } from "./operations"; import { AvailabilityStatuses, - ChildAvailabilityStatuses, - ChildResources, Operations, + Metadata, + ImpactedResources, + SecurityAdvisoryImpactedResources, + EventsOperations, + EventOperations, EmergingIssues } from "./operationsInterfaces"; import { MicrosoftResourceHealthOptionalParams } from "./models"; @@ -38,8 +44,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,7 +68,7 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resourcehealth/3.2.1`; + const packageDetails = `azsdk-js-arm-resourcehealth/4.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -116,11 +121,16 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { // 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.metadata = new MetadataImpl(this); + this.impactedResources = new ImpactedResourcesImpl(this); + this.securityAdvisoryImpactedResources = new SecurityAdvisoryImpactedResourcesImpl( + this + ); + this.eventsOperations = new EventsOperationsImpl(this); + this.eventOperations = new EventOperationsImpl(this); this.emergingIssues = new EmergingIssuesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -154,8 +164,11 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { } availabilityStatuses: AvailabilityStatuses; - childAvailabilityStatuses: ChildAvailabilityStatuses; - childResources: ChildResources; operations: Operations; + metadata: Metadata; + impactedResources: ImpactedResources; + securityAdvisoryImpactedResources: SecurityAdvisoryImpactedResources; + eventsOperations: EventsOperations; + eventOperations: EventOperations; emergingIssues: EmergingIssues; } diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts index a7723b880144..e4156efe6a84 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts @@ -34,12 +34,18 @@ 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. */ detailedStatus?: string; /** When the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. */ reasonType?: string; + /** When an event is created, it can either be triggered by a customer or the platform of the resource and this field will illustrate that. This field is connected to the category field in this object. */ + context?: string; + /** When a context field is set to Platform, this field will reflect if the event was planned or unplanned. If the context field does not have a value of Platform, then this field will be ignored. */ + category?: string; /** When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. */ rootCauseAttributionTime?: Date; /** In case of an availability impacting event, it describes when the health impacting event was originated. Examples are Lifecycle, Downtime, Fault Analysis etc. */ @@ -59,7 +65,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 +73,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 +169,196 @@ export interface OperationDisplay { description?: string; } +/** The list of metadata entities */ +export interface MetadataEntityListResult { + /** The list of metadata entities. */ + value?: MetadataEntity[]; + /** The link used to get the next page of metadata. */ + nextLink?: string; +} + +/** The metadata supported value detail. */ +export interface MetadataSupportedValueDetail { + /** The id. */ + id?: string; + /** The display name. */ + displayName?: string; + /** The list of associated resource types. */ + resourceTypes?: 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 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; +} + +/** 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; +} + +/** 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; +} + /** Banner type of emerging issue. */ export interface StatusBanner { /** The banner title. */ @@ -217,43 +413,331 @@ 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 {} + +/** 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[]; +} + +/** The metadata entity contract. */ +export interface MetadataEntity extends ProxyResource { + /** The display name. */ + displayName?: string; + /** The list of keys on which this entity depends on. */ + dependsOn?: string[]; + /** The list of scenarios applicable to this metadata entity. */ + applicableScenarios?: Scenario[]; + /** The list of supported values. */ + supportedValues?: MetadataSupportedValueDetail[]; +} + +/** 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[]; } -/** 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; +/** 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; } -/** 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[]; +/** 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; +} + +/** Known values of {@link AvailabilityStateValues} that the service accepts. */ +export enum KnownAvailabilityStateValues { + /** Available */ + Available = "Available", + /** Unavailable */ + Unavailable = "Unavailable", + /** Degraded */ + Degraded = "Degraded", + /** Unknown */ + Unknown = "Unknown" +} + +/** + * 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" +} + +/** + * 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 Scenario} that the service accepts. */ +export enum KnownScenario { + /** Alerts */ + Alerts = "Alerts" +} + +/** + * Defines values for Scenario. \ + * {@link KnownScenario} can be used interchangeably with Scenario, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Alerts** + */ +export type Scenario = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** 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 EventSourceValues = string; + +/** Known values of {@link EventStatusValues} that the service accepts. */ +export enum KnownEventStatusValues { + /** Active */ + Active = "Active", + /** Resolved */ + Resolved = "Resolved" } +/** + * 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** \ + * **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 LinkTypeValues = string; + /** Known values of {@link SeverityValues} that the service accepts. */ export enum KnownSeverityValues { /** Information */ @@ -295,10 +779,42 @@ export enum KnownStageValues { * **Archived** */ export type StageValues = string; -/** Defines values for AvailabilityStateValues. */ -export type AvailabilityStateValues = "Available" | "Unavailable" | "Unknown"; -/** Defines values for ReasonChronicityTypes. */ -export type ReasonChronicityTypes = "Transient" | "Persistent"; + +/** Known values of {@link IssueNameParameter} that the service accepts. */ +export enum KnownIssueNameParameter { + /** Default */ + Default = "default" +} + +/** + * Defines values for IssueNameParameter. \ + * {@link KnownIssueNameParameter} can be used interchangeably with IssueNameParameter, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **default** + */ +export type IssueNameParameter = 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 @@ -370,68 +886,207 @@ export interface AvailabilityStatusesListNextOptionalParams export type AvailabilityStatusesListNextResponse = AvailabilityStatusListResult; /** Optional parameters. */ -export interface ChildAvailabilityStatusesGetByResourceOptionalParams +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface MetadataListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type MetadataListResponse = MetadataEntityListResult; + +/** Optional parameters. */ +export interface MetadataGetEntityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getEntity operation. */ +export type MetadataGetEntityResponse = MetadataEntity; + +/** Optional parameters. */ +export interface MetadataListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type MetadataListNextResponse = MetadataEntityListResult; + +/** Optional parameters. */ +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 getByResource operation. */ -export type ChildAvailabilityStatusesGetByResourceResponse = AvailabilityStatus; +/** Contains response data for the listBySubscriptionIdAndEventId operation. */ +export type ImpactedResourcesListBySubscriptionIdAndEventIdResponse = EventImpactedResourceListResult; + +/** Optional parameters. */ +export interface ImpactedResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ImpactedResourcesGetResponse = EventImpactedResource; /** Optional parameters. */ -export interface ChildAvailabilityStatusesListOptionalParams +export interface ImpactedResourcesListByTenantIdAndEventIdOptionalParams 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 listByTenantIdAndEventId operation. */ +export type ImpactedResourcesListByTenantIdAndEventIdResponse = EventImpactedResourceListResult; /** Optional parameters. */ -export interface ChildAvailabilityStatusesListNextOptionalParams +export interface ImpactedResourcesGetByTenantIdOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type ChildAvailabilityStatusesListNextResponse = AvailabilityStatusListResult; +/** Contains response data for the getByTenantId operation. */ +export type ImpactedResourcesGetByTenantIdResponse = EventImpactedResource; + +/** Optional parameters. */ +export interface ImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionIdAndEventIdNext operation. */ +export type ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse = EventImpactedResourceListResult; + +/** Optional parameters. */ +export interface ImpactedResourcesListByTenantIdAndEventIdNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByTenantIdAndEventIdNext operation. */ +export type ImpactedResourcesListByTenantIdAndEventIdNextResponse = EventImpactedResourceListResult; /** Optional parameters. */ -export interface ChildResourcesListOptionalParams +export interface SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams 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 ChildResourcesListResponse = AvailabilityStatusListResult; +/** Contains response data for the listBySubscriptionIdAndEventId operation. */ +export type SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdResponse = EventImpactedResourceListResult; /** Optional parameters. */ -export interface ChildResourcesListNextOptionalParams +export interface SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams + 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; +} + +/** Contains response data for the listByTenantIdAndEventId operation. */ +export type SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdResponse = EventImpactedResourceListResult; + +/** Optional parameters. */ +export interface SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type ChildResourcesListNextResponse = AvailabilityStatusListResult; +/** Contains response data for the listBySubscriptionIdAndEventIdNext operation. */ +export type SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextResponse = EventImpactedResourceListResult; /** Optional parameters. */ -export interface OperationsListOptionalParams +export interface SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; +/** Contains response data for the listByTenantIdAndEventIdNext operation. */ +export type SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextResponse = EventImpactedResourceListResult; /** Optional parameters. */ -export interface EmergingIssuesGetOptionalParams +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; + /** 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 listBySubscriptionId operation. */ +export type EventsListBySubscriptionIdResponse = Events; + +/** Optional parameters. */ +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; + /** 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 listByTenantId operation. */ +export type EventsListByTenantIdResponse = Events; + +/** Optional parameters. */ +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; +} + +/** Contains response data for the listBySingleResource operation. */ +export type EventsListBySingleResourceResponse = Events; + +/** Optional parameters. */ +export interface EventsListBySubscriptionIdNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type EmergingIssuesGetResponse = EmergingIssuesGetResult; +/** Contains response data for the listBySubscriptionIdNext operation. */ +export type EventsListBySubscriptionIdNextResponse = Events; + +/** Optional parameters. */ +export interface EventsListByTenantIdNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByTenantIdNext operation. */ +export type EventsListByTenantIdNextResponse = Events; + +/** Optional parameters. */ +export interface EventsListBySingleResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySingleResourceNext operation. */ +export type EventsListBySingleResourceNextResponse = Events; + +/** Optional parameters. */ +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 getBySubscriptionIdAndTrackingId operation. */ +export type EventGetBySubscriptionIdAndTrackingIdResponse = Event; + +/** Optional parameters. */ +export interface EventFetchDetailsBySubscriptionIdAndTrackingIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the fetchDetailsBySubscriptionIdAndTrackingId operation. */ +export type EventFetchDetailsBySubscriptionIdAndTrackingIdResponse = 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 EventFetchDetailsByTenantIdAndTrackingIdOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the fetchDetailsByTenantIdAndTrackingId operation. */ +export type EventFetchDetailsByTenantIdAndTrackingIdResponse = Event; /** Optional parameters. */ export interface EmergingIssuesListOptionalParams @@ -440,6 +1095,13 @@ export interface EmergingIssuesListOptionalParams /** Contains response data for the list operation. */ export type EmergingIssuesListResponse = EmergingIssueListResult; +/** Optional parameters. */ +export interface EmergingIssuesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type EmergingIssuesGetResponse = EmergingIssuesGetResult; + /** Optional parameters. */ export interface EmergingIssuesListNextOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts index 6ae4eaf92675..ae3933574ee9 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: { @@ -106,6 +111,18 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { name: "String" } }, + context: { + serializedName: "context", + type: { + name: "String" + } + }, + category: { + serializedName: "category", + type: { + name: "String" + } + }, rootCauseAttributionTime: { serializedName: "rootCauseAttributionTime", type: { @@ -151,8 +168,7 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { reasonChronicity: { serializedName: "reasonChronicity", type: { - name: "Enum", - allowedValues: ["Transient", "Persistent"] + name: "String" } }, reportedTime: { @@ -161,11 +177,11 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { name: "DateTime" } }, - recentlyResolvedState: { - serializedName: "recentlyResolvedState", + recentlyResolved: { + serializedName: "recentlyResolved", type: { name: "Composite", - className: "AvailabilityStatusPropertiesRecentlyResolvedState" + className: "AvailabilityStatusPropertiesRecentlyResolved" } }, recommendedActions: { @@ -196,13 +212,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 +229,8 @@ export const AvailabilityStatusPropertiesRecentlyResolvedState: coreClient.Compo name: "DateTime" } }, - unavailabilitySummary: { - serializedName: "unavailabilitySummary", + unavailableSummary: { + serializedName: "unavailableSummary", type: { name: "String" } @@ -446,160 +462,233 @@ export const OperationDisplay: coreClient.CompositeMapper = { } }; -export const StatusBanner: coreClient.CompositeMapper = { +export const MetadataEntityListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StatusBanner", + className: "MetadataEntityListResult", modelProperties: { - title: { - serializedName: "title", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetadataEntity" + } + } } }, - message: { - serializedName: "message", + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const MetadataSupportedValueDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetadataSupportedValueDetail", + modelProperties: { + id: { + serializedName: "id", type: { name: "String" } }, - cloud: { - serializedName: "cloud", + displayName: { + serializedName: "displayName", type: { name: "String" } }, - lastModifiedTime: { - serializedName: "lastModifiedTime", + resourceTypes: { + serializedName: "resourceTypes", type: { - name: "DateTime" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const StatusActiveEvent: coreClient.CompositeMapper = { +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StatusActiveEvent", + className: "Resource", modelProperties: { - title: { - serializedName: "title", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - description: { - serializedName: "description", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - trackingId: { - serializedName: "trackingId", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } }, - startTime: { - serializedName: "startTime", + systemData: { + serializedName: "systemData", type: { - name: "DateTime" + name: "Composite", + className: "SystemData" } - }, - cloud: { - serializedName: "cloud", + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", type: { name: "String" } }, - severity: { - serializedName: "severity", + createdByType: { + serializedName: "createdByType", type: { name: "String" } }, - stage: { - serializedName: "stage", + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { name: "String" } }, - published: { - serializedName: "published", + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { - name: "Boolean" + name: "String" } }, - lastModifiedTime: { - serializedName: "lastModifiedTime", + lastModifiedAt: { + serializedName: "lastModifiedAt", type: { name: "DateTime" } - }, - impacts: { - serializedName: "impacts", + } + } + } +}; + +export const EventImpactedResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventImpactedResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "EmergingIssueImpact" + className: "EventImpactedResource" } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } }; -export const EmergingIssueImpact: coreClient.CompositeMapper = { +export const KeyValueItem: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EmergingIssueImpact", + className: "KeyValueItem", modelProperties: { - id: { - serializedName: "id", + key: { + serializedName: "key", + readOnly: true, type: { name: "String" } }, - name: { - serializedName: "name", + value: { + serializedName: "value", + readOnly: true, type: { name: "String" } - }, - regions: { - serializedName: "regions", + } + } + } +}; + +export const Events: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Events", + modelProperties: { + value: { + serializedName: "value", + required: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "ImpactedRegion" + className: "Event" } } } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } } } } }; -export const ImpactedRegion: coreClient.CompositeMapper = { +export const EventPropertiesArticle: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ImpactedRegion", + className: "EventPropertiesArticle", modelProperties: { - id: { - serializedName: "id", - type: { - name: "String" - } - }, - name: { - serializedName: "name", + articleContent: { + serializedName: "articleContent", type: { name: "String" } @@ -608,95 +697,148 @@ export const ImpactedRegion: coreClient.CompositeMapper = { } }; -export const Resource: coreClient.CompositeMapper = { +export const Link: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "Link", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + type: { + serializedName: "type", type: { name: "String" } }, - name: { - serializedName: "name", - readOnly: true, + displayText: { + serializedName: "displayText", + type: { + name: "Composite", + className: "LinkDisplayText" + } + }, + extensionName: { + serializedName: "extensionName", type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + bladeName: { + serializedName: "bladeName", type: { name: "String" } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } }; -export const EmergingIssueListResult: coreClient.CompositeMapper = { +export const LinkDisplayText: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EmergingIssueListResult", + className: "LinkDisplayText", modelProperties: { value: { serializedName: "value", + type: { + name: "String" + } + }, + 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: "EmergingIssuesGetResult" + className: "ImpactedServiceRegion" } } } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } } } } }; -export const EmergingIssuesGetResult: coreClient.CompositeMapper = { +export const ImpactedServiceRegion: coreClient.CompositeMapper = { type: { name: "Composite", - className: "EmergingIssuesGetResult", + className: "ImpactedServiceRegion", modelProperties: { - ...Resource.type.modelProperties, - refreshTimestamp: { - serializedName: "properties.refreshTimestamp", + impactedRegion: { + serializedName: "impactedRegion", type: { - name: "DateTime" + name: "String" } }, - statusBanners: { - serializedName: "properties.statusBanners", + status: { + serializedName: "status", + type: { + name: "String" + } + }, + impactedSubscriptions: { + serializedName: "impactedSubscriptions", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "StatusBanner" + name: "String" } } } }, - statusActiveEvents: { - serializedName: "properties.statusActiveEvents", + impactedTenants: { + serializedName: "impactedTenants", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + lastUpdateTime: { + serializedName: "lastUpdateTime", + type: { + name: "DateTime" + } + }, + updates: { + serializedName: "updates", type: { name: "Sequence", element: { type: { name: "Composite", - className: "StatusActiveEvent" + className: "Update" } } } @@ -704,3 +846,685 @@ export const EmergingIssuesGetResult: coreClient.CompositeMapper = { } } }; + +export const Update: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Update", + modelProperties: { + summary: { + serializedName: "summary", + type: { + name: "String" + } + }, + updateDateTime: { + serializedName: "updateDateTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const EventPropertiesRecommendedActions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventPropertiesRecommendedActions", + modelProperties: { + message: { + serializedName: "message", + type: { + name: "String" + } + }, + actions: { + serializedName: "actions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + 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 EmergingIssueListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EmergingIssueListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmergingIssuesGetResult" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + 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" + } + } + } + } +}; + +export const StatusActiveEvent: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StatusActiveEvent", + modelProperties: { + title: { + serializedName: "title", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + trackingId: { + serializedName: "trackingId", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "DateTime" + } + }, + cloud: { + serializedName: "cloud", + type: { + name: "String" + } + }, + severity: { + serializedName: "severity", + type: { + name: "String" + } + }, + stage: { + serializedName: "stage", + type: { + name: "String" + } + }, + published: { + serializedName: "published", + type: { + name: "Boolean" + } + }, + lastModifiedTime: { + serializedName: "lastModifiedTime", + type: { + name: "DateTime" + } + }, + impacts: { + serializedName: "impacts", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EmergingIssueImpact" + } + } + } + } + } + } +}; + +export const EmergingIssueImpact: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EmergingIssueImpact", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + regions: { + serializedName: "regions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ImpactedRegion" + } + } + } + } + } + } +}; + +export const ImpactedRegion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImpactedRegion", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const EmergingIssuesGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EmergingIssuesGetResult", + modelProperties: { + ...Resource.type.modelProperties, + refreshTimestamp: { + serializedName: "properties.refreshTimestamp", + type: { + name: "DateTime" + } + }, + statusBanners: { + serializedName: "properties.statusBanners", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StatusBanner" + } + } + } + }, + statusActiveEvents: { + serializedName: "properties.statusActiveEvents", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StatusActiveEvent" + } + } + } + } + } + } +}; + +export const MetadataEntity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetadataEntity", + modelProperties: { + ...ProxyResource.type.modelProperties, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + dependsOn: { + serializedName: "properties.dependsOn", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + applicableScenarios: { + serializedName: "properties.applicableScenarios", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + supportedValues: { + serializedName: "properties.supportedValues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetadataSupportedValueDetail" + } + } + } + } + } + } +}; + +export const EventImpactedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EventImpactedResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + targetResourceType: { + serializedName: "properties.targetResourceType", + readOnly: true, + type: { + name: "String" + } + }, + targetResourceId: { + serializedName: "properties.targetResourceId", + readOnly: true, + type: { + name: "String" + } + }, + targetRegion: { + serializedName: "properties.targetRegion", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "properties.info", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyValueItem" + } + } + } + } + } + } +}; + +export const Event: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Event", + modelProperties: { + ...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: "Link" + } + } + } + }, + impactStartTime: { + serializedName: "properties.impactStartTime", + type: { + name: "DateTime" + } + }, + impactMitigationTime: { + serializedName: "properties.impactMitigationTime", + type: { + name: "DateTime" + } + }, + impact: { + serializedName: "properties.impact", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Impact" + } + } + } + }, + recommendedActions: { + serializedName: "properties.recommendedActions", + type: { + name: "Composite", + className: "EventPropertiesRecommendedActions" + } + }, + faqs: { + serializedName: "properties.faqs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + 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..0a47dbc99b79 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,57 @@ export const nextLink: OperationURLParameter = { skipEncoding: true }; +export const name: OperationURLParameter = { + parameterPath: "name", + mapper: { + serializedName: "name", + required: true, + type: { + name: "String" + } + } +}; + +export const eventTrackingId: OperationURLParameter = { + parameterPath: "eventTrackingId", + mapper: { + serializedName: "eventTrackingId", + required: true, + type: { + name: "String" + } + } +}; + +export const impactedResourceName: OperationURLParameter = { + parameterPath: "impactedResourceName", + mapper: { + constraints: { + Pattern: new RegExp("^[^*#&+:<>%?]+$") + }, + serializedName: "impactedResourceName", + required: true, + type: { + name: "String" + } + } +}; + +export const queryStartTime: OperationQueryParameter = { + parameterPath: ["options", "queryStartTime"], + mapper: { + serializedName: "queryStartTime", + type: { + name: "String" + } + } +}; + export const issueName: OperationURLParameter = { parameterPath: "issueName", mapper: { - defaultValue: "default", - isConstant: true, serializedName: "issueName", + required: true, type: { name: "String" } diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts index 16652b988b87..597961edbf67 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts @@ -45,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( @@ -100,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. */ @@ -170,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} @@ -233,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( @@ -247,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. */ @@ -282,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} 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 55b0bb82e556..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/childAvailabilityStatuses.ts +++ /dev/null @@ -1,218 +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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -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, - ChildAvailabilityStatusesListResponse, - ChildAvailabilityStatusesGetByResourceOptionalParams, - ChildAvailabilityStatusesGetByResourceResponse, - 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: (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?: ChildAvailabilityStatusesListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: ChildAvailabilityStatusesListResponse; - 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; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - 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 - } - }, - 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 c3795d78dc3c..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/childResources.ts +++ /dev/null @@ -1,176 +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, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -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: (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?: ChildResourcesListOptionalParams, - settings?: PageSettings - ): AsyncIterableIterator { - let result: ChildResourcesListResponse; - 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; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - 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 - } - }, - 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 index 0b4ea36ab1c6..2351cbc26e41 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts @@ -18,6 +18,7 @@ import { EmergingIssuesListNextOptionalParams, EmergingIssuesListOptionalParams, EmergingIssuesListResponse, + IssueNameParameter, EmergingIssuesGetOptionalParams, EmergingIssuesGetResponse, EmergingIssuesListNextResponse @@ -90,16 +91,6 @@ export class EmergingIssuesImpl implements EmergingIssues { } } - /** - * 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. @@ -110,6 +101,21 @@ export class EmergingIssuesImpl implements EmergingIssues { return this.client.sendOperationRequest({ options }, listOperationSpec); } + /** + * Gets Azure services' emerging issues. + * @param issueName The name of the emerging issue. + * @param options The options parameters. + */ + get( + issueName: IssueNameParameter, + options?: EmergingIssuesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { issueName, options }, + getOperationSpec + ); + } + /** * ListNext * @param nextLink The nextLink from the previous successful call to the List method. @@ -128,35 +134,35 @@ export class EmergingIssuesImpl implements EmergingIssues { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const getOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}", +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceHealth/emergingIssues", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EmergingIssuesGetResult + bodyMapper: Mappers.EmergingIssueListResult }, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.issueName], + urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer }; -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.ResourceHealth/emergingIssues", +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.EmergingIssueListResult + bodyMapper: Mappers.EmergingIssuesGetResult }, default: { bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], + urlParameters: [Parameters.$host, Parameters.issueName], 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..0b7c8c7dabfb --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/eventOperations.ts @@ -0,0 +1,184 @@ +/* + * 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, + EventFetchDetailsBySubscriptionIdAndTrackingIdOptionalParams, + EventFetchDetailsBySubscriptionIdAndTrackingIdResponse, + EventGetByTenantIdAndTrackingIdOptionalParams, + EventGetByTenantIdAndTrackingIdResponse, + EventFetchDetailsByTenantIdAndTrackingIdOptionalParams, + EventFetchDetailsByTenantIdAndTrackingIdResponse +} 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 details in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Security Advisory events + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + fetchDetailsBySubscriptionIdAndTrackingId( + eventTrackingId: string, + options?: EventFetchDetailsBySubscriptionIdAndTrackingIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, options }, + fetchDetailsBySubscriptionIdAndTrackingIdOperationSpec + ); + } + + /** + * 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 + ); + } + + /** + * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive + * properties for Security Advisory events + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + fetchDetailsByTenantIdAndTrackingId( + eventTrackingId: string, + options?: EventFetchDetailsByTenantIdAndTrackingIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, options }, + fetchDetailsByTenantIdAndTrackingIdOperationSpec + ); + } +} +// 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 fetchDetailsBySubscriptionIdAndTrackingIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Event + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + 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 +}; +const fetchDetailsByTenantIdAndTrackingIdOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/fetchEventDetails", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.Event + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + 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..e5d315ed36fe --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/impactedResources.ts @@ -0,0 +1,414 @@ +/* + * 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, + ImpactedResourcesListByTenantIdAndEventIdNextOptionalParams, + ImpactedResourcesListByTenantIdAndEventIdOptionalParams, + ImpactedResourcesListByTenantIdAndEventIdResponse, + ImpactedResourcesGetOptionalParams, + ImpactedResourcesGetResponse, + ImpactedResourcesGetByTenantIdOptionalParams, + ImpactedResourcesGetByTenantIdResponse, + ImpactedResourcesListBySubscriptionIdAndEventIdNextResponse, + ImpactedResourcesListByTenantIdAndEventIdNextResponse +} 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 tenant by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + public listByTenantIdAndEventId( + eventTrackingId: string, + options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByTenantIdAndEventIdPagingAll( + 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.listByTenantIdAndEventIdPagingPage( + eventTrackingId, + options, + settings + ); + } + }; + } + + private async *listByTenantIdAndEventIdPagingPage( + eventTrackingId: string, + options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ImpactedResourcesListByTenantIdAndEventIdResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByTenantIdAndEventId(eventTrackingId, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByTenantIdAndEventIdNext( + eventTrackingId, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByTenantIdAndEventIdPagingAll( + eventTrackingId: string, + options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByTenantIdAndEventIdPagingPage( + 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 + ); + } + + /** + * Lists impacted resources in the tenant by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + private _listByTenantIdAndEventId( + eventTrackingId: string, + options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, options }, + listByTenantIdAndEventIdOperationSpec + ); + } + + /** + * Gets the specific impacted resource in the tenant by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param impactedResourceName Name of the Impacted Resource. + * @param options The options parameters. + */ + getByTenantId( + eventTrackingId: string, + impactedResourceName: string, + options?: ImpactedResourcesGetByTenantIdOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, impactedResourceName, options }, + getByTenantIdOperationSpec + ); + } + + /** + * 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 + ); + } + + /** + * ListByTenantIdAndEventIdNext + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param nextLink The nextLink from the previous successful call to the ListByTenantIdAndEventId + * method. + * @param options The options parameters. + */ + private _listByTenantIdAndEventIdNext( + eventTrackingId: string, + nextLink: string, + options?: ImpactedResourcesListByTenantIdAndEventIdNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { eventTrackingId, nextLink, options }, + listByTenantIdAndEventIdNextOperationSpec + ); + } +} +// 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 listByTenantIdAndEventIdOperationSpec: coreClient.OperationSpec = { + path: + "/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.eventTrackingId], + headerParameters: [Parameters.accept], + serializer +}; +const getByTenantIdOperationSpec: coreClient.OperationSpec = { + path: + "/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.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 +}; +const listByTenantIdAndEventIdNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EventImpactedResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + 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..831765a74bdc 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts @@ -7,7 +7,10 @@ */ export * from "./availabilityStatuses"; -export * from "./childAvailabilityStatuses"; -export * from "./childResources"; export * from "./operations"; +export * from "./metadata"; +export * from "./impactedResources"; +export * from "./securityAdvisoryImpactedResources"; +export * from "./eventsOperations"; +export * from "./eventOperations"; export * from "./emergingIssues"; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/metadata.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/metadata.ts new file mode 100644 index 000000000000..7559a1505dd8 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/metadata.ts @@ -0,0 +1,182 @@ +/* + * 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 { Metadata } 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 { + MetadataEntity, + MetadataListNextOptionalParams, + MetadataListOptionalParams, + MetadataListResponse, + MetadataGetEntityOptionalParams, + MetadataGetEntityResponse, + MetadataListNextResponse +} from "../models"; + +/// +/** Class containing Metadata operations. */ +export class MetadataImpl implements Metadata { + private readonly client: MicrosoftResourceHealth; + + /** + * Initialize a new instance of the class Metadata class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftResourceHealth) { + this.client = client; + } + + /** + * Gets the list of metadata entities. + * @param options The options parameters. + */ + public list( + options?: MetadataListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(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.listPagingPage(options, settings); + } + }; + } + + private async *listPagingPage( + options?: MetadataListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: MetadataListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: MetadataListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Gets the list of metadata entities. + * @param options The options parameters. + */ + private _list( + options?: MetadataListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Gets the list of metadata entities. + * @param name Name of metadata entity. + * @param options The options parameters. + */ + getEntity( + name: string, + options?: MetadataGetEntityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { name, options }, + getEntityOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: MetadataListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceHealth/metadata", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MetadataEntityListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const getEntityOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.ResourceHealth/metadata/{name}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MetadataEntity + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.name], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MetadataEntityListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/securityAdvisoryImpactedResources.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/securityAdvisoryImpactedResources.ts new file mode 100644 index 000000000000..0adff453cb7b --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/securityAdvisoryImpactedResources.ts @@ -0,0 +1,342 @@ +/* + * 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 { SecurityAdvisoryImpactedResources } 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, + SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams, + SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams, + SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdResponse, + SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextOptionalParams, + SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams, + SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdResponse, + SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextResponse, + SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextResponse +} from "../models"; + +/// +/** Class containing SecurityAdvisoryImpactedResources operations. */ +export class SecurityAdvisoryImpactedResourcesImpl + implements SecurityAdvisoryImpactedResources { + private readonly client: MicrosoftResourceHealth; + + /** + * Initialize a new instance of the class SecurityAdvisoryImpactedResources class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftResourceHealth) { + this.client = client; + } + + /** + * Lists impacted resources in the subscription by an event (Security Advisory). + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + public listBySubscriptionIdAndEventId( + eventTrackingId: string, + options?: SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + ): 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?: SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdResponse; + 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?: SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionIdAndEventIdPagingPage( + eventTrackingId, + options + )) { + yield* page; + } + } + + /** + * Lists impacted resources in the tenant by an event (Security Advisory). + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + public listByTenantIdAndEventId( + eventTrackingId: string, + options?: SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByTenantIdAndEventIdPagingAll( + 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.listByTenantIdAndEventIdPagingPage( + eventTrackingId, + options, + settings + ); + } + }; + } + + private async *listByTenantIdAndEventIdPagingPage( + eventTrackingId: string, + options?: SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByTenantIdAndEventId(eventTrackingId, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByTenantIdAndEventIdNext( + eventTrackingId, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByTenantIdAndEventIdPagingAll( + eventTrackingId: string, + options?: SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByTenantIdAndEventIdPagingPage( + eventTrackingId, + options + )) { + yield* page; + } + } + + /** + * Lists impacted resources in the subscription by an event (Security Advisory). + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + private _listBySubscriptionIdAndEventId( + eventTrackingId: string, + options?: SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + ): Promise< + SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdResponse + > { + return this.client.sendOperationRequest( + { eventTrackingId, options }, + listBySubscriptionIdAndEventIdOperationSpec + ); + } + + /** + * Lists impacted resources in the tenant by an event (Security Advisory). + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + private _listByTenantIdAndEventId( + eventTrackingId: string, + options?: SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams + ): Promise< + SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdResponse + > { + return this.client.sendOperationRequest( + { eventTrackingId, options }, + listByTenantIdAndEventIdOperationSpec + ); + } + + /** + * 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?: SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextOptionalParams + ): Promise< + SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdNextResponse + > { + return this.client.sendOperationRequest( + { eventTrackingId, nextLink, options }, + listBySubscriptionIdAndEventIdNextOperationSpec + ); + } + + /** + * ListByTenantIdAndEventIdNext + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param nextLink The nextLink from the previous successful call to the ListByTenantIdAndEventId + * method. + * @param options The options parameters. + */ + private _listByTenantIdAndEventIdNext( + eventTrackingId: string, + nextLink: string, + options?: SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextOptionalParams + ): Promise< + SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdNextResponse + > { + return this.client.sendOperationRequest( + { eventTrackingId, nextLink, options }, + listByTenantIdAndEventIdNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionIdAndEventIdOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/listSecurityAdvisoryImpactedResources", + httpMethod: "POST", + 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 listByTenantIdAndEventIdOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/listSecurityAdvisoryImpactedResources", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.EventImpactedResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [Parameters.$host, Parameters.eventTrackingId], + 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 +}; +const listByTenantIdAndEventIdNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EventImpactedResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.eventTrackingId + ], + headerParameters: [Parameters.accept], + serializer +}; 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 index b059382f09f3..79da920413f5 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts @@ -10,6 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { EmergingIssuesGetResult, EmergingIssuesListOptionalParams, + IssueNameParameter, EmergingIssuesGetOptionalParams, EmergingIssuesGetResponse } from "../models"; @@ -26,9 +27,11 @@ export interface EmergingIssues { ): PagedAsyncIterableIterator; /** * Gets Azure services' emerging issues. + * @param issueName The name of the emerging issue. * @param options The options parameters. */ get( + issueName: IssueNameParameter, 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..383d79750c18 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/eventOperations.ts @@ -0,0 +1,60 @@ +/* + * 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, + EventFetchDetailsBySubscriptionIdAndTrackingIdOptionalParams, + EventFetchDetailsBySubscriptionIdAndTrackingIdResponse, + EventGetByTenantIdAndTrackingIdOptionalParams, + EventGetByTenantIdAndTrackingIdResponse, + EventFetchDetailsByTenantIdAndTrackingIdOptionalParams, + EventFetchDetailsByTenantIdAndTrackingIdResponse +} 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 details in the subscription by event tracking id. This can be used to fetch + * sensitive properties for Security Advisory events + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + fetchDetailsBySubscriptionIdAndTrackingId( + eventTrackingId: string, + options?: EventFetchDetailsBySubscriptionIdAndTrackingIdOptionalParams + ): 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; + /** + * Service health event details in the tenant by event tracking id. This can be used to fetch sensitive + * properties for Security Advisory events + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + fetchDetailsByTenantIdAndTrackingId( + eventTrackingId: string, + options?: EventFetchDetailsByTenantIdAndTrackingIdOptionalParams + ): 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..1735d218d06e --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/impactedResources.ts @@ -0,0 +1,63 @@ +/* + * 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, + ImpactedResourcesListByTenantIdAndEventIdOptionalParams, + ImpactedResourcesGetOptionalParams, + ImpactedResourcesGetResponse, + ImpactedResourcesGetByTenantIdOptionalParams, + ImpactedResourcesGetByTenantIdResponse +} 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; + /** + * Lists impacted resources in the tenant by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + listByTenantIdAndEventId( + eventTrackingId: string, + options?: ImpactedResourcesListByTenantIdAndEventIdOptionalParams + ): 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; + /** + * Gets the specific impacted resource in the tenant by an event. + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param impactedResourceName Name of the Impacted Resource. + * @param options The options parameters. + */ + getByTenantId( + eventTrackingId: string, + impactedResourceName: string, + options?: ImpactedResourcesGetByTenantIdOptionalParams + ): Promise; +} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts index 7a0013d72250..831765a74bdc 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts @@ -7,7 +7,10 @@ */ export * from "./availabilityStatuses"; -export * from "./childAvailabilityStatuses"; -export * from "./childResources"; export * from "./operations"; +export * from "./metadata"; +export * from "./impactedResources"; +export * from "./securityAdvisoryImpactedResources"; +export * from "./eventsOperations"; +export * from "./eventOperations"; export * from "./emergingIssues"; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/metadata.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/metadata.ts new file mode 100644 index 000000000000..b580859daba4 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/metadata.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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + MetadataEntity, + MetadataListOptionalParams, + MetadataGetEntityOptionalParams, + MetadataGetEntityResponse +} from "../models"; + +/// +/** Interface representing a Metadata. */ +export interface Metadata { + /** + * Gets the list of metadata entities. + * @param options The options parameters. + */ + list( + options?: MetadataListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the list of metadata entities. + * @param name Name of metadata entity. + * @param options The options parameters. + */ + getEntity( + name: string, + options?: MetadataGetEntityOptionalParams + ): Promise; +} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/securityAdvisoryImpactedResources.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/securityAdvisoryImpactedResources.ts new file mode 100644 index 000000000000..49978c0abe84 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/securityAdvisoryImpactedResources.ts @@ -0,0 +1,37 @@ +/* + * 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, + SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams, + SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams +} from "../models"; + +/// +/** Interface representing a SecurityAdvisoryImpactedResources. */ +export interface SecurityAdvisoryImpactedResources { + /** + * Lists impacted resources in the subscription by an event (Security Advisory). + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + listBySubscriptionIdAndEventId( + eventTrackingId: string, + options?: SecurityAdvisoryImpactedResourcesListBySubscriptionIdAndEventIdOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists impacted resources in the tenant by an event (Security Advisory). + * @param eventTrackingId Event Id which uniquely identifies ServiceHealth event. + * @param options The options parameters. + */ + listByTenantIdAndEventId( + eventTrackingId: string, + options?: SecurityAdvisoryImpactedResourcesListByTenantIdAndEventIdOptionalParams + ): PagedAsyncIterableIterator; +} 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"