Skip to content
Merged
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
2 changes: 1 addition & 1 deletion sdk/managedops/arm-managedops/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0-beta.1 (2026-01-23)
## 1.0.0-beta.1 (2026-02-13)

### Features Added

Expand Down
7 changes: 4 additions & 3 deletions sdk/managedops/arm-managedops/metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"apiVersion": "2025-07-28-preview",
"emitterVersion": "0.48.0",
"emitterVersion": "0.49.0",
"crossLanguageDefinitions": {
"CrossLanguagePackageId": "Microsoft.ManagedOps",
"CrossLanguageDefinitionId": {
Expand Down Expand Up @@ -29,8 +29,9 @@
"@azure/arm-managedops!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData",
"@azure/arm-managedops!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus",
"@azure/arm-managedops!ManagedOpListResult:interface": "Azure.ResourceManager.ResourceListResult",
"@azure/arm-managedops!ManagedOpUpdate:interface": "Azure.ResourceManager.Foundations.ResourceUpdateModel",
"@azure/arm-managedops!ManagedOpUpdateProperties:interface": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties",
"@azure/arm-managedops!ManagedOpUpdate:interface": "Microsoft.ManagedOps.ManagedOpUpdate",
"@azure/arm-managedops!ManagedOpUpdateProperties:interface": "Microsoft.ManagedOps.ManagedOpUpdateProperties",
"@azure/arm-managedops!DesiredConfigurationUpdate:interface": "Microsoft.ManagedOps.DesiredConfigurationUpdate",
"@azure/arm-managedops!KnownOrigin:enum": "Azure.ResourceManager.CommonTypes.Origin",
"@azure/arm-managedops!KnownActionType:enum": "Azure.ResourceManager.CommonTypes.ActionType",
"@azure/arm-managedops!KnownProvisioningState:enum": "Microsoft.ManagedOps.ProvisioningState",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface ManagedOpsClientOptionalParams extends ClientOptions {

// @public
export interface ManagedOpsContext extends Client {
apiVersion: string;
apiVersion?: string;
subscriptionId: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export interface DesiredConfiguration {
userAssignedManagedIdentityId: string;
}

// @public
export interface DesiredConfigurationUpdate {
defenderCspm?: string;
defenderForServers?: string;
}

// @public
export interface ErrorAdditionalInfo {
readonly info?: any;
Expand Down Expand Up @@ -131,7 +137,7 @@ export interface ManagedOpUpdate {

// @public
export interface ManagedOpUpdateProperties {
desiredConfiguration?: DesiredConfiguration;
desiredConfiguration?: DesiredConfigurationUpdate;
}

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ export interface DesiredConfiguration {
userAssignedManagedIdentityId: string;
}

// @public
export interface DesiredConfigurationUpdate {
defenderCspm?: string;
defenderForServers?: string;
}

// @public
export interface ErrorAdditionalInfo {
readonly info?: any;
Expand Down Expand Up @@ -201,7 +207,7 @@ export interface ManagedOpUpdate {

// @public
export interface ManagedOpUpdateProperties {
desiredConfiguration?: DesiredConfiguration;
desiredConfiguration?: DesiredConfigurationUpdate;
}

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ async function managedOpsCreateOrUpdate(): Promise<void> {
const client = new ManagedOpsClient(credential, subscriptionId);
const result = await client.managedOps.createOrUpdate("default", {
properties: {
sku: { name: "ManagedOps", tier: "Essential" },
desiredConfiguration: {
changeTrackingAndInventory: {
logAnalyticsWorkspaceId:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ async function managedOpsCreateOrUpdate() {
const client = new ManagedOpsClient(credential, subscriptionId);
const result = await client.managedOps.createOrUpdate("default", {
properties: {
sku: { name: "ManagedOps", tier: "Essential" },
desiredConfiguration: {
changeTrackingAndInventory: {
logAnalyticsWorkspaceId:
Expand Down
23 changes: 15 additions & 8 deletions sdk/managedops/arm-managedops/src/api/managedOps/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function _$deleteSend(
{
subscriptionId: context.subscriptionId,
managedOpsName: managedOpsName,
"api%2Dversion": context.apiVersion,
"api%2Dversion": context.apiVersion ?? "2025-07-28-preview",
},
{
allowReserved: options?.requestOptions?.skipUrlEncoding,
Expand All @@ -45,7 +45,7 @@ export function _$deleteSend(
}

export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void> {
const expectedStatuses = ["202", "204", "200", "201"];
const expectedStatuses = ["202", "204", "200"];
if (!expectedStatuses.includes(result.status)) {
const error = createRestError(result);
error.details = errorResponseDeserializer(result.body);
Expand All @@ -66,11 +66,12 @@ export function $delete(
managedOpsName: string,
options: ManagedOpsDeleteOptionalParams = { requestOptions: {} },
): PollerLike<OperationState<void>, void> {
return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200", "201"], {
return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], {
updateIntervalInMs: options?.updateIntervalInMs,
abortSignal: options?.abortSignal,
getInitialResponse: () => _$deleteSend(context, managedOpsName, options),
resourceLocationConfig: "location",
apiVersion: context.apiVersion ?? "2025-07-28-preview",
}) as PollerLike<OperationState<void>, void>;
}

Expand All @@ -85,7 +86,7 @@ export function _updateSend(
{
subscriptionId: context.subscriptionId,
managedOpsName: managedOpsName,
"api%2Dversion": context.apiVersion,
"api%2Dversion": context.apiVersion ?? "2025-07-28-preview",
},
{
allowReserved: options?.requestOptions?.skipUrlEncoding,
Expand Down Expand Up @@ -122,6 +123,7 @@ export function update(
abortSignal: options?.abortSignal,
getInitialResponse: () => _updateSend(context, managedOpsName, properties, options),
resourceLocationConfig: "location",
apiVersion: context.apiVersion ?? "2025-07-28-preview",
}) as PollerLike<OperationState<ManagedOp>, ManagedOp>;
}

Expand All @@ -133,7 +135,7 @@ export function _listSend(
"/subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps{?api%2Dversion}",
{
subscriptionId: context.subscriptionId,
"api%2Dversion": context.apiVersion,
"api%2Dversion": context.apiVersion ?? "2025-07-28-preview",
},
{
allowReserved: options?.requestOptions?.skipUrlEncoding,
Expand Down Expand Up @@ -168,7 +170,11 @@ export function list(
() => _listSend(context, options),
_listDeserialize,
["200"],
{ itemName: "value", nextLinkName: "nextLink" },
{
itemName: "value",
nextLinkName: "nextLink",
apiVersion: context.apiVersion ?? "2025-07-28-preview",
},
);
}

Expand All @@ -183,7 +189,7 @@ export function _createOrUpdateSend(
{
subscriptionId: context.subscriptionId,
managedOpsName: managedOpsName,
"api%2Dversion": context.apiVersion,
"api%2Dversion": context.apiVersion ?? "2025-07-28-preview",
},
{
allowReserved: options?.requestOptions?.skipUrlEncoding,
Expand Down Expand Up @@ -222,6 +228,7 @@ export function createOrUpdate(
abortSignal: options?.abortSignal,
getInitialResponse: () => _createOrUpdateSend(context, managedOpsName, resource, options),
resourceLocationConfig: "azure-async-operation",
apiVersion: context.apiVersion ?? "2025-07-28-preview",
}) as PollerLike<OperationState<ManagedOp>, ManagedOp>;
}

Expand All @@ -235,7 +242,7 @@ export function _getSend(
{
subscriptionId: context.subscriptionId,
managedOpsName: managedOpsName,
"api%2Dversion": context.apiVersion,
"api%2Dversion": context.apiVersion ?? "2025-07-28-preview",
},
{
allowReserved: options?.requestOptions?.skipUrlEncoding,
Expand Down
24 changes: 4 additions & 20 deletions sdk/managedops/arm-managedops/src/api/managedOpsContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import type { TokenCredential } from "@azure/core-auth";

/** Managed Operations API. */
export interface ManagedOpsContext extends Client {
/** The API version to use for this operation. */
/** Known values of {@link KnownVersions} that the service accepts. */
apiVersion: string;
/** The ID of the target subscription. The value must be an UUID. */
subscriptionId: string;
/** The API version to use for this operation. */
/** Known values of {@link KnownVersions} that the service accepts. */
apiVersion?: string;
}

/** Optional parameters for the client. */
Expand Down Expand Up @@ -47,22 +47,6 @@ export function createManagedOps(
credentials: { scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`] },
};
const clientContext = getClient(endpointUrl, credential, updatedOptions);
clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" });
const apiVersion = options.apiVersion ?? "2025-07-28-preview";
clientContext.pipeline.addPolicy({
name: "ClientApiVersionPolicy",
sendRequest: (req, next) => {
// Use the apiVersion defined in request url directly
// Append one if there is no apiVersion and we have one at client options
const url = new URL(req.url);
if (!url.searchParams.get("api-version")) {
req.url = `${req.url}${
Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"
}api-version=${apiVersion}`;
}

return next(req);
},
});
const apiVersion = options.apiVersion;
return { ...clientContext, apiVersion, subscriptionId } as ManagedOpsContext;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function _listSend(
const path = expandUrlTemplate(
"/providers/Microsoft.ManagedOps/operations{?api%2Dversion}",
{
"api%2Dversion": context.apiVersion,
"api%2Dversion": context.apiVersion ?? "2025-07-28-preview",
},
{
allowReserved: options?.requestOptions?.skipUrlEncoding,
Expand Down Expand Up @@ -56,6 +56,10 @@ export function list(
() => _listSend(context, options),
_listDeserialize,
["200"],
{ itemName: "value", nextLinkName: "nextLink" },
{
itemName: "value",
nextLinkName: "nextLink",
apiVersion: context.apiVersion ?? "2025-07-28-preview",
},
);
}
1 change: 1 addition & 0 deletions sdk/managedops/arm-managedops/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export {
CreatedByType,
ManagedOpUpdate,
ManagedOpUpdateProperties,
DesiredConfigurationUpdate,
KnownVersions,
} from "./models/index.js";
export { ManagedOpsClientOptionalParams } from "./api/index.js";
Expand Down
1 change: 1 addition & 0 deletions sdk/managedops/arm-managedops/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ export {
CreatedByType,
ManagedOpUpdate,
ManagedOpUpdateProperties,
DesiredConfigurationUpdate,
KnownVersions,
} from "./models.js";
22 changes: 17 additions & 5 deletions sdk/managedops/arm-managedops/src/models/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,9 @@ export function managedOpArrayDeserializer(result: Array<ManagedOp>): any[] {
});
}

/** The type used for update operations of the ManagedOp. */
/** ManagedOps model for update operations */
export interface ManagedOpUpdate {
/** The resource-specific properties for this resource. */
/** Updatable properties in the ManagedOps resource. */
properties?: ManagedOpUpdateProperties;
}

Expand All @@ -618,20 +618,32 @@ export function managedOpUpdateSerializer(item: ManagedOpUpdate): any {
};
}

/** The updatable properties of the ManagedOp. */
/** Updatable properties in the ManagedOps resource. */
export interface ManagedOpUpdateProperties {
/** Desired configuration input by the user. */
desiredConfiguration?: DesiredConfiguration;
desiredConfiguration?: DesiredConfigurationUpdate;
}

export function managedOpUpdatePropertiesSerializer(item: ManagedOpUpdateProperties): any {
return {
desiredConfiguration: !item["desiredConfiguration"]
? item["desiredConfiguration"]
: desiredConfigurationSerializer(item["desiredConfiguration"]),
: desiredConfigurationUpdateSerializer(item["desiredConfiguration"]),
};
}

/** Updatable parameters in the Desired configuration input. */
export interface DesiredConfigurationUpdate {
/** Desired enablement state of the Defender For Servers service. */
defenderForServers?: string;
/** Desired enablement state of the Defender Cloud Security Posture Management (CSPM) service. */
defenderCspm?: string;
}

export function desiredConfigurationUpdateSerializer(item: DesiredConfigurationUpdate): any {
return { defenderForServers: item["defenderForServers"], defenderCspm: item["defenderCspm"] };
}

/** Known values of {@link Versions} that the service accepts. */
export enum KnownVersions {
/** 2025-07-28-preview */
Expand Down
9 changes: 8 additions & 1 deletion sdk/managedops/arm-managedops/src/restorePollerHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function restorePoller<TResponse extends PathUncheckedResponse, TResult>(
`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,
);
}
const apiVersion = getApiVersionFromUrl(initialRequestUrl);
return getLongRunningPoller(
(client as any)["_client"] ?? client,
deserializeHelper as (result: TResponse) => Promise<TResult>,
Expand All @@ -66,6 +67,7 @@ export function restorePoller<TResponse extends PathUncheckedResponse, TResult>(
resourceLocationConfig,
restoreFrom: serializedState,
initialRequestUrl,
apiVersion,
},
);
}
Expand All @@ -77,7 +79,7 @@ interface DeserializationHelper {

const deserializeMap: Record<string, DeserializationHelper> = {
"DELETE /subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps/{managedOpsName}":
{ deserializer: _$deleteDeserialize, expectedStatuses: ["202", "204", "200", "201"] },
{ deserializer: _$deleteDeserialize, expectedStatuses: ["202", "204", "200"] },
"PATCH /subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps/{managedOpsName}":
{ deserializer: _updateDeserialize, expectedStatuses: ["200", "202", "201"] },
"PUT /subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps/{managedOpsName}":
Expand Down Expand Up @@ -153,3 +155,8 @@ function getPathFromMapKey(mapKey: string): string {
const pathStart = mapKey.indexOf("/");
return mapKey.slice(pathStart);
}

function getApiVersionFromUrl(urlStr: string): string | undefined {
const url = new URL(urlStr);
return url.searchParams.get("api-version") ?? undefined;
}
Loading