From 8399bc5ab7628988f5e35875f42b9bdf8c8e5903 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Nov 2022 04:00:39 +0000 Subject: [PATCH] CodeGen from PR 21549 in Azure/azure-rest-api-specs Merge 42107437f21f9919a08072b5560770075d963eaa into 83d42b77e751deafcf46784877922ec1538f41c6 --- common/config/rush/pnpm-lock.yaml | 12 +- .../arm-resourcehealth/CHANGELOG.md | 36 ++- .../arm-resourcehealth/_meta.json | 10 +- .../arm-resourcehealth/package.json | 16 +- .../review/arm-resourcehealth.api.md | 175 +++--------- .../src/microsoftResourceHealth.ts | 63 ++-- .../arm-resourcehealth/src/models/index.ts | 268 ++++++------------ .../arm-resourcehealth/src/models/mappers.ts | 223 +++------------ .../src/models/parameters.ts | 14 +- .../src/operations/availabilityStatuses.ts | 18 +- .../operations/childAvailabilityStatuses.ts | 210 -------------- .../src/operations/childResources.ts | 168 ----------- .../src/operations/emergingIssues.ts | 165 ----------- .../src/operations/index.ts | 3 - .../availabilityStatuses.ts | 9 +- .../childAvailabilityStatuses.ts | 43 --- .../operationsInterfaces/childResources.ts | 30 -- .../operationsInterfaces/emergingIssues.ts | 34 --- .../src/operationsInterfaces/index.ts | 3 - .../arm-resourcehealth/tsconfig.json | 10 +- 20 files changed, 242 insertions(+), 1268 deletions(-) delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operations/childAvailabilityStatuses.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operations/childResources.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childAvailabilityStatuses.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childResources.ts delete mode 100644 sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f6e546040b4a..33258c1bdd96 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3891,7 +3891,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20221113 + typescript: 5.0.0-dev.20221114 dev: false /downlevel-dts/0.8.0: @@ -8839,8 +8839,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20221113: - resolution: {integrity: sha512-iNVo0p5OwpkxLl3hzf7zLw5fjcQnrFIgHwPh2BZgZOofcaFNxj42SOhR/OoZMYSbqkkRFrOi1gzVcsgw6ehDFg==} + /typescript/5.0.0-dev.20221114: + resolution: {integrity: sha512-lMcxw0oxEhQR0HIZyxhmCiwFqXfPQGtakbc+792/hmPP/pyICuaUUIKyY/7Cl6QPGTplHcGjDPEVbVE46gPVrA==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -10641,7 +10641,7 @@ packages: dev: false file:projects/arm-batch.tgz: - resolution: {integrity: sha512-BtovOUqCBkiF8Hb+3XtHYg8u9iVDRUcFlyU5GM2JidX8OD2mdSiNm0I3csgcCxNAvOGbvYL8EEDFvsi1afsEyA==, tarball: file:projects/arm-batch.tgz} + resolution: {integrity: sha512-itk/e/Xa/k+K6/Y1RHs4eFBE4U1YJCZqd8RrgFJv1kfS28gCbbC85CMt7+JP5gXsSokL2R8HfrHy/Pu6OhDYeA==, tarball: file:projects/arm-batch.tgz} name: '@rush-temp/arm-batch' version: 0.0.0 dependencies: @@ -14264,7 +14264,7 @@ packages: dev: false file:projects/arm-resourcehealth.tgz: - resolution: {integrity: sha512-Wgl98neDnGlahm6+x5H/b22PmI9RmUy4DJzmR97JTM/oO8EWyAHiM4eVG9fvZnQR1QggVkAXCqzl8hFKHSLoVw==, tarball: file:projects/arm-resourcehealth.tgz} + resolution: {integrity: sha512-ddBhWohE55q+g80psG+FUMPaqJbGIbZmZUe63K8R6kiM4wASQDxFmFdmNHmMXybvlvfg/6bGHTsfipGVabcy5w==, tarball: file:projects/arm-resourcehealth.tgz} name: '@rush-temp/arm-resourcehealth' version: 0.0.0 dependencies: @@ -14283,7 +14283,7 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 tslib: 2.4.1 - typescript: 4.2.4 + typescript: 4.6.4 uglify-js: 3.17.4 transitivePeerDependencies: - '@types/node' diff --git a/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md index 662fa5c48772..8b3252c8b5e3 100644 --- a/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md +++ b/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md @@ -1,15 +1,31 @@ # Release History + +## 4.0.0 (2022-11-15) + +**Features** -## 3.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface AvailabilityStatusPropertiesRecentlyResolved + - Added Interface ImpactedResourceStatus + - Added Type Alias ReasonTypeValues + - Interface AvailabilityStatusProperties has a new optional parameter recentlyResolved + - Interface AvailabilityStatusProperties has a new optional parameter title + - Added Enum KnownAvailabilityStateValues + - Added Enum KnownReasonChronicityTypes + - Added Enum KnownReasonTypeValues + +**Breaking Changes** + + - Removed operation group ChildAvailabilityStatuses + - Removed operation group ChildResources + - Removed operation group EmergingIssues + - Interface AvailabilityStatusProperties no longer has parameter recentlyResolvedState + - Class MicrosoftResourceHealth no longer has parameter childAvailabilityStatuses + - Class MicrosoftResourceHealth no longer has parameter childResources + - Class MicrosoftResourceHealth no longer has parameter emergingIssues + - Removed Enum KnownSeverityValues + - Removed Enum KnownStageValues + + ## 3.1.0 (2022-07-14) **Features** diff --git a/sdk/resourcehealth/arm-resourcehealth/_meta.json b/sdk/resourcehealth/arm-resourcehealth/_meta.json index 72e1b723251d..1afe7934b186 100644 --- a/sdk/resourcehealth/arm-resourcehealth/_meta.json +++ b/sdk/resourcehealth/arm-resourcehealth/_meta.json @@ -1,8 +1,8 @@ { - "commit": "0cd7b3e83d5e7e21222dcc4bdde4565562da0cdf", - "readme": "specification\\resourcehealth\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resourcehealth\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1 --generate-sample=true", + "commit": "e6f13184e694a9d2b646eed81cbe65785f7d6984", + "readme": "specification/resourcehealth/resource-manager/readme.md", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resourcehealth/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.2", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", - "use": "@autorest/typescript@6.0.0-rc.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.1", + "use": "@autorest/typescript@6.0.0-rc.2" } \ No newline at end of file diff --git a/sdk/resourcehealth/arm-resourcehealth/package.json b/sdk/resourcehealth/arm-resourcehealth/package.json index 6bba2826da54..d369ec617d2c 100644 --- a/sdk/resourcehealth/arm-resourcehealth/package.json +++ b/sdk/resourcehealth/arm-resourcehealth/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for MicrosoftResourceHealth.", - "version": "3.1.1", + "version": "4.0.0", "engines": { "node": ">=14.0.0" }, @@ -34,7 +34,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.2.0", + "typescript": "~4.6.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -107,13 +107,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resourcehealth?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/resourcehealth/arm-resourcehealth/review/arm-resourcehealth.api.md b/sdk/resourcehealth/arm-resourcehealth/review/arm-resourcehealth.api.md index dcea2e328bc1..fd3e17ef03f7 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 { @@ -108,150 +108,64 @@ 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; -} - -// @public -export interface ChildAvailabilityStatuses { - getByResource(resourceUri: string, options?: ChildAvailabilityStatusesGetByResourceOptionalParams): Promise; - list(resourceUri: string, options?: ChildAvailabilityStatusesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface ChildAvailabilityStatusesGetByResourceOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; -} - -// @public -export type ChildAvailabilityStatusesGetByResourceResponse = AvailabilityStatus; - -// @public -export interface ChildAvailabilityStatusesListNextOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; -} - -// @public -export type ChildAvailabilityStatusesListNextResponse = AvailabilityStatusListResult; - -// @public -export interface ChildAvailabilityStatusesListOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; -} - -// @public -export type ChildAvailabilityStatusesListResponse = AvailabilityStatusListResult; - -// @public -export interface ChildResources { - list(resourceUri: string, options?: ChildResourcesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface ChildResourcesListNextOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; + unavailableOccuredTime?: Date; + unavailableSummary?: string; } // @public -export type ChildResourcesListNextResponse = AvailabilityStatusListResult; - -// @public -export interface ChildResourcesListOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; +export interface ErrorResponse { + readonly code?: string; + readonly details?: string; + readonly message?: string; } // @public -export type ChildResourcesListResponse = AvailabilityStatusListResult; - -// @public -export interface EmergingIssueImpact { +export interface ImpactedRegion { id?: string; name?: string; - regions?: ImpactedRegion[]; -} - -// @public -export interface EmergingIssueListResult { - nextLink?: string; - value?: EmergingIssuesGetResult[]; } // @public -export interface EmergingIssues { - get(options?: EmergingIssuesGetOptionalParams): Promise; - list(options?: EmergingIssuesListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface EmergingIssuesGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type EmergingIssuesGetResponse = EmergingIssuesGetResult; - -// @public -export interface EmergingIssuesGetResult extends Resource { - refreshTimestamp?: Date; - statusActiveEvents?: StatusActiveEvent[]; - statusBanners?: StatusBanner[]; -} - -// @public -export interface EmergingIssuesListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type EmergingIssuesListNextResponse = EmergingIssueListResult; - -// @public -export interface EmergingIssuesListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type EmergingIssuesListResponse = EmergingIssueListResult; - -// @public -export interface ErrorResponse { - readonly code?: string; - readonly details?: string; - readonly message?: string; +export interface ImpactedResourceStatus extends Resource { + availabilityState?: AvailabilityStateValues; + occurredTime?: Date; + reasonType?: ReasonTypeValues; + summary?: string; + title?: string; } // @public -export interface ImpactedRegion { - id?: string; - name?: string; +export enum KnownAvailabilityStateValues { + Available = "Available", + Degraded = "Degraded", + Unavailable = "Unavailable", + Unknown = "Unknown" } // @public -export enum KnownSeverityValues { - Error = "Error", - Information = "Information", - Warning = "Warning" +export enum KnownReasonChronicityTypes { + Persistent = "Persistent", + Transient = "Transient" } // @public -export enum KnownStageValues { - Active = "Active", - Archived = "Archived", - Resolve = "Resolve" +export enum KnownReasonTypeValues { + Planned = "Planned", + Unplanned = "Unplanned", + UserInitiated = "UserInitiated" } // @public (undocumented) @@ -264,12 +178,6 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { // (undocumented) availabilityStatuses: AvailabilityStatuses; // (undocumented) - childAvailabilityStatuses: ChildAvailabilityStatuses; - // (undocumented) - childResources: ChildResources; - // (undocumented) - emergingIssues: EmergingIssues; - // (undocumented) operations: Operations; // (undocumented) subscriptionId: string; @@ -314,7 +222,10 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption export type OperationsListResponse = OperationListResult; // @public -export type ReasonChronicityTypes = "Transient" | "Persistent"; +export type ReasonChronicityTypes = string; + +// @public +export type ReasonTypeValues = string; // @public export interface RecommendedAction { @@ -352,26 +263,6 @@ export interface ServiceImpactingEventStatus { value?: string; } -// @public -export type SeverityValues = string; - -// @public -export type StageValues = string; - -// @public -export interface StatusActiveEvent { - cloud?: string; - description?: string; - impacts?: EmergingIssueImpact[]; - lastModifiedTime?: Date; - published?: boolean; - severity?: SeverityValues; - stage?: StageValues; - startTime?: Date; - title?: string; - trackingId?: string; -} - // @public export interface StatusBanner { cloud?: string; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts b/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts index 3683b2c47eaf..fec0d246373c 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts @@ -14,20 +14,8 @@ import { SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { - AvailabilityStatusesImpl, - ChildAvailabilityStatusesImpl, - ChildResourcesImpl, - OperationsImpl, - EmergingIssuesImpl -} from "./operations"; -import { - AvailabilityStatuses, - ChildAvailabilityStatuses, - ChildResources, - Operations, - EmergingIssues -} from "./operationsInterfaces"; +import { AvailabilityStatusesImpl, OperationsImpl } from "./operations"; +import { AvailabilityStatuses, Operations } from "./operationsInterfaces"; import { MicrosoftResourceHealthOptionalParams } from "./models"; export class MicrosoftResourceHealth extends coreClient.ServiceClient { @@ -63,7 +51,7 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resourcehealth/3.1.1`; + const packageDetails = `azsdk-js-arm-resourcehealth/4.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -83,39 +71,43 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { }; super(optionsWithDefaults); + let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: `${optionsWithDefaults.credentialScopes}`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2017-07-01"; + this.apiVersion = options.apiVersion || "2020-05-01"; this.availabilityStatuses = new AvailabilityStatusesImpl(this); - this.childAvailabilityStatuses = new ChildAvailabilityStatusesImpl(this); - this.childResources = new ChildResourcesImpl(this); this.operations = new OperationsImpl(this); - this.emergingIssues = new EmergingIssuesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -148,8 +140,5 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { } availabilityStatuses: AvailabilityStatuses; - childAvailabilityStatuses: ChildAvailabilityStatuses; - childResources: ChildResources; operations: Operations; - emergingIssues: EmergingIssues; } diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts index 3598bd89f230..80279886138c 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts @@ -34,6 +34,8 @@ export interface AvailabilityStatus { export interface AvailabilityStatusProperties { /** Availability status of the resource. When it is null, this availabilityStatus object represents an availability impacting event */ availabilityState?: AvailabilityStateValues; + /** Title description of the availability status. */ + title?: string; /** Summary description of the availability status. */ summary?: string; /** Details of the availability status. */ @@ -59,7 +61,7 @@ export interface AvailabilityStatusProperties { /** Timestamp for when the health was last checked. */ reportedTime?: Date; /** An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned */ - recentlyResolvedState?: AvailabilityStatusPropertiesRecentlyResolvedState; + recentlyResolved?: AvailabilityStatusPropertiesRecentlyResolved; /** Lists actions the user can take based on the current availabilityState of the resource. */ recommendedActions?: RecommendedAction[]; /** Lists the service impacting events that may be affecting the health of the resource. */ @@ -67,13 +69,13 @@ export interface AvailabilityStatusProperties { } /** An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned */ -export interface AvailabilityStatusPropertiesRecentlyResolvedState { +export interface AvailabilityStatusPropertiesRecentlyResolved { /** Timestamp for when the availabilityState changed to Unavailable */ - unavailableOccurredTime?: Date; + unavailableOccuredTime?: Date; /** Timestamp when the availabilityState changes to Available. */ resolvedTime?: Date; /** Brief description of cause of the resource becoming unavailable. */ - unavailabilitySummary?: string; + unavailableSummary?: string; } /** Lists actions the user can take based on the current availabilityState of the resource. */ @@ -163,6 +165,25 @@ export interface OperationDisplay { description?: 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; +} + /** Banner type of emerging issue. */ export interface StatusBanner { /** The banner title. */ @@ -175,40 +196,6 @@ export interface StatusBanner { lastModifiedTime?: Date; } -/** Active event type of emerging issue. */ -export interface StatusActiveEvent { - /** The active event title. */ - title?: string; - /** The details of active event. */ - description?: string; - /** The tracking id of this active event. */ - trackingId?: string; - /** The impact start time on this active event. */ - startTime?: Date; - /** The cloud type of this active event. */ - cloud?: string; - /** The severity level of this active event. */ - severity?: SeverityValues; - /** The stage of this active event. */ - stage?: StageValues; - /** The boolean value of this active event if published or not. */ - published?: boolean; - /** The last time modified on this banner. */ - lastModifiedTime?: Date; - /** The list of emerging issues impacts. */ - impacts?: EmergingIssueImpact[]; -} - -/** Object of the emerging issue impact on services and regions. */ -export interface EmergingIssueImpact { - /** The impacted service id. */ - id?: string; - /** The impacted service name. */ - name?: string; - /** The list of impacted regions for corresponding emerging issues. */ - regions?: ImpactedRegion[]; -} - /** Object of impacted region. */ export interface ImpactedRegion { /** The impacted region id. */ @@ -217,88 +204,82 @@ export interface ImpactedRegion { name?: 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; +/** impactedResource with health status */ +export interface ImpactedResourceStatus extends Resource { + /** Impacted resource status of the resource. */ + availabilityState?: AvailabilityStateValues; + /** Title description of the impacted resource status. */ + title?: string; + /** Summary description of the impacted resource status. */ + summary?: string; + /** When the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. */ + reasonType?: ReasonTypeValues; + /** Timestamp for when last change in health status occurred. */ + occurredTime?: Date; } -/** The list of emerging issues. */ -export interface EmergingIssueListResult { - /** The list of emerging issues. */ - value?: EmergingIssuesGetResult[]; - /** The link used to get the next page of emerging issues. */ - nextLink?: string; +/** Known values of {@link AvailabilityStateValues} that the service accepts. */ +export enum KnownAvailabilityStateValues { + /** Available */ + Available = "Available", + /** Unavailable */ + Unavailable = "Unavailable", + /** Degraded */ + Degraded = "Degraded", + /** Unknown */ + Unknown = "Unknown" } -/** The Get EmergingIssues operation response. */ -export interface EmergingIssuesGetResult extends Resource { - /** Timestamp for when last time refreshed for ongoing emerging issue. */ - refreshTimestamp?: Date; - /** The list of emerging issues of banner type. */ - statusBanners?: StatusBanner[]; - /** The list of emerging issues of active event type. */ - statusActiveEvents?: StatusActiveEvent[]; -} +/** + * Defines values for AvailabilityStateValues. \ + * {@link KnownAvailabilityStateValues} can be used interchangeably with AvailabilityStateValues, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Available** \ + * **Unavailable** \ + * **Degraded** \ + * **Unknown** + */ +export type AvailabilityStateValues = string; -/** Known values of {@link SeverityValues} that the service accepts. */ -export enum KnownSeverityValues { - /** Information */ - Information = "Information", - /** Warning */ - Warning = "Warning", - /** Error */ - Error = "Error" +/** Known values of {@link ReasonChronicityTypes} that the service accepts. */ +export enum KnownReasonChronicityTypes { + /** Transient */ + Transient = "Transient", + /** Persistent */ + Persistent = "Persistent" } /** - * Defines values for SeverityValues. \ - * {@link KnownSeverityValues} can be used interchangeably with SeverityValues, + * 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 - * **Information** \ - * **Warning** \ - * **Error** + * **Transient** \ + * **Persistent** */ -export type SeverityValues = string; - -/** Known values of {@link StageValues} that the service accepts. */ -export enum KnownStageValues { - /** Active */ - Active = "Active", - /** Resolve */ - Resolve = "Resolve", - /** Archived */ - Archived = "Archived" +export type ReasonChronicityTypes = 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 StageValues. \ - * {@link KnownStageValues} can be used interchangeably with StageValues, + * 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 - * **Active** \ - * **Resolve** \ - * **Archived** + * **Unplanned** \ + * **Planned** \ + * **UserInitiated** */ -export type StageValues = string; -/** Defines values for AvailabilityStateValues. */ -export type AvailabilityStateValues = "Available" | "Unavailable" | "Unknown"; -/** Defines values for ReasonChronicityTypes. */ -export type ReasonChronicityTypes = "Transient" | "Persistent"; +export type ReasonTypeValues = string; /** Optional parameters. */ export interface AvailabilityStatusesListBySubscriptionIdOptionalParams @@ -384,66 +365,6 @@ export interface AvailabilityStatusesListNextOptionalParams /** Contains response data for the listNext operation. */ export type AvailabilityStatusesListNextResponse = AvailabilityStatusListResult; -/** Optional parameters. */ -export interface ChildAvailabilityStatusesGetByResourceOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ - filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; -} - -/** Contains response data for the getByResource operation. */ -export type ChildAvailabilityStatusesGetByResourceResponse = AvailabilityStatus; - -/** Optional parameters. */ -export interface ChildAvailabilityStatusesListOptionalParams - 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; - -/** Optional parameters. */ -export interface ChildAvailabilityStatusesListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ - filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; -} - -/** Contains response data for the listNext operation. */ -export type ChildAvailabilityStatusesListNextResponse = AvailabilityStatusListResult; - -/** Optional parameters. */ -export interface ChildResourcesListOptionalParams - 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; - -/** Optional parameters. */ -export interface ChildResourcesListNextOptionalParams - extends coreClient.OperationOptions { - /** The filter to apply on the operation. For more information please see https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN */ - filter?: string; - /** Setting $expand=recommendedactions in url query expands the recommendedactions in the response. */ - expand?: string; -} - -/** Contains response data for the listNext operation. */ -export type ChildResourcesListNextResponse = AvailabilityStatusListResult; - /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} @@ -451,27 +372,6 @@ export interface OperationsListOptionalParams /** Contains response data for the list operation. */ export type OperationsListResponse = OperationListResult; -/** Optional parameters. */ -export interface EmergingIssuesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type EmergingIssuesGetResponse = EmergingIssuesGetResult; - -/** Optional parameters. */ -export interface EmergingIssuesListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type EmergingIssuesListResponse = EmergingIssueListResult; - -/** Optional parameters. */ -export interface EmergingIssuesListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type EmergingIssuesListNextResponse = EmergingIssueListResult; - /** Optional parameters. */ export interface MicrosoftResourceHealthOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts index 6ae4eaf92675..d0dae9fd0669 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts @@ -84,8 +84,13 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { availabilityState: { serializedName: "availabilityState", type: { - name: "Enum", - allowedValues: ["Available", "Unavailable", "Unknown"] + name: "String" + } + }, + title: { + serializedName: "title", + type: { + name: "String" } }, summary: { @@ -151,8 +156,7 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { reasonChronicity: { serializedName: "reasonChronicity", type: { - name: "Enum", - allowedValues: ["Transient", "Persistent"] + name: "String" } }, reportedTime: { @@ -161,11 +165,11 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { name: "DateTime" } }, - recentlyResolvedState: { - serializedName: "recentlyResolvedState", + recentlyResolved: { + serializedName: "recentlyResolved", type: { name: "Composite", - className: "AvailabilityStatusPropertiesRecentlyResolvedState" + className: "AvailabilityStatusPropertiesRecentlyResolved" } }, recommendedActions: { @@ -196,13 +200,13 @@ export const AvailabilityStatusProperties: coreClient.CompositeMapper = { } }; -export const AvailabilityStatusPropertiesRecentlyResolvedState: coreClient.CompositeMapper = { +export const AvailabilityStatusPropertiesRecentlyResolved: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AvailabilityStatusPropertiesRecentlyResolvedState", + className: "AvailabilityStatusPropertiesRecentlyResolved", modelProperties: { - unavailableOccurredTime: { - serializedName: "unavailableOccurredTime", + unavailableOccuredTime: { + serializedName: "unavailableOccuredTime", type: { name: "DateTime" } @@ -213,8 +217,8 @@ export const AvailabilityStatusPropertiesRecentlyResolvedState: coreClient.Compo name: "DateTime" } }, - unavailabilitySummary: { - serializedName: "unavailabilitySummary", + unavailableSummary: { + serializedName: "unavailableSummary", type: { name: "String" } @@ -446,43 +450,40 @@ export const OperationDisplay: coreClient.CompositeMapper = { } }; -export const StatusBanner: coreClient.CompositeMapper = { +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StatusBanner", + className: "Resource", modelProperties: { - title: { - serializedName: "title", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - message: { - serializedName: "message", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - cloud: { - serializedName: "cloud", + type: { + serializedName: "type", + readOnly: true, type: { name: "String" } - }, - lastModifiedTime: { - serializedName: "lastModifiedTime", - type: { - name: "DateTime" - } } } } }; -export const StatusActiveEvent: coreClient.CompositeMapper = { +export const StatusBanner: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StatusActiveEvent", + className: "StatusBanner", modelProperties: { title: { serializedName: "title", @@ -490,98 +491,23 @@ export const StatusActiveEvent: coreClient.CompositeMapper = { name: "String" } }, - description: { - serializedName: "description", - type: { - name: "String" - } - }, - trackingId: { - serializedName: "trackingId", + message: { + serializedName: "message", 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" - } - } - } } } } @@ -608,97 +534,40 @@ export const ImpactedRegion: coreClient.CompositeMapper = { } }; -export const Resource: coreClient.CompositeMapper = { +export const ImpactedResourceStatus: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "ImpactedResourceStatus", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + ...Resource.type.modelProperties, + availabilityState: { + serializedName: "properties.availabilityState", type: { name: "String" } }, - name: { - serializedName: "name", - readOnly: true, + title: { + serializedName: "properties.title", type: { name: "String" } }, - type: { - serializedName: "type", - readOnly: true, + summary: { + serializedName: "properties.summary", 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", + reasonType: { + serializedName: "properties.reasonType", type: { name: "String" } - } - } - } -}; - -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", + occurredTime: { + serializedName: "properties.occurredTime", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StatusBanner" - } - } - } - }, - statusActiveEvents: { - serializedName: "properties.statusActiveEvents", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StatusActiveEvent" - } - } + name: "DateTime" } } } diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/parameters.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/parameters.ts index 6dc6222dc643..0e60697be593 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: "2020-05-01", isConstant: true, serializedName: "api-version", type: { @@ -113,15 +113,3 @@ export const nextLink: OperationURLParameter = { }, skipEncoding: true }; - -export const issueName: OperationURLParameter = { - parameterPath: "issueName", - mapper: { - defaultValue: "default", - isConstant: true, - serializedName: "issueName", - type: { - name: "String" - } - } -}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts index 2869f85aca59..be924ccb3e4d 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/availabilityStatuses.ts @@ -44,8 +44,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( @@ -87,8 +86,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. */ @@ -141,8 +139,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} @@ -192,8 +189,7 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { } /** - * Lists the current availability status for all the resources in the subscription. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the subscription. * @param options The options parameters. */ private _listBySubscriptionId( @@ -206,8 +202,7 @@ export class AvailabilityStatusesImpl implements AvailabilityStatuses { } /** - * Lists the current availability status for all the resources in the resource group. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the resource group. * @param resourceGroupName The name of the resource group. * @param options The options parameters. */ @@ -241,8 +236,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 069e458ac30f..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/childAvailabilityStatuses.ts +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { ChildAvailabilityStatuses } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { MicrosoftResourceHealth } from "../microsoftResourceHealth"; -import { - AvailabilityStatus, - ChildAvailabilityStatusesListNextOptionalParams, - ChildAvailabilityStatusesListOptionalParams, - ChildAvailabilityStatusesGetByResourceOptionalParams, - ChildAvailabilityStatusesGetByResourceResponse, - ChildAvailabilityStatusesListResponse, - ChildAvailabilityStatusesListNextResponse -} from "../models"; - -/// -/** Class containing ChildAvailabilityStatuses operations. */ -export class ChildAvailabilityStatusesImpl - implements ChildAvailabilityStatuses { - private readonly client: MicrosoftResourceHealth; - - /** - * Initialize a new instance of the class ChildAvailabilityStatuses class. - * @param client Reference to the service client - */ - constructor(client: MicrosoftResourceHealth) { - this.client = client; - } - - /** - * Lists the historical availability statuses for a single child resource. Use the nextLink property in - * the response to get the next page of availability status - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(resourceUri, options); - } - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(resourceUri, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * Gets current availability status for a single resource - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - getByResource( - resourceUri: string, - options?: ChildAvailabilityStatusesGetByResourceOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - getByResourceOperationSpec - ); - } - - /** - * Lists the historical availability statuses for a single child resource. Use the nextLink property in - * the response to get the next page of availability status - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec - ); - } - - /** - * ListNext - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceUri: string, - nextLink: string, - options?: ChildAvailabilityStatusesListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getByResourceOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses/current", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatus - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceUri}/providers/Microsoft.ResourceHealth/childAvailabilityStatuses", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatusListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatusListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceUri, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/childResources.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/childResources.ts deleted file mode 100644 index 500dec89921f..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/childResources.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { ChildResources } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { MicrosoftResourceHealth } from "../microsoftResourceHealth"; -import { - AvailabilityStatus, - ChildResourcesListNextOptionalParams, - ChildResourcesListOptionalParams, - ChildResourcesListResponse, - ChildResourcesListNextResponse -} from "../models"; - -/// -/** Class containing ChildResources operations. */ -export class ChildResourcesImpl implements ChildResources { - private readonly client: MicrosoftResourceHealth; - - /** - * Initialize a new instance of the class ChildResources class. - * @param client Reference to the service client - */ - constructor(client: MicrosoftResourceHealth) { - this.client = client; - } - - /** - * Lists the all the children and its current health status for a parent resource. Use the nextLink - * property in the response to get the next page of children current health - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * @param options The options parameters. - */ - public list( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceUri, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(resourceUri, options); - } - }; - } - - private async *listPagingPage( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(resourceUri, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(resourceUri, continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(resourceUri, options)) { - yield* page; - } - } - - /** - * Lists the all the children and its current health status for a parent resource. Use the nextLink - * property in the response to get the next page of children current health - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * @param options The options parameters. - */ - private _list( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, options }, - listOperationSpec - ); - } - - /** - * ListNext - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceUri: string, - nextLink: string, - options?: ChildResourcesListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceUri, nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/{resourceUri}/providers/Microsoft.ResourceHealth/childResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatusListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [Parameters.$host, Parameters.resourceUri], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.AvailabilityStatusListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.expand - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceUri, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts deleted file mode 100644 index df507a849b31..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/emergingIssues.ts +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { EmergingIssues } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { MicrosoftResourceHealth } from "../microsoftResourceHealth"; -import { - EmergingIssuesGetResult, - EmergingIssuesListNextOptionalParams, - EmergingIssuesListOptionalParams, - EmergingIssuesGetOptionalParams, - EmergingIssuesGetResponse, - EmergingIssuesListResponse, - EmergingIssuesListNextResponse -} from "../models"; - -/// -/** Class containing EmergingIssues operations. */ -export class EmergingIssuesImpl implements EmergingIssues { - private readonly client: MicrosoftResourceHealth; - - /** - * Initialize a new instance of the class EmergingIssues class. - * @param client Reference to the service client - */ - constructor(client: MicrosoftResourceHealth) { - this.client = client; - } - - /** - * Lists Azure services' emerging issues. - * @param options The options parameters. - */ - public list( - options?: EmergingIssuesListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(options); - } - }; - } - - private async *listPagingPage( - options?: EmergingIssuesListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - options?: EmergingIssuesListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Gets Azure services' emerging issues. - * @param options The options parameters. - */ - get( - options?: EmergingIssuesGetOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, getOperationSpec); - } - - /** - * Lists Azure services' emerging issues. - * @param options The options parameters. - */ - private _list( - options?: EmergingIssuesListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: EmergingIssuesListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.ResourceHealth/emergingIssues/{issueName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EmergingIssuesGetResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.issueName], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.ResourceHealth/emergingIssues", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EmergingIssueListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.EmergingIssueListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts index 7a0013d72250..aec7ca100dac 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operations/index.ts @@ -7,7 +7,4 @@ */ export * from "./availabilityStatuses"; -export * from "./childAvailabilityStatuses"; -export * from "./childResources"; export * from "./operations"; -export * from "./emergingIssues"; diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/availabilityStatuses.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/availabilityStatuses.ts index 5000227ffff5..525fd86aa5ad 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/availabilityStatuses.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/availabilityStatuses.ts @@ -20,16 +20,14 @@ import { /** Interface representing a AvailabilityStatuses. */ export interface AvailabilityStatuses { /** - * Lists the current availability status for all the resources in the subscription. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the subscription. * @param options The options parameters. */ listBySubscriptionId( options?: AvailabilityStatusesListBySubscriptionIdOptionalParams ): PagedAsyncIterableIterator; /** - * Lists the current availability status for all the resources in the resource group. Use the nextLink - * property in the response to get the next page of availability statuses. + * Lists the current availability status for all the resources in the resource group. * @param resourceGroupName The name of the resource group. * @param options The options parameters. */ @@ -38,8 +36,7 @@ export interface AvailabilityStatuses { options?: AvailabilityStatusesListByResourceGroupOptionalParams ): PagedAsyncIterableIterator; /** - * Lists all historical availability transitions and impacting events for a single resource. Use the - * nextLink property in the response to get the next page of availability status + * Lists all historical availability transitions and impacting events for a single resource. * @param resourceUri The fully qualified ID of the resource, including the resource name and resource * type. Currently the API support not nested and one nesting level resource types : * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childAvailabilityStatuses.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childAvailabilityStatuses.ts deleted file mode 100644 index d296779a9ed1..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childAvailabilityStatuses.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AvailabilityStatus, - ChildAvailabilityStatusesListOptionalParams, - ChildAvailabilityStatusesGetByResourceOptionalParams, - ChildAvailabilityStatusesGetByResourceResponse -} from "../models"; - -/// -/** Interface representing a ChildAvailabilityStatuses. */ -export interface ChildAvailabilityStatuses { - /** - * Lists the historical availability statuses for a single child resource. Use the nextLink property in - * the response to get the next page of availability status - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: ChildAvailabilityStatusesListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets current availability status for a single resource - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support one nesting level resource types : - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName} - * @param options The options parameters. - */ - getByResource( - resourceUri: string, - options?: ChildAvailabilityStatusesGetByResourceOptionalParams - ): Promise; -} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childResources.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childResources.ts deleted file mode 100644 index 330611cfd82a..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/childResources.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - AvailabilityStatus, - ChildResourcesListOptionalParams -} from "../models"; - -/// -/** Interface representing a ChildResources. */ -export interface ChildResources { - /** - * Lists the all the children and its current health status for a parent resource. Use the nextLink - * property in the response to get the next page of children current health - * @param resourceUri The fully qualified ID of the resource, including the resource name and resource - * type. Currently the API only support not nested parent resource type: - * /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name} - * @param options The options parameters. - */ - list( - resourceUri: string, - options?: ChildResourcesListOptionalParams - ): PagedAsyncIterableIterator; -} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts deleted file mode 100644 index b059382f09f3..000000000000 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/emergingIssues.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - EmergingIssuesGetResult, - EmergingIssuesListOptionalParams, - EmergingIssuesGetOptionalParams, - EmergingIssuesGetResponse -} from "../models"; - -/// -/** Interface representing a EmergingIssues. */ -export interface EmergingIssues { - /** - * Lists Azure services' emerging issues. - * @param options The options parameters. - */ - list( - options?: EmergingIssuesListOptionalParams - ): PagedAsyncIterableIterator; - /** - * Gets Azure services' emerging issues. - * @param options The options parameters. - */ - get( - options?: EmergingIssuesGetOptionalParams - ): Promise; -} diff --git a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts index 7a0013d72250..aec7ca100dac 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/operationsInterfaces/index.ts @@ -7,7 +7,4 @@ */ export * from "./availabilityStatuses"; -export * from "./childAvailabilityStatuses"; -export * from "./childResources"; export * from "./operations"; -export * from "./emergingIssues"; 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"