Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test norm enum pr for first ga package #31915

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions sdk/computefleet/arm-computefleet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Release History

## 1.0.1 (Unreleased)

## 2.0.0 (2024-11-25)
### Features Added

### Breaking Changes
- Added Enum KnownVersions
- Enum KnownNetworkApiVersion has a new value V2020_11_01
- Enum KnownStorageAccountTypes has a new value PremiumV2_LRS

### Bugs Fixed

### Other Changes
### Breaking Changes

- Enum KnownNetworkApiVersion no longer has value V20201101
- Enum KnownStorageAccountTypes no longer has value PremiumV2LRS


## 1.0.0 (2024-10-21)

### Features Added
Expand Down
10 changes: 1 addition & 9 deletions sdk/computefleet/arm-computefleet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/arm-computefleet",
"version": "1.0.1",
"version": "2.0.0",
"description": "Azure Fleet Service",
"engines": {
"node": ">=18.0.0"
Expand Down Expand Up @@ -116,44 +116,36 @@
"./package.json": "./package.json",
".": {
"browser": {
"source": "./src/index.ts",
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"source": "./src/index.ts",
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"source": "./src/index.ts",
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"source": "./src/index.ts",
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
},
"./models": {
"browser": {
"source": "./src/models/index.ts",
"types": "./dist/browser/models/index.d.ts",
"default": "./dist/browser/models/index.js"
},
"react-native": {
"source": "./src/models/index.ts",
"types": "./dist/react-native/models/index.d.ts",
"default": "./dist/react-native/models/index.js"
},
"import": {
"source": "./src/models/index.ts",
"types": "./dist/esm/models/index.d.ts",
"default": "./dist/esm/models/index.js"
},
"require": {
"source": "./src/models/index.ts",
"types": "./dist/commonjs/models/index.d.ts",
"default": "./dist/commonjs/models/index.js"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export enum KnownMode {

// @public
export enum KnownNetworkApiVersion {
V20201101 = "2020-11-01"
V2020_11_01 = "2020-11-01"
}

// @public
Expand Down Expand Up @@ -453,14 +453,19 @@ export enum KnownSpotAllocationStrategy {
// @public
export enum KnownStorageAccountTypes {
PremiumLRS = "Premium_LRS",
PremiumV2LRS = "PremiumV2_LRS",
PremiumV2_LRS = "PremiumV2_LRS",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PremiumZRS = "Premium_ZRS",
StandardLRS = "Standard_LRS",
StandardSSDLRS = "StandardSSD_LRS",
StandardSSDZRS = "StandardSSD_ZRS",
UltraSSDLRS = "UltraSSD_LRS"
}

// @public
export enum KnownVersions {
V2024_11_01 = "2024-11-01"
}

// @public
export enum KnownVMAttributeSupport {
Excluded = "Excluded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ export enum KnownMode {

// @public
export enum KnownNetworkApiVersion {
V20201101 = "2020-11-01"
V2020_11_01 = "2020-11-01"
}

// @public
Expand Down Expand Up @@ -522,14 +522,19 @@ export enum KnownSpotAllocationStrategy {
// @public
export enum KnownStorageAccountTypes {
PremiumLRS = "Premium_LRS",
PremiumV2LRS = "PremiumV2_LRS",
PremiumV2_LRS = "PremiumV2_LRS",
PremiumZRS = "Premium_ZRS",
StandardLRS = "Standard_LRS",
StandardSSDLRS = "StandardSSD_LRS",
StandardSSDZRS = "StandardSSD_ZRS",
UltraSSDLRS = "UltraSSD_LRS"
}

// @public
export enum KnownVersions {
V2024_11_01 = "2024-11-01"
}

// @public
export enum KnownVMAttributeSupport {
Excluded = "Excluded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

import { logger } from "../logger.js";
import { KnownVersions } from "../models/models.js";
import { Client, ClientOptions, getClient } from "@azure-rest/core-client";
import { TokenCredential } from "@azure/core-auth";

Expand All @@ -10,17 +11,18 @@ export interface AzureFleetContext extends Client {}
/** Optional parameters for the client. */
export interface AzureFleetClientOptionalParams extends ClientOptions {
/** The API version to use for this operation. */
/** Known values of {@link KnownVersions} that the service accepts. */
apiVersion?: string;
}

export function createAzureFleet(
credential: TokenCredential,
options: AzureFleetClientOptionalParams = {},
): AzureFleetContext {
const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://management.azure.com`;

const endpointUrl =
options.endpoint ?? options.baseUrl ?? `https://management.azure.com`;
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
const userAgentInfo = `azsdk-js-arm-computefleet/1.0.1`;
const userAgentInfo = `azsdk-js-arm-computefleet/1.0.0-beta.1`;
const userAgentPrefix = prefixFromOptions
? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
: `azsdk-js-api ${userAgentInfo}`;
Expand Down
111 changes: 77 additions & 34 deletions sdk/computefleet/arm-computefleet/src/api/fleets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import {
_virtualMachineScaleSetListResultDeserializer,
VirtualMachineScaleSet,
} from "../../models/models.js";
import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js";
import {
PagedAsyncIterableIterator,
buildPagedAsyncIterator,
} from "../../static-helpers/pagingHelpers.js";
import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js";
import {
StreamableMethod,
PathUncheckedResponse,
Expand All @@ -53,7 +53,9 @@ export function _fleetsGetSend(
.get({ ...operationOptionsToRequestParameters(options) });
}

export async function _fleetsGetDeserialize(result: PathUncheckedResponse): Promise<Fleet> {
export async function _fleetsGetDeserialize(
result: PathUncheckedResponse,
): Promise<Fleet> {
const expectedStatuses = ["200"];
if (!expectedStatuses.includes(result.status)) {
throw createRestError(result);
Expand Down Expand Up @@ -121,20 +123,25 @@ export function fleetsCreateOrUpdate(
resource: Fleet,
options: FleetsCreateOrUpdateOptionalParams = { requestOptions: {} },
): PollerLike<OperationState<Fleet>, Fleet> {
return getLongRunningPoller(context, _fleetsCreateOrUpdateDeserialize, ["200", "201"], {
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_fleetsCreateOrUpdateSend(
context,
subscriptionId,
resourceGroupName,
fleetName,
resource,
options,
),
resourceLocationConfig: "azure-async-operation",
}) as PollerLike<OperationState<Fleet>, Fleet>;
return getLongRunningPoller(
context,
_fleetsCreateOrUpdateDeserialize,
["200", "201"],
{
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_fleetsCreateOrUpdateSend(
context,
subscriptionId,
resourceGroupName,
fleetName,
resource,
options,
),
resourceLocationConfig: "azure-async-operation",
},
) as PollerLike<OperationState<Fleet>, Fleet>;
}

export function _fleetsUpdateSend(
Expand All @@ -158,7 +165,9 @@ export function _fleetsUpdateSend(
});
}

export async function _fleetsUpdateDeserialize(result: PathUncheckedResponse): Promise<Fleet> {
export async function _fleetsUpdateDeserialize(
result: PathUncheckedResponse,
): Promise<Fleet> {
const expectedStatuses = ["200", "202"];
if (!expectedStatuses.includes(result.status)) {
throw createRestError(result);
Expand All @@ -176,13 +185,25 @@ export function fleetsUpdate(
properties: FleetUpdate,
options: FleetsUpdateOptionalParams = { requestOptions: {} },
): PollerLike<OperationState<Fleet>, Fleet> {
return getLongRunningPoller(context, _fleetsUpdateDeserialize, ["200", "202"], {
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_fleetsUpdateSend(context, subscriptionId, resourceGroupName, fleetName, properties, options),
resourceLocationConfig: "location",
}) as PollerLike<OperationState<Fleet>, Fleet>;
return getLongRunningPoller(
context,
_fleetsUpdateDeserialize,
["200", "202"],
{
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_fleetsUpdateSend(
context,
subscriptionId,
resourceGroupName,
fleetName,
properties,
options,
),
resourceLocationConfig: "location",
},
) as PollerLike<OperationState<Fleet>, Fleet>;
}

export function _fleetsDeleteSend(
Expand All @@ -202,7 +223,9 @@ export function _fleetsDeleteSend(
.delete({ ...operationOptionsToRequestParameters(options) });
}

export async function _fleetsDeleteDeserialize(result: PathUncheckedResponse): Promise<void> {
export async function _fleetsDeleteDeserialize(
result: PathUncheckedResponse,
): Promise<void> {
const expectedStatuses = ["202", "204", "200"];
if (!expectedStatuses.includes(result.status)) {
throw createRestError(result);
Expand All @@ -219,13 +242,24 @@ export function fleetsDelete(
fleetName: string,
options: FleetsDeleteOptionalParams = { requestOptions: {} },
): PollerLike<OperationState<void>, void> {
return getLongRunningPoller(context, _fleetsDeleteDeserialize, ["202", "204", "200"], {
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_fleetsDeleteSend(context, subscriptionId, resourceGroupName, fleetName, options),
resourceLocationConfig: "location",
}) as PollerLike<OperationState<void>, void>;
return getLongRunningPoller(
context,
_fleetsDeleteDeserialize,
["202", "204", "200"],
{
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () =>
_fleetsDeleteSend(
context,
subscriptionId,
resourceGroupName,
fleetName,
options,
),
resourceLocationConfig: "location",
},
) as PollerLike<OperationState<void>, void>;
}

export function _fleetsListByResourceGroupSend(
Expand Down Expand Up @@ -263,7 +297,13 @@ export function fleetsListByResourceGroup(
): PagedAsyncIterableIterator<Fleet> {
return buildPagedAsyncIterator(
context,
() => _fleetsListByResourceGroupSend(context, subscriptionId, resourceGroupName, options),
() =>
_fleetsListByResourceGroupSend(
context,
subscriptionId,
resourceGroupName,
options,
),
_fleetsListByResourceGroupDeserialize,
["200"],
{ itemName: "value", nextLinkName: "nextLink" },
Expand All @@ -276,7 +316,10 @@ export function _fleetsListBySubscriptionSend(
options: FleetsListBySubscriptionOptionalParams = { requestOptions: {} },
): StreamableMethod {
return context
.path("/subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets", subscriptionId)
.path(
"/subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets",
subscriptionId,
)
.get({ ...operationOptionsToRequestParameters(options) });
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { AzureFleetContext as Client, OperationsListOptionalParams } from "../index.js";
import {
AzureFleetContext as Client,
OperationsListOptionalParams,
} from "../index.js";
import {
_OperationListResult,
_operationListResultDeserializer,
Expand Down
9 changes: 6 additions & 3 deletions sdk/computefleet/arm-computefleet/src/api/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ export interface FleetsDeleteOptionalParams extends OperationOptions {
}

/** Optional parameters. */
export interface FleetsListByResourceGroupOptionalParams extends OperationOptions {}
export interface FleetsListByResourceGroupOptionalParams
extends OperationOptions {}

/** Optional parameters. */
export interface FleetsListBySubscriptionOptionalParams extends OperationOptions {}
export interface FleetsListBySubscriptionOptionalParams
extends OperationOptions {}

/** Optional parameters. */
export interface FleetsListVirtualMachineScaleSetsOptionalParams extends OperationOptions {}
export interface FleetsListVirtualMachineScaleSetsOptionalParams
extends OperationOptions {}
Loading
Loading