diff --git a/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md b/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md index b080f1870b5f..3439111ba8a3 100644 --- a/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md +++ b/sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md @@ -1,15 +1,26 @@ # Release History + +## 5.0.0-beta.1 (2023-09-06) + +**Features** -## 4.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added Type Alias EventSubTypeValues + - Interface Event_2 has a new optional parameter argQuery + - Interface Event_2 has a new optional parameter eventSubType + - Interface Event_2 has a new optional parameter maintenanceId + - Interface Event_2 has a new optional parameter maintenanceType + - Interface EventImpactedResource has a new optional parameter maintenanceEndTime + - Interface EventImpactedResource has a new optional parameter maintenanceStartTime + - Interface EventImpactedResource has a new optional parameter resourceGroup + - Interface EventImpactedResource has a new optional parameter resourceName + - Interface EventImpactedResource has a new optional parameter status + - Added Enum KnownEventSubTypeValues -### Other Changes +**Breaking Changes** + - Class MicrosoftResourceHealth has a new signature + + ## 4.0.0 (2023-05-12) **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 0fcb29de6f68..889818aacfa1 100644 --- a/sdk/resourcehealth/arm-resourcehealth/_meta.json +++ b/sdk/resourcehealth/arm-resourcehealth/_meta.json @@ -1,8 +1,8 @@ { - "commit": "1c3433247689aa55d7ecdd213505dc28c035f2b9", + "commit": "cf125719502a6ec76f08f93226156e9cfdc1bc1c", "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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resourcehealth\\resource-manager\\readme.md --use=@autorest/typescript@6.0.1 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --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.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/resourcehealth/arm-resourcehealth/package.json b/sdk/resourcehealth/arm-resourcehealth/package.json index e0eb61f53ce8..0eddd748c405 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": "4.0.1", + "version": "5.0.0-beta.1", "engines": { "node": ">=14.0.0" }, @@ -11,7 +11,7 @@ "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -46,8 +46,8 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0" + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -110,13 +110,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 2fe1bc4e41d9..e09c298d90ca 100644 --- a/sdk/resourcehealth/arm-resourcehealth/review/arm-resourcehealth.api.md +++ b/sdk/resourcehealth/arm-resourcehealth/review/arm-resourcehealth.api.md @@ -234,6 +234,7 @@ export interface ErrorResponse { // @public interface Event_2 extends ProxyResource { additionalInformation?: EventPropertiesAdditionalInformation; + argQuery?: string; article?: EventPropertiesArticle; description?: string; duration?: number; @@ -241,6 +242,7 @@ interface Event_2 extends ProxyResource { enableMicrosoftSupport?: boolean; eventLevel?: EventLevelValues; eventSource?: EventSourceValues; + eventSubType?: EventSubTypeValues; eventType?: EventTypeValues; externalIncidentId?: string; faqs?: Faq[]; @@ -254,6 +256,8 @@ interface Event_2 extends ProxyResource { lastUpdateTime?: Date; level?: LevelValues; links?: Link[]; + maintenanceId?: string; + maintenanceType?: string; platformInitiated?: boolean; priority?: number; reason?: string; @@ -299,6 +303,11 @@ export type EventGetByTenantIdAndTrackingIdResponse = Event_2; // @public export interface EventImpactedResource extends ProxyResource { info?: KeyValueItem[]; + readonly maintenanceEndTime?: string; + readonly maintenanceStartTime?: string; + readonly resourceGroup?: string; + readonly resourceName?: string; + readonly status?: string; readonly targetRegion?: string; readonly targetResourceId?: string; readonly targetResourceType?: string; @@ -412,6 +421,9 @@ export type EventSourceValues = string; // @public export type EventStatusValues = string; +// @public +export type EventSubTypeValues = string; + // @public export type EventTypeValues = string; @@ -553,6 +565,11 @@ export enum KnownEventStatusValues { Resolved = "Resolved" } +// @public +export enum KnownEventSubTypeValues { + Retirement = "Retirement" +} + // @public export enum KnownEventTypeValues { EmergingIssues = "EmergingIssues", @@ -686,6 +703,7 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftResourceHealthOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: MicrosoftResourceHealthOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -709,7 +727,7 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { // (undocumented) securityAdvisoryImpactedResources: SecurityAdvisoryImpactedResources; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public diff --git a/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts b/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts index 8b0b0805029f..9a014d30b965 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/microsoftResourceHealth.ts @@ -43,7 +43,7 @@ import { MicrosoftResourceHealthOptionalParams } from "./models"; export class MicrosoftResourceHealth extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the MicrosoftResourceHealth class. @@ -55,12 +55,26 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftResourceHealthOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: MicrosoftResourceHealthOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: MicrosoftResourceHealthOptionalParams | string, + options?: MicrosoftResourceHealthOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -72,7 +86,7 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-resourcehealth/4.0.1`; + const packageDetails = `azsdk-js-arm-resourcehealth/5.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -125,7 +139,7 @@ export class MicrosoftResourceHealth extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-10-01"; + this.apiVersion = options.apiVersion || "2023-07-01-preview"; this.availabilityStatuses = new AvailabilityStatusesImpl(this); this.operations = new OperationsImpl(this); this.metadata = new MetadataImpl(this); diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts index 92b42f4b0a75..2c805f42c403 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/models/index.ts @@ -453,6 +453,31 @@ export interface EventImpactedResource extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly targetRegion?: string; + /** + * Resource name of the impacted resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceName?: string; + /** + * Resource group name of the impacted resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceGroup?: string; + /** + * Status of the impacted resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * Start time of maintenance for the impacted resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maintenanceStartTime?: string; + /** + * End time of maintenance for the impacted resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maintenanceEndTime?: string; /** Additional information. */ info?: KeyValueItem[]; } @@ -461,6 +486,8 @@ export interface EventImpactedResource extends ProxyResource { export interface Event extends ProxyResource { /** Type of event. */ eventType?: EventTypeValues; + /** Sub type of the event. Currently used to determine retirement communications for health advisory events */ + eventSubType?: EventSubTypeValues; /** Source of event. */ eventSource?: EventSourceValues; /** Current status of event. */ @@ -515,6 +542,12 @@ export interface Event extends ProxyResource { duration?: number; /** The type of the impact */ impactType?: string; + /** Unique identifier for planned maintenance event. */ + maintenanceId?: string; + /** The type of planned maintenance event. */ + maintenanceType?: string; + /** Azure Resource Graph query to fetch the affected resources from their existing Azure Resource Graph locations. */ + argQuery?: string; } /** The Get EmergingIssues operation response. */ @@ -652,6 +685,21 @@ export enum KnownEventTypeValues { */ export type EventTypeValues = string; +/** Known values of {@link EventSubTypeValues} that the service accepts. */ +export enum KnownEventSubTypeValues { + /** Retirement */ + Retirement = "Retirement" +} + +/** + * Defines values for EventSubTypeValues. \ + * {@link KnownEventSubTypeValues} can be used interchangeably with EventSubTypeValues, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Retirement** + */ +export type EventSubTypeValues = string; + /** Known values of {@link EventSourceValues} that the service accepts. */ export enum KnownEventSourceValues { /** ResourceHealth */ diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts index 6ee8e9eb11d0..1adb39226f8a 100644 --- a/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts +++ b/sdk/resourcehealth/arm-resourcehealth/src/models/mappers.ts @@ -1265,6 +1265,41 @@ export const EventImpactedResource: coreClient.CompositeMapper = { name: "String" } }, + resourceName: { + serializedName: "properties.resourceName", + readOnly: true, + type: { + name: "String" + } + }, + resourceGroup: { + serializedName: "properties.resourceGroup", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String" + } + }, + maintenanceStartTime: { + serializedName: "properties.maintenanceStartTime", + readOnly: true, + type: { + name: "String" + } + }, + maintenanceEndTime: { + serializedName: "properties.maintenanceEndTime", + readOnly: true, + type: { + name: "String" + } + }, info: { serializedName: "properties.info", type: { @@ -1293,6 +1328,12 @@ export const Event: coreClient.CompositeMapper = { name: "String" } }, + eventSubType: { + serializedName: "properties.eventSubType", + type: { + name: "String" + } + }, eventSource: { serializedName: "properties.eventSource", type: { @@ -1475,6 +1516,24 @@ export const Event: coreClient.CompositeMapper = { type: { name: "String" } + }, + maintenanceId: { + serializedName: "properties.maintenanceId", + type: { + name: "String" + } + }, + maintenanceType: { + serializedName: "properties.maintenanceType", + type: { + name: "String" + } + }, + argQuery: { + serializedName: "properties.argQuery", + type: { + name: "String" + } } } } diff --git a/sdk/resourcehealth/arm-resourcehealth/src/models/parameters.ts b/sdk/resourcehealth/arm-resourcehealth/src/models/parameters.ts index d9cf79fdfa88..3755d69daf68 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: "2022-10-01", + defaultValue: "2023-07-01-preview", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/resourcehealth/arm-resourcehealth/test/sampleTest.ts b/sdk/resourcehealth/arm-resourcehealth/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/resourcehealth/arm-resourcehealth/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); 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"