diff --git a/rush.json b/rush.json index c2212cca7499..c80162e6766c 100644 --- a/rush.json +++ b/rush.json @@ -1,8 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ -{ + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -556,7 +555,9 @@ "projectFolder": "common/tools/dev-tool", "versionPolicyName": "utility", // Add Identity to decoupledLocalDependencies so that dev-tool uses the package from npm, avoiding a cyclic dependency. - "decoupledLocalDependencies": ["@azure/identity"] + "decoupledLocalDependencies": [ + "@azure/identity" + ] }, { "packageName": "@azure/eventgrid", @@ -596,7 +597,9 @@ { "packageName": "@azure/identity", "projectFolder": "sdk/identity/identity", - "decoupledLocalDependencies": ["@azure/keyvault-keys"], + "decoupledLocalDependencies": [ + "@azure/keyvault-keys" + ], "versionPolicyName": "client" }, { @@ -2333,6 +2336,11 @@ "packageName": "@azure/arm-weightsandbiases", "projectFolder": "sdk/liftrweightsandbiases/arm-weightsandbiases", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-mission", + "projectFolder": "sdk/mission/arm-mission", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/mission/arm-mission/LICENSE b/sdk/mission/arm-mission/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/mission/arm-mission/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/mission/arm-mission/README.md b/sdk/mission/arm-mission/README.md new file mode 100644 index 000000000000..ea412c2464c4 --- /dev/null +++ b/sdk/mission/arm-mission/README.md @@ -0,0 +1,114 @@ +# Azure mission client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure mission client. + +Microsoft Mission Resource Provider management API. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mission/arm-mission) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-mission) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-mission?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-mission` package + +Install the Azure mission client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-mission +``` + +### Create and authenticate a `MissionClient` + +To create a client object to access the Azure mission API, you will need the `endpoint` of your Azure mission resource and a `credential`. The Azure mission client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure mission resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure mission** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). + +For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. + +```ts snippet:ReadmeSampleCreateClient_Node +import { MissionClient } from "@azure/arm-mission"; +import { DefaultAzureCredential } from "@azure/identity"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new MissionClient(new DefaultAzureCredential(), subscriptionId); +``` + +For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. + +```ts snippet:ReadmeSampleCreateClient_Browser +import { InteractiveBrowserCredential } from "@azure/identity"; +import { MissionClient } from "@azure/arm-mission"; + +const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "" + }); +const client = new MissionClient(credential, subscriptionId); +``` + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### MissionClient + +`MissionClient` is the primary interface for developers using the Azure mission client library. Explore the methods on this client object to understand the different features of the Azure mission service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```ts snippet:SetLogLevel +import { setLogLevel } from "@azure/logger"; + +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + + +[azure_cli]: https://learn.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/mission/arm-mission/api-extractor.json b/sdk/mission/arm-mission/api-extractor.json new file mode 100644 index 000000000000..67c3b1c7b2e0 --- /dev/null +++ b/sdk/mission/arm-mission/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-mission.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/mission/arm-mission/package.json b/sdk/mission/arm-mission/package.json new file mode 100644 index 000000000000..2ef0600d0205 --- /dev/null +++ b/sdk/mission/arm-mission/package.json @@ -0,0 +1,107 @@ +{ + "name": "@azure/arm-mission", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for MissionClient.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=18.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-mission.d.ts", + "devDependencies": { + "typescript": "~5.8.2", + "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^4.2.1", + "@azure/logger": "^1.1.4", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^11.0.2", + "@types/mocha": "^10.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", + "update-snippets": "dev-tool run update-snippets" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/missionClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mission/arm-mission" +} \ No newline at end of file diff --git a/sdk/mission/arm-mission/sample.env b/sdk/mission/arm-mission/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/mission/arm-mission/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/mission/arm-mission/src/index.ts b/sdk/mission/arm-mission/src/index.ts new file mode 100644 index 000000000000..7c45c975c008 --- /dev/null +++ b/sdk/mission/arm-mission/src/index.ts @@ -0,0 +1,13 @@ +/* + * 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. + */ + +/// +export { getContinuationToken } from "./pagingHelper"; +export * from "./models"; +export { MissionClient } from "./missionClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/mission/arm-mission/src/lroImpl.ts b/sdk/mission/arm-mission/src/lroImpl.ts new file mode 100644 index 000000000000..5f88efab981b --- /dev/null +++ b/sdk/mission/arm-mission/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike }, + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; +} diff --git a/sdk/mission/arm-mission/src/missionClient.ts b/sdk/mission/arm-mission/src/missionClient.ts new file mode 100644 index 000000000000..6eaa58accf7b --- /dev/null +++ b/sdk/mission/arm-mission/src/missionClient.ts @@ -0,0 +1,191 @@ +/* + * 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 * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { + ApprovalImpl, + OperationsImpl, + CommunityImpl, + CommunityEndpointsImpl, + TransitHubImpl, + EnclaveConnectionImpl, + VirtualEnclaveImpl, + EnclaveEndpointsImpl, + WorkloadImpl, +} from "./operations"; +import { + Approval, + Operations, + Community, + CommunityEndpoints, + TransitHub, + EnclaveConnection, + VirtualEnclave, + EnclaveEndpoints, + Workload, +} from "./operationsInterfaces"; +import { MissionClientOptionalParams } from "./models"; + +export class MissionClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId?: string; + + /** + * Initializes a new instance of the MissionClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: MissionClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: MissionClientOptionalParams, + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: MissionClientOptionalParams | string, + options?: MissionClientOptionalParams, + ) { + if (credentials === undefined) { + throw new Error("'credentials' 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 + if (!options) { + options = {}; + } + const defaults: MissionClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials, + }; + + const packageDetails = `azsdk-js-arm-mission/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix, + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com", + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName, + ); + } + 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 ?? + `${optionsWithDefaults.endpoint}/.default`, + 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 || "2024-12-01-preview"; + this.approval = new ApprovalImpl(this); + this.operations = new OperationsImpl(this); + this.community = new CommunityImpl(this); + this.communityEndpoints = new CommunityEndpointsImpl(this); + this.transitHub = new TransitHubImpl(this); + this.enclaveConnection = new EnclaveConnectionImpl(this); + this.virtualEnclave = new VirtualEnclaveImpl(this); + this.enclaveEndpoints = new EnclaveEndpointsImpl(this); + this.workload = new WorkloadImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + approval: Approval; + operations: Operations; + community: Community; + communityEndpoints: CommunityEndpoints; + transitHub: TransitHub; + enclaveConnection: EnclaveConnection; + virtualEnclave: VirtualEnclave; + enclaveEndpoints: EnclaveEndpoints; + workload: Workload; +} diff --git a/sdk/mission/arm-mission/src/models/index.ts b/sdk/mission/arm-mission/src/models/index.ts new file mode 100644 index 000000000000..8c71db4f263d --- /dev/null +++ b/sdk/mission/arm-mission/src/models/index.ts @@ -0,0 +1,2715 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +/** The response of a ApprovalResource list operation. */ +export interface ApprovalResourceListResult { + /** The ApprovalResource items on this page */ + value: ApprovalResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Request Metadata for approvals request. */ +export interface RequestMetadata { + /** Resource Action of the item being approved or declined. */ + resourceAction: string; + /** Approval status. */ + approvalStatus?: ApprovalStatus; + /** Route name for the approval callback */ + approvalCallbackRoute?: string; + /** Payload to be sent upon any action on approval request */ + approvalCallbackPayload?: string; +} + +/** Approver Metadata for approvals request. */ +export interface Approver { + /** EntraId of the approver */ + approverEntraId: string; + /** Action Performed by approver */ + actionPerformed: ActionPerformed; + /** approval request last updated at */ + lastUpdatedAt: Date; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** Approvals properties for patching */ +export interface ApprovalPatchResource { + /** Approval Patch properties */ + properties?: UpdateApprovalProperties; +} + +/** + * A copy of the input model `T` with only the properties that are visible during the + * "Update" resource lifecycle phase. + * + * The "Update" lifecycle phase is used for properties passed as parameters to operations + * that update data, like HTTP PATCH operations. + * + * This transformation will include only the properties that have the `Lifecycle.Update` + * visibility modifier, and the types of all properties will be replaced with the + * equivalent `CreateOrUpdate` transformation. + * + * If a `NameTemplate` is provided, the new model will be named according to the template. + * The template uses the same syntax as the `@friendlyName` decorator. + */ +export interface UpdateApprovalProperties { + /** Parameter for optimizing query results */ + parent1?: string; + /** Parameter for optimizing query results */ + parent2?: string; + /** Request metadata for the approval request. */ + requestMetadata?: RequestMetadataUpdate; + /** List of approvers for the approval request */ + approvers?: Approver[]; + /** Ticket ID for the approval request */ + ticketId?: string; + /** Approval request creation time */ + createdAt?: Date; + /** Approval request state change time, time at which approval request state changed from pending to approved or rejected. */ + stateChangedAt?: Date; +} + +/** Request Metadata for approvals request. */ +export interface RequestMetadataUpdate { + /** Resource Action of the item being approved or declined. */ + resourceAction?: string; + /** Approval status. */ + approvalStatus?: ApprovalStatus; + /** Route name for the approval callback */ + approvalCallbackRoute?: string; + /** Payload to be sent upon any action on approval request */ + approvalCallbackPayload?: string; +} + +/** Request body for calling post-action */ +export interface InitiatorCallbackRequest { + /** Approval status indicating 'Approved' or 'Rejected' */ + approvalStatus: InitiatorCallbackRequestApprovalStatus; +} + +/** Response body after handling of approvalCallbackRequest */ +export interface InitiatorCallbackResponse { + /** Confirmation message indicating the result of the operation. */ + message: string; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** The response of a CommunityResource list operation. */ +export interface CommunityResourceListResult { + /** The CommunityResource items on this page */ + value: CommunityResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** ManagedResourceGroup related properties */ +export interface ManagedResourceGroupConfiguration { + /** Name of managed resource group */ + name?: string; + /** The geo-location where the resource lives */ + location?: string; +} + +/** GovernedServiceItem Properties */ +export interface GovernedServiceItem { + /** service id */ + id: ServiceIdentifier; + /** + * service name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** governance option for this service (Allow, Deny, ExceptionOnly, or NotApplicable). */ + option?: GovernedServiceItemOption; + /** initiative enforcement (Enabled or Disabled). */ + enforcement?: GovernedServiceItemEnforcement; + /** policies set to auditOnly (True or False). */ + auditOnly?: boolean; + /** + * initiatives associated with this service + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly initiatives?: string[]; +} + +/** Role assignment item that indicates which principals should be assigned this role definition */ +export interface RoleAssignmentItem { + /** Role definition identifier */ + id: string; + /** List of principal IDs to which to assign this role definition */ + principals?: Principal[]; +} + +/** Principal for maintenance mode or role assignments */ +export interface Principal { + /** The object id associated with the principal */ + id: string; + /** The type of the object id. We currently allow users, groups, and service principals */ + type: PrincipalType; +} + +/** ApprovalSettings Properties */ +export interface ApprovalSettings { + /** Approval required for endpoint creation (Required or NotRequired). */ + endpointCreation?: ApprovalPolicy; + /** Approval required for endpoint update (Required or NotRequired). */ + endpointUpdate?: ApprovalPolicy; + /** Approval required for endpoint deletion (Required or NotRequired). */ + endpointDeletion?: ApprovalPolicy; + /** Approval required for enclave connection creation (Required or NotRequired). */ + connectionCreation?: ApprovalPolicy; + /** Approval required for enclave connection update (Required or NotRequired). */ + connectionUpdate?: ApprovalPolicy; + /** Behavior of enclave connection update workflow after endpoint update is approved (Automatic or Manual). */ + connectionUpdateMode?: ApprovalSettingsConnectionUpdateMode; + /** Approval required for enclave connection deletion (Required or NotRequired). */ + connectionDeletion?: ApprovalPolicy; + /** Approval required for virtual enclave creation (Required or NotRequired). */ + enclaveCreation?: ApprovalPolicy; + /** Approval required for virtual enclave deletion (Required or NotRequired). */ + enclaveDeletion?: ApprovalPolicy; + /** Approval required for toggling maintenance mode (Required or NotRequired). */ + maintenanceMode?: ApprovalPolicy; + /** Approval required for deploying service catalog templates (Required or NotRequired). */ + serviceCatalogDeployment?: ApprovalPolicy; + /** Notification will be sent on creation of an Approval Request */ + notificationOnApprovalCreation?: ApprovalPolicy; + /** Notification will be sent on any action taken (Approve/Reject) on an Approval Request */ + notificationOnApprovalAction?: ApprovalPolicy; + /** Notification will be sent on deletion of an Approval Request */ + notificationOnApprovalDeletion?: ApprovalPolicy; + /** List of mandatory approvers for the approval request */ + mandatoryApprovers?: MandatoryApprover[]; + /** Minimum number of approvers required for the approval request */ + minimumApproversRequired?: number; +} + +/** Approver Metadata for approvals request. */ +export interface MandatoryApprover { + /** EntraId of the approver */ + approverEntraId: string; +} + +/** Maintenance Mode */ +export interface MaintenanceModeConfiguration { + /** Current mode of Maintenance Mode Configuration */ + mode: MaintenanceModeConfigurationMode; + /** The user, group or service principal object affected by Maintenance Mode */ + principals?: Principal[]; + /** Justification for entering or exiting Maintenance Mode */ + justification?: MaintenanceModeConfigurationJustification; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity | null; + }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + +/** The response of a CommunityEndpointResource list operation. */ +export interface CommunityEndpointResourceListResult { + /** The CommunityEndpointResource items on this page */ + value: CommunityEndpointResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Base type for destination rules. */ +export interface CommunityEndpointDestinationRule { + /** Endpoint Rule Name. */ + name?: string; + /** Destination address. Can include multiple CIDR/IP Addresses or fqdn tags or fqdns (for community endpoint) separated by commas. */ + destination?: string; + /** Port. Can include multiple ports separated by commas or a range indicated by a hyphen. */ + port?: string; + /** Destination Type. */ + destinationType?: DestinationType; + /** Protocols. Options specified by Endpoint Protocol Enum. */ + protocols?: CommunityEndpointProtocol[]; + /** Transit Hub Resource Id. */ + transitHubResourceId?: string; +} + +/** The response of a TransitHubResource list operation. */ +export interface TransitHubResourceListResult { + /** The TransitHubResource items on this page */ + value: TransitHubResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** TransitOption Properties */ +export interface TransitOption { + /** Transit Option Type. */ + type?: TransitOptionType; + /** Transit Option Params */ + params?: TransitOptionParams; +} + +/** TransitOptionParams Properties */ +export interface TransitOptionParams { + /** Transit Option Params scaleUnits. */ + scaleUnits?: number; + /** Transit Option Params remoteVirtualNetworkId. */ + remoteVirtualNetworkId?: string; +} + +/** The response of a EnclaveConnectionResource list operation. */ +export interface EnclaveConnectionResourceListResult { + /** The EnclaveConnectionResource items on this page */ + value: EnclaveConnectionResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** The response of a EnclaveResource list operation. */ +export interface EnclaveResourceListResult { + /** The EnclaveResource items on this page */ + value: EnclaveResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Enclave Virtual Network Properties */ +export interface EnclaveVirtualNetwork { + /** Network Name. */ + name?: string; + /** Network Size. */ + networkSize?: string; + /** Custom CIDR Range. */ + customCidrRange?: string; + /** Subnet Configurations. */ + subnetConfigurations?: SubnetConfiguration[]; + /** Allow Subnet Communication. */ + allowSubnetCommunication?: boolean; + /** Connect to Azure Services (True or False). */ + connectToAzureServices?: boolean; +} + +/** Subnet Configuration */ +export interface SubnetConfiguration { + /** Subnet name. */ + name: string; + /** + * Subnet ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** Network prefix size. */ + networkPrefixSize: number; + /** Subnet delegation. */ + subnetDelegation?: string; + /** + * Address prefix. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly addressPrefix?: string; + /** + * Network security group ID. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkSecurityGroupId?: string; +} + +/** Enclave Address Spaces */ +export interface EnclaveAddressSpaces { + /** Enclave Address Space */ + enclaveAddressSpace?: string; + /** Managed Address Space */ + managedAddressSpace?: string; +} + +/** Virtual Enclave Default Settings */ +export interface EnclaveDefaultSettings { + /** Key Vault Resource Id. */ + keyVaultResourceId?: string; + /** Storage Account Resource Id. */ + storageAccountResourceId?: string; + /** Log Analytics Resource Ids. */ + logAnalyticsResourceIdCollection?: string[]; + /** Diagnostic Destination. */ + diagnosticDestination?: DiagnosticDestination; +} + +/** The response of a EnclaveEndpointResource list operation. */ +export interface EnclaveEndpointResourceListResult { + /** The EnclaveEndpointResource items on this page */ + value: EnclaveEndpointResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Enclave Endpoint Rule Properties */ +export interface EnclaveEndpointDestinationRule { + /** Endpoint Rule Name. */ + name?: string; + /** Destination address. Can include multiple CIDR/IP Addresses or fqdn tags or fqdns (for community endpoint) separated by commas. */ + destination?: string; + /** Port. Can include multiple ports separated by commas or a range indicated by a hyphen. */ + port?: string; + /** Protocols. Options specified by Endpoint Protocol Enum. */ + protocols?: EnclaveEndpointProtocol[]; +} + +/** The response of a WorkloadResource list operation. */ +export interface WorkloadResourceListResult { + /** The WorkloadResource items on this page */ + value: WorkloadResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Community Patch Resource */ +export interface CommunityPatchResource { + /** Community Patch properties */ + properties?: UpdateCommunityPatchProperties; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The managed service identities assigned to this resource. */ + identity?: AzureResourceManagerCommonTypesManagedServiceIdentityUpdate; +} + +/** + * A copy of the input model `T` with only the properties that are visible during the + * "Update" resource lifecycle phase. + * + * The "Update" lifecycle phase is used for properties passed as parameters to operations + * that update data, like HTTP PATCH operations. + * + * This transformation will include only the properties that have the `Lifecycle.Update` + * visibility modifier, and the types of all properties will be replaced with the + * equivalent `CreateOrUpdate` transformation. + * + * If a `NameTemplate` is provided, the new model will be named according to the template. + * The template uses the same syntax as the `@friendlyName` decorator. + */ +export interface UpdateCommunityPatchProperties { + /** Address Space. */ + addressSpace?: string; + /** Dns Servers. */ + dnsServers?: string[]; + /** Managed resource group configuration. */ + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + /** List of services governed by a community. */ + governedServiceList?: GovernedServiceItem[]; + /** Community role assignments */ + communityRoleAssignments?: RoleAssignmentItem[]; + /** Approval requirements for various actions on the community's resources. */ + approvalSettings?: ApprovalSettings; + /** Maintenance Mode configuration. */ + maintenanceModeConfiguration?: MaintenanceModeConfigurationUpdate; +} + +/** Maintenance Mode */ +export interface MaintenanceModeConfigurationUpdate { + /** Current mode of Maintenance Mode Configuration */ + mode?: MaintenanceModeConfigurationUpdateMode; + /** The user, group or service principal object affected by Maintenance Mode */ + principals?: Principal[]; + /** Justification for entering or exiting Maintenance Mode */ + justification?: MaintenanceModeConfigurationUpdateJustification; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface AzureResourceManagerCommonTypesManagedServiceIdentityUpdate { + /** The type of managed identity assigned to this resource. */ + type?: ManagedServiceIdentityType; + /** The identities assigned to this resource by the user. */ + userAssignedIdentities?: { + [ + propertyName: string + ]: Components19Kgb1NSchemasAzureResourcemanagerCommontypesManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties | null; + }; +} + +/** Request to the action call to check address space availability. */ +export interface CheckAddressSpaceAvailabilityRequest { + /** Resource Id of the Community */ + communityResourceId: string; + /** Information about the enclave virtual network */ + enclaveVirtualNetwork: EnclaveVirtualNetwork; +} + +/** Response of availability of the requested address space. */ +export interface CheckAddressSpaceAvailabilityResponse { + /** Boolean representing whether the address space is available. */ + value: boolean; +} + +/** Community Endpoint Patch Resource */ +export interface CommunityEndpointPatchResource { + /** Community Endpoint Patch properties */ + properties?: UpdateCommunityEndpointPatchProperties; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** + * A copy of the input model `T` with only the properties that are visible during the + * "Update" resource lifecycle phase. + * + * The "Update" lifecycle phase is used for properties passed as parameters to operations + * that update data, like HTTP PATCH operations. + * + * This transformation will include only the properties that have the `Lifecycle.Update` + * visibility modifier, and the types of all properties will be replaced with the + * equivalent `CreateOrUpdate` transformation. + * + * If a `NameTemplate` is provided, the new model will be named according to the template. + * The template uses the same syntax as the `@friendlyName` decorator. + */ +export interface UpdateCommunityEndpointPatchProperties { + /** Community Endpoint Rule Collection. */ + ruleCollection?: CommunityEndpointDestinationRule[]; + /** List of resource ids created by community endpoint. */ + resourceCollection?: string[]; +} + +/** Request body for calling post-action */ +export interface ApprovalCallbackRequest { + /** Resource request action indicating action which needed to be performed upon calling approval-callback post action */ + resourceRequestAction: ApprovalCallbackRequestResourceRequestAction; + /** Approval status indicating 'Approved' or 'Rejected' */ + approvalStatus: ApprovalCallbackRequestApprovalStatus; + /** Payload requested by client upon approval action */ + approvalCallbackPayload?: string; +} + +/** Response body after handling of approvalCallbackRequest */ +export interface ApprovalCallbackResponse { + /** Confirmation message indicating the result of the operation. */ + message: string; +} + +/** Request body for calling post-action */ +export interface ApprovalDeletionCallbackRequest { + /** Resource request action indicating action which needed to be performed upon calling approval-deletion-callback post action */ + resourceRequestAction: ApprovalDeletionCallbackRequestResourceRequestAction; +} + +/** Response body after handling of approvalDeletionCallbackRequest */ +export interface ApprovalDeletionCallbackResponse { + /** Confirmation message indicating the result of the operation. */ + message: string; +} + +/** TH Patch Resource */ +export interface TransitHubPatchResource { + /** The TransitHub resource. */ + properties?: UpdateTransitHubPatchProperties; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** + * A copy of the input model `T` with only the properties that are visible during the + * "Update" resource lifecycle phase. + * + * The "Update" lifecycle phase is used for properties passed as parameters to operations + * that update data, like HTTP PATCH operations. + * + * This transformation will include only the properties that have the `Lifecycle.Update` + * visibility modifier, and the types of all properties will be replaced with the + * equivalent `CreateOrUpdate` transformation. + * + * If a `NameTemplate` is provided, the new model will be named according to the template. + * The template uses the same syntax as the `@friendlyName` decorator. + */ +export interface UpdateTransitHubPatchProperties { + /** + * The status of the last operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The state of the transitHub. */ + state?: TransitHubState; + /** The TransitOption of the transitHub. */ + transitOption?: TransitOption; + /** List of resource ids modified by transitHubs. */ + resourceCollection?: string[]; +} + +/** Enclave Connection Patch Resource */ +export interface EnclaveConnectionPatchResource { + /** Enclave Connection Patch properties */ + properties?: UpdateEnclaveConnectionPatchProperties; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** + * A copy of the input model `T` with only the properties that are visible during the + * "Update" resource lifecycle phase. + * + * The "Update" lifecycle phase is used for properties passed as parameters to operations + * that update data, like HTTP PATCH operations. + * + * This transformation will include only the properties that have the `Lifecycle.Update` + * visibility modifier, and the types of all properties will be replaced with the + * equivalent `CreateOrUpdate` transformation. + * + * If a `NameTemplate` is provided, the new model will be named according to the template. + * The template uses the same syntax as the `@friendlyName` decorator. + */ +export interface UpdateEnclaveConnectionPatchProperties { + /** The state of the enclaveConnection. */ + state?: EnclaveConnectionState; + /** Community Resource Id. */ + communityResourceId?: string; + /** Source Resource Id. */ + sourceResourceId?: string; + /** Source CIDR. */ + sourceCidr?: string; + /** Source IP group Resource Id. */ + ipGroup?: string; + /** Destination Endpoint Resource Id. */ + destinationEndpointId?: string; + /** List of resource ids modified by enclave Connections. */ + resourceCollection?: string[]; +} + +/** Virtual Enclave Patch Resource */ +export interface VirtualEnclavePatchResource { + /** Virtual Enclave Patch properties */ + properties?: UpdateVirtualEnclavePatchProperties; + /** The managed service identities assigned to this resource. */ + identity?: AzureResourceManagerCommonTypesManagedServiceIdentityUpdate; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** + * A copy of the input model `T` with only the properties that are visible during the + * "Update" resource lifecycle phase. + * + * The "Update" lifecycle phase is used for properties passed as parameters to operations + * that update data, like HTTP PATCH operations. + * + * This transformation will include only the properties that have the `Lifecycle.Update` + * visibility modifier, and the types of all properties will be replaced with the + * equivalent `CreateOrUpdate` transformation. + * + * If a `NameTemplate` is provided, the new model will be named according to the template. + * The template uses the same syntax as the `@friendlyName` decorator. + */ +export interface UpdateVirtualEnclavePatchProperties { + /** Virtual Network. */ + enclaveVirtualNetwork?: EnclaveVirtualNetwork; + /** Community Resource Id. */ + communityResourceId?: string; + /** Default Settings */ + enclaveDefaultSettings?: EnclaveDefaultSettings; + /** List of resource ids created by Virtual Enclave. */ + resourceCollection?: string[]; + /** Managed resource group configuration. */ + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + /** Maintenance Mode configuration. */ + maintenanceModeConfiguration?: MaintenanceModeConfigurationUpdate; + /** Deploy Bastion service (True or False). */ + bastionEnabled?: boolean; + /** Enclave role assignments */ + enclaveRoleAssignments?: RoleAssignmentItem[]; + /** Workload role assignments */ + workloadRoleAssignments?: RoleAssignmentItem[]; +} + +/** Enclave Endpoint Patch Resource */ +export interface EnclaveEndpointPatchResource { + /** Enclave Endpoint Patch properties */ + properties?: UpdateEnclaveEndpointPatchProperties; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** + * A copy of the input model `T` with only the properties that are visible during the + * "Update" resource lifecycle phase. + * + * The "Update" lifecycle phase is used for properties passed as parameters to operations + * that update data, like HTTP PATCH operations. + * + * This transformation will include only the properties that have the `Lifecycle.Update` + * visibility modifier, and the types of all properties will be replaced with the + * equivalent `CreateOrUpdate` transformation. + * + * If a `NameTemplate` is provided, the new model will be named according to the template. + * The template uses the same syntax as the `@friendlyName` decorator. + */ +export interface UpdateEnclaveEndpointPatchProperties { + /** Enclave Endpoint Rule Collection. */ + ruleCollection?: EnclaveEndpointDestinationRule[]; + /** List of resource ids created by community endpoint. */ + resourceCollection?: string[]; +} + +/** Workload Patch Resource */ +export interface WorkloadPatchResource { + /** Workload Patch properties */ + properties?: UpdateWorkloadPatchProperties; + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** + * A copy of the input model `T` with only the properties that are visible during the + * "Update" resource lifecycle phase. + * + * The "Update" lifecycle phase is used for properties passed as parameters to operations + * that update data, like HTTP PATCH operations. + * + * This transformation will include only the properties that have the `Lifecycle.Update` + * visibility modifier, and the types of all properties will be replaced with the + * equivalent `CreateOrUpdate` transformation. + * + * If a `NameTemplate` is provided, the new model will be named according to the template. + * The template uses the same syntax as the `@friendlyName` decorator. + */ +export interface UpdateWorkloadPatchProperties { + /** + * Provisioning State. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** List of resource group ids. */ + resourceGroupCollection?: string[]; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +export interface Components19Kgb1NSchemasAzureResourcemanagerCommontypesManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties + extends UserAssignedIdentity {} + +/** Approval Model Resource */ +export interface ApprovalResource extends ProxyResource { + /** + * Provisioning State. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Parameter for optimizing query results */ + parent1?: string; + /** Parameter for optimizing query results */ + parent2?: string; + /** Request metadata for the approval request. */ + requestMetadata?: RequestMetadata; + /** List of approvers for the approval request */ + approvers?: Approver[]; + /** Ticket ID for the approval request */ + ticketId?: string; + /** Approval request creation time */ + createdAt?: Date; + /** Approval request state change time, time at which approval request state changed from pending to approved or rejected. */ + stateChangedAt?: Date; +} + +/** Community Model Resource */ +export interface CommunityResource extends TrackedResource { + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; + /** Address Space. */ + addressSpace?: string; + /** Dns Servers. */ + dnsServers?: string[]; + /** + * Provisioning State. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * List of resource ids created by communities. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceCollection?: string[]; + /** Managed resource group configuration. */ + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + /** List of services governed by a community. */ + governedServiceList?: GovernedServiceItem[]; + /** Community role assignments */ + communityRoleAssignments?: RoleAssignmentItem[]; + /** Approval requirements for various actions on the community's resources. */ + approvalSettings?: ApprovalSettings; + /** Maintenance Mode configuration. */ + maintenanceModeConfiguration?: MaintenanceModeConfiguration; +} + +/** CommunityEndpoint Model Resource */ +export interface CommunityEndpointResource extends TrackedResource { + /** Community Endpoint Rule Collection. */ + ruleCollection?: CommunityEndpointDestinationRule[]; + /** List of resource ids created by community endpoint. */ + resourceCollection?: string[]; + /** + * Provisioning State. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** TransitHub Model Resource */ +export interface TransitHubResource extends TrackedResource { + /** + * The status of the last operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** The state of the transitHub. */ + state?: TransitHubState; + /** The TransitOption of the transitHub. */ + transitOption?: TransitOption; + /** List of resource ids modified by transitHubs. */ + resourceCollection?: string[]; +} + +/** EnclaveConnection Model Resource */ +export interface EnclaveConnectionResource extends TrackedResource { + /** The state of the enclaveConnection. */ + state?: EnclaveConnectionState; + /** Community Resource Id. */ + communityResourceId?: string; + /** Source Resource Id. */ + sourceResourceId?: string; + /** Source CIDR. */ + sourceCidr?: string; + /** Source IP group Resource Id. */ + ipGroup?: string; + /** Destination Endpoint Resource Id. */ + destinationEndpointId?: string; + /** + * Provisioning State. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** List of resource ids modified by enclave Connections. */ + resourceCollection?: string[]; +} + +/** Virtual Enclave Model Resource */ +export interface EnclaveResource extends TrackedResource { + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; + /** + * Provisioning State. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** Virtual Network. */ + enclaveVirtualNetwork?: EnclaveVirtualNetwork; + /** + * Enclave Address Spaces + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly enclaveAddressSpaces?: EnclaveAddressSpaces; + /** Community Resource Id. */ + communityResourceId?: string; + /** Default Settings */ + enclaveDefaultSettings?: EnclaveDefaultSettings; + /** List of resource ids created by Virtual Enclave. */ + resourceCollection?: string[]; + /** Managed resource group configuration. */ + managedResourceGroupConfiguration?: ManagedResourceGroupConfiguration; + /** Maintenance Mode configuration. */ + maintenanceModeConfiguration?: MaintenanceModeConfiguration; + /** Deploy Bastion service (True or False). */ + bastionEnabled?: boolean; + /** Enclave role assignments */ + enclaveRoleAssignments?: RoleAssignmentItem[]; + /** Workload role assignments */ + workloadRoleAssignments?: RoleAssignmentItem[]; +} + +/** EnclaveEndpoint Model Resource */ +export interface EnclaveEndpointResource extends TrackedResource { + /** Enclave Endpoint Rule Collection. */ + ruleCollection?: EnclaveEndpointDestinationRule[]; + /** List of resource ids created by community endpoint. */ + resourceCollection?: string[]; + /** + * Provisioning State. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** Workload Model Resource */ +export interface WorkloadResource extends TrackedResource { + /** + * Provisioning State. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** List of resource group ids. */ + resourceGroupCollection?: string[]; +} + +/** Defines headers for Approval_createOrUpdate operation. */ +export interface ApprovalCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Approval_update operation. */ +export interface ApprovalUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Approval_delete operation. */ +export interface ApprovalDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Approval_initiatorCallback operation. */ +export interface ApprovalInitiatorCallbackHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Community_createOrUpdate operation. */ +export interface CommunityCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Community_update operation. */ +export interface CommunityUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Community_delete operation. */ +export interface CommunityDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CommunityEndpoints_createOrUpdate operation. */ +export interface CommunityEndpointsCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CommunityEndpoints_update operation. */ +export interface CommunityEndpointsUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CommunityEndpoints_delete operation. */ +export interface CommunityEndpointsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CommunityEndpoints_approvalCallback operation. */ +export interface CommunityEndpointsApprovalCallbackHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CommunityEndpoints_approvalDeletionCallback operation. */ +export interface CommunityEndpointsApprovalDeletionCallbackHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for TransitHub_createOrUpdate operation. */ +export interface TransitHubCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for TransitHub_update operation. */ +export interface TransitHubUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for TransitHub_delete operation. */ +export interface TransitHubDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveConnection_createOrUpdate operation. */ +export interface EnclaveConnectionCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveConnection_update operation. */ +export interface EnclaveConnectionUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveConnection_delete operation. */ +export interface EnclaveConnectionDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveConnection_approvalCallback operation. */ +export interface EnclaveConnectionApprovalCallbackHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveConnection_approvalDeletionCallback operation. */ +export interface EnclaveConnectionApprovalDeletionCallbackHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VirtualEnclave_createOrUpdate operation. */ +export interface VirtualEnclaveCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VirtualEnclave_update operation. */ +export interface VirtualEnclaveUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VirtualEnclave_delete operation. */ +export interface VirtualEnclaveDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VirtualEnclave_approvalCallback operation. */ +export interface VirtualEnclaveApprovalCallbackHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for VirtualEnclave_approvalDeletionCallback operation. */ +export interface VirtualEnclaveApprovalDeletionCallbackHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveEndpoints_createOrUpdate operation. */ +export interface EnclaveEndpointsCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveEndpoints_update operation. */ +export interface EnclaveEndpointsUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveEndpoints_delete operation. */ +export interface EnclaveEndpointsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveEndpoints_approvalCallback operation. */ +export interface EnclaveEndpointsApprovalCallbackHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for EnclaveEndpoints_approvalDeletionCallback operation. */ +export interface EnclaveEndpointsApprovalDeletionCallbackHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Workload_createOrUpdate operation. */ +export interface WorkloadCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Workload_update operation. */ +export interface WorkloadUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Workload_delete operation. */ +export interface WorkloadDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", + /** Provisioning State Type Accepted */ + Accepted = "Accepted", + /** Provisioning State Type Created */ + Created = "Created", + /** Provisioning State Type Creating */ + Creating = "Creating", + /** Provisioning State Type Deleted */ + Deleted = "Deleted", + /** Provisioning State Type Deleting */ + Deleting = "Deleting", + /** Provisioning State Type NotSpecified */ + NotSpecified = "NotSpecified", + /** Provisioning State Type Ready */ + Ready = "Ready", + /** Provisioning State Type Running */ + Running = "Running", + /** Provisioning State Type Updating */ + Updating = "Updating", +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Accepted**: Provisioning State Type Accepted \ + * **Created**: Provisioning State Type Created \ + * **Creating**: Provisioning State Type Creating \ + * **Deleted**: Provisioning State Type Deleted \ + * **Deleting**: Provisioning State Type Deleting \ + * **NotSpecified**: Provisioning State Type NotSpecified \ + * **Ready**: Provisioning State Type Ready \ + * **Running**: Provisioning State Type Running \ + * **Updating**: Provisioning State Type Updating + */ +export type ProvisioningState = string; + +/** Known values of {@link ApprovalStatus} that the service accepts. */ +export enum KnownApprovalStatus { + /** ApprovalStatus Type Approved */ + Approved = "Approved", + /** ApprovalStatus Type Rejected */ + Rejected = "Rejected", + /** ApprovalStatus Type Pending */ + Pending = "Pending", + /** ApprovalStatus Type Deleted */ + Deleted = "Deleted", + /** ApprovalStatus Type Expired */ + Expired = "Expired", +} + +/** + * Defines values for ApprovalStatus. \ + * {@link KnownApprovalStatus} can be used interchangeably with ApprovalStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Approved**: ApprovalStatus Type Approved \ + * **Rejected**: ApprovalStatus Type Rejected \ + * **Pending**: ApprovalStatus Type Pending \ + * **Deleted**: ApprovalStatus Type Deleted \ + * **Expired**: ApprovalStatus Type Expired + */ +export type ApprovalStatus = string; + +/** Known values of {@link ActionPerformed} that the service accepts. */ +export enum KnownActionPerformed { + /** ActionPerformed Type Approved */ + Approved = "Approved", + /** ActionPerformed Type Rejected */ + Rejected = "Rejected", +} + +/** + * Defines values for ActionPerformed. \ + * {@link KnownActionPerformed} can be used interchangeably with ActionPerformed, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Approved**: ActionPerformed Type Approved \ + * **Rejected**: ActionPerformed Type Rejected + */ +export type ActionPerformed = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link InitiatorCallbackRequestApprovalStatus} that the service accepts. */ +export enum KnownInitiatorCallbackRequestApprovalStatus { + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected", +} + +/** + * Defines values for InitiatorCallbackRequestApprovalStatus. \ + * {@link KnownInitiatorCallbackRequestApprovalStatus} can be used interchangeably with InitiatorCallbackRequestApprovalStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Approved** \ + * **Rejected** + */ +export type InitiatorCallbackRequestApprovalStatus = string; + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system", +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal", +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Known values of {@link ServiceIdentifier} that the service accepts. */ +export enum KnownServiceIdentifier { + /** Service identifier for AKS */ + AKS = "AKS", + /** Service identifier for App Service */ + AppService = "AppService", + /** Service identifier for Azure Firewalls */ + AzureFirewalls = "AzureFirewalls", + /** Service identifier for Container Registry */ + ContainerRegistry = "ContainerRegistry", + /** Service identifier for CosmosDB */ + CosmosDB = "CosmosDB", + /** Service identifier for Data Connectors */ + DataConnectors = "DataConnectors", + /** Service identifier for Insights */ + Insights = "Insights", + /** Service identifier for Key Vault */ + KeyVault = "KeyVault", + /** Service identifier for Logic */ + Logic = "Logic", + /** Service identifier for Microsoft SQL */ + MicrosoftSql = "MicrosoftSQL", + /** Service identifier for Monitoring */ + Monitoring = "Monitoring", + /** Service identifier for PostgreSQL */ + PostgreSql = "PostgreSQL", + /** Service identifier for Private DNS Zones */ + PrivateDNSZones = "PrivateDNSZones", + /** Service identifier for Service Bus */ + ServiceBus = "ServiceBus", + /** Service identifier for Storage */ + Storage = "Storage", +} + +/** + * Defines values for ServiceIdentifier. \ + * {@link KnownServiceIdentifier} can be used interchangeably with ServiceIdentifier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AKS**: Service identifier for AKS \ + * **AppService**: Service identifier for App Service \ + * **AzureFirewalls**: Service identifier for Azure Firewalls \ + * **ContainerRegistry**: Service identifier for Container Registry \ + * **CosmosDB**: Service identifier for CosmosDB \ + * **DataConnectors**: Service identifier for Data Connectors \ + * **Insights**: Service identifier for Insights \ + * **KeyVault**: Service identifier for Key Vault \ + * **Logic**: Service identifier for Logic \ + * **MicrosoftSQL**: Service identifier for Microsoft SQL \ + * **Monitoring**: Service identifier for Monitoring \ + * **PostgreSQL**: Service identifier for PostgreSQL \ + * **PrivateDNSZones**: Service identifier for Private DNS Zones \ + * **ServiceBus**: Service identifier for Service Bus \ + * **Storage**: Service identifier for Storage + */ +export type ServiceIdentifier = string; + +/** Known values of {@link GovernedServiceItemOption} that the service accepts. */ +export enum KnownGovernedServiceItemOption { + /** Allow */ + Allow = "Allow", + /** Deny */ + Deny = "Deny", + /** ExceptionOnly */ + ExceptionOnly = "ExceptionOnly", + /** NotApplicable */ + NotApplicable = "NotApplicable", +} + +/** + * Defines values for GovernedServiceItemOption. \ + * {@link KnownGovernedServiceItemOption} can be used interchangeably with GovernedServiceItemOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** \ + * **Deny** \ + * **ExceptionOnly** \ + * **NotApplicable** + */ +export type GovernedServiceItemOption = string; + +/** Known values of {@link GovernedServiceItemEnforcement} that the service accepts. */ +export enum KnownGovernedServiceItemEnforcement { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * Defines values for GovernedServiceItemEnforcement. \ + * {@link KnownGovernedServiceItemEnforcement} can be used interchangeably with GovernedServiceItemEnforcement, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type GovernedServiceItemEnforcement = string; + +/** Known values of {@link PrincipalType} that the service accepts. */ +export enum KnownPrincipalType { + /** User */ + User = "User", + /** Group */ + Group = "Group", + /** ServicePrincipal */ + ServicePrincipal = "ServicePrincipal", +} + +/** + * Defines values for PrincipalType. \ + * {@link KnownPrincipalType} can be used interchangeably with PrincipalType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Group** \ + * **ServicePrincipal** + */ +export type PrincipalType = string; + +/** Known values of {@link ApprovalPolicy} that the service accepts. */ +export enum KnownApprovalPolicy { + /** Approval will be required for the specified action. */ + Required = "Required", + /** Approval will not be required for the specified action. */ + NotRequired = "NotRequired", +} + +/** + * Defines values for ApprovalPolicy. \ + * {@link KnownApprovalPolicy} can be used interchangeably with ApprovalPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Required**: Approval will be required for the specified action. \ + * **NotRequired**: Approval will not be required for the specified action. + */ +export type ApprovalPolicy = string; + +/** Known values of {@link ApprovalSettingsConnectionUpdateMode} that the service accepts. */ +export enum KnownApprovalSettingsConnectionUpdateMode { + /** Automatic */ + Automatic = "Automatic", + /** Manual */ + Manual = "Manual", +} + +/** + * Defines values for ApprovalSettingsConnectionUpdateMode. \ + * {@link KnownApprovalSettingsConnectionUpdateMode} can be used interchangeably with ApprovalSettingsConnectionUpdateMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Automatic** \ + * **Manual** + */ +export type ApprovalSettingsConnectionUpdateMode = string; + +/** Known values of {@link MaintenanceModeConfigurationMode} that the service accepts. */ +export enum KnownMaintenanceModeConfigurationMode { + /** On */ + On = "On", + /** CanNotDelete */ + CanNotDelete = "CanNotDelete", + /** Off */ + Off = "Off", +} + +/** + * Defines values for MaintenanceModeConfigurationMode. \ + * {@link KnownMaintenanceModeConfigurationMode} can be used interchangeably with MaintenanceModeConfigurationMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **On** \ + * **CanNotDelete** \ + * **Off** + */ +export type MaintenanceModeConfigurationMode = string; + +/** Known values of {@link MaintenanceModeConfigurationJustification} that the service accepts. */ +export enum KnownMaintenanceModeConfigurationJustification { + /** Networking */ + Networking = "Networking", + /** Governance */ + Governance = "Governance", + /** Off */ + Off = "Off", +} + +/** + * Defines values for MaintenanceModeConfigurationJustification. \ + * {@link KnownMaintenanceModeConfigurationJustification} can be used interchangeably with MaintenanceModeConfigurationJustification, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Networking** \ + * **Governance** \ + * **Off** + */ +export type MaintenanceModeConfigurationJustification = string; + +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned,UserAssigned** + */ +export type ManagedServiceIdentityType = string; + +/** Known values of {@link DestinationType} that the service accepts. */ +export enum KnownDestinationType { + /** DestinationType Type FQDN */ + Fqdn = "FQDN", + /** DestinationType Type FQDNTag */ + FqdnTag = "FQDNTag", + /** DestinationType Type IPAddress */ + IPAddress = "IPAddress", + /** DestinationType Type PrivateNetwork */ + PrivateNetwork = "PrivateNetwork", +} + +/** + * Defines values for DestinationType. \ + * {@link KnownDestinationType} can be used interchangeably with DestinationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **FQDN**: DestinationType Type FQDN \ + * **FQDNTag**: DestinationType Type FQDNTag \ + * **IPAddress**: DestinationType Type IPAddress \ + * **PrivateNetwork**: DestinationType Type PrivateNetwork + */ +export type DestinationType = string; + +/** Known values of {@link CommunityEndpointProtocol} that the service accepts. */ +export enum KnownCommunityEndpointProtocol { + /** CommunityEndpointProtocol Type ANY */ + ANY = "ANY", + /** CommunityEndpointProtocol Type TCP */ + TCP = "TCP", + /** CommunityEndpointProtocol Type UDP */ + UDP = "UDP", + /** CommunityEndpointProtocol Type ICMP */ + Icmp = "ICMP", + /** CommunityEndpointProtocol Type ESP */ + ESP = "ESP", + /** CommunityEndpointProtocol Type AH */ + AH = "AH", + /** CommunityEndpointProtocol Type HTTPS */ + Https = "HTTPS", + /** CommunityEndpointProtocol Type HTTP */ + Http = "HTTP", +} + +/** + * Defines values for CommunityEndpointProtocol. \ + * {@link KnownCommunityEndpointProtocol} can be used interchangeably with CommunityEndpointProtocol, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ANY**: CommunityEndpointProtocol Type ANY \ + * **TCP**: CommunityEndpointProtocol Type TCP \ + * **UDP**: CommunityEndpointProtocol Type UDP \ + * **ICMP**: CommunityEndpointProtocol Type ICMP \ + * **ESP**: CommunityEndpointProtocol Type ESP \ + * **AH**: CommunityEndpointProtocol Type AH \ + * **HTTPS**: CommunityEndpointProtocol Type HTTPS \ + * **HTTP**: CommunityEndpointProtocol Type HTTP + */ +export type CommunityEndpointProtocol = string; + +/** Known values of {@link TransitHubState} that the service accepts. */ +export enum KnownTransitHubState { + /** TransitHubState Type PendingApproval */ + PendingApproval = "PendingApproval", + /** TransitHubState Type Approved */ + Approved = "Approved", + /** TransitHubState Type PendingUpdate */ + PendingUpdate = "PendingUpdate", + /** TransitHubState Type Active */ + Active = "Active", + /** TransitHubState Type Failed */ + Failed = "Failed", +} + +/** + * Defines values for TransitHubState. \ + * {@link KnownTransitHubState} can be used interchangeably with TransitHubState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PendingApproval**: TransitHubState Type PendingApproval \ + * **Approved**: TransitHubState Type Approved \ + * **PendingUpdate**: TransitHubState Type PendingUpdate \ + * **Active**: TransitHubState Type Active \ + * **Failed**: TransitHubState Type Failed + */ +export type TransitHubState = string; + +/** Known values of {@link TransitOptionType} that the service accepts. */ +export enum KnownTransitOptionType { + /** TransitOptionType ExpressRoute */ + ExpressRoute = "ExpressRoute", + /** TransitOptionType Gateway */ + Gateway = "Gateway", + /** TransitOptionType Peering */ + Peering = "Peering", +} + +/** + * Defines values for TransitOptionType. \ + * {@link KnownTransitOptionType} can be used interchangeably with TransitOptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ExpressRoute**: TransitOptionType ExpressRoute \ + * **Gateway**: TransitOptionType Gateway \ + * **Peering**: TransitOptionType Peering + */ +export type TransitOptionType = string; + +/** Known values of {@link EnclaveConnectionState} that the service accepts. */ +export enum KnownEnclaveConnectionState { + /** EnclaveConnectionState Type Pending Approval */ + PendingApproval = "PendingApproval", + /** EnclaveConnectionState Type Pending Update */ + PendingUpdate = "PendingUpdate", + /** EnclaveConnectionState Type Approved */ + Approved = "Approved", + /** EnclaveConnectionState Type Active */ + Active = "Active", + /** EnclaveConnectionState Type Failed */ + Failed = "Failed", + /** EnclaveConnectionState Type Connected */ + Connected = "Connected", + /** EnclaveConnectionState Type Disconnected */ + Disconnected = "Disconnected", +} + +/** + * Defines values for EnclaveConnectionState. \ + * {@link KnownEnclaveConnectionState} can be used interchangeably with EnclaveConnectionState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PendingApproval**: EnclaveConnectionState Type Pending Approval \ + * **PendingUpdate**: EnclaveConnectionState Type Pending Update \ + * **Approved**: EnclaveConnectionState Type Approved \ + * **Active**: EnclaveConnectionState Type Active \ + * **Failed**: EnclaveConnectionState Type Failed \ + * **Connected**: EnclaveConnectionState Type Connected \ + * **Disconnected**: EnclaveConnectionState Type Disconnected + */ +export type EnclaveConnectionState = string; + +/** Known values of {@link DiagnosticDestination} that the service accepts. */ +export enum KnownDiagnosticDestination { + /** DiagnosticDestination Type CommunityOnly */ + CommunityOnly = "CommunityOnly", + /** DiagnosticDestination Type EnclaveOnly */ + EnclaveOnly = "EnclaveOnly", + /** DiagnosticDestination Type Both */ + Both = "Both", +} + +/** + * Defines values for DiagnosticDestination. \ + * {@link KnownDiagnosticDestination} can be used interchangeably with DiagnosticDestination, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CommunityOnly**: DiagnosticDestination Type CommunityOnly \ + * **EnclaveOnly**: DiagnosticDestination Type EnclaveOnly \ + * **Both**: DiagnosticDestination Type Both + */ +export type DiagnosticDestination = string; + +/** Known values of {@link EnclaveEndpointProtocol} that the service accepts. */ +export enum KnownEnclaveEndpointProtocol { + /** EndpointProtocol Type ANY */ + ANY = "ANY", + /** EndpointProtocol Type TCP */ + TCP = "TCP", + /** EndpointProtocol Type UDP */ + UDP = "UDP", + /** EndpointProtocol Type ICMP */ + Icmp = "ICMP", + /** EndpointProtocol Type ESP */ + ESP = "ESP", + /** EndpointProtocol Type AH */ + AH = "AH", +} + +/** + * Defines values for EnclaveEndpointProtocol. \ + * {@link KnownEnclaveEndpointProtocol} can be used interchangeably with EnclaveEndpointProtocol, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ANY**: EndpointProtocol Type ANY \ + * **TCP**: EndpointProtocol Type TCP \ + * **UDP**: EndpointProtocol Type UDP \ + * **ICMP**: EndpointProtocol Type ICMP \ + * **ESP**: EndpointProtocol Type ESP \ + * **AH**: EndpointProtocol Type AH + */ +export type EnclaveEndpointProtocol = string; + +/** Known values of {@link MaintenanceModeConfigurationUpdateMode} that the service accepts. */ +export enum KnownMaintenanceModeConfigurationUpdateMode { + /** On */ + On = "On", + /** CanNotDelete */ + CanNotDelete = "CanNotDelete", + /** Off */ + Off = "Off", +} + +/** + * Defines values for MaintenanceModeConfigurationUpdateMode. \ + * {@link KnownMaintenanceModeConfigurationUpdateMode} can be used interchangeably with MaintenanceModeConfigurationUpdateMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **On** \ + * **CanNotDelete** \ + * **Off** + */ +export type MaintenanceModeConfigurationUpdateMode = string; + +/** Known values of {@link MaintenanceModeConfigurationUpdateJustification} that the service accepts. */ +export enum KnownMaintenanceModeConfigurationUpdateJustification { + /** Networking */ + Networking = "Networking", + /** Governance */ + Governance = "Governance", + /** Off */ + Off = "Off", +} + +/** + * Defines values for MaintenanceModeConfigurationUpdateJustification. \ + * {@link KnownMaintenanceModeConfigurationUpdateJustification} can be used interchangeably with MaintenanceModeConfigurationUpdateJustification, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Networking** \ + * **Governance** \ + * **Off** + */ +export type MaintenanceModeConfigurationUpdateJustification = string; + +/** Known values of {@link ApprovalCallbackRequestResourceRequestAction} that the service accepts. */ +export enum KnownApprovalCallbackRequestResourceRequestAction { + /** Create */ + Create = "Create", + /** Delete */ + Delete = "Delete", + /** Update */ + Update = "Update", + /** Reset */ + Reset = "Reset", +} + +/** + * Defines values for ApprovalCallbackRequestResourceRequestAction. \ + * {@link KnownApprovalCallbackRequestResourceRequestAction} can be used interchangeably with ApprovalCallbackRequestResourceRequestAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Create** \ + * **Delete** \ + * **Update** \ + * **Reset** + */ +export type ApprovalCallbackRequestResourceRequestAction = string; + +/** Known values of {@link ApprovalCallbackRequestApprovalStatus} that the service accepts. */ +export enum KnownApprovalCallbackRequestApprovalStatus { + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected", +} + +/** + * Defines values for ApprovalCallbackRequestApprovalStatus. \ + * {@link KnownApprovalCallbackRequestApprovalStatus} can be used interchangeably with ApprovalCallbackRequestApprovalStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Approved** \ + * **Rejected** + */ +export type ApprovalCallbackRequestApprovalStatus = string; + +/** Known values of {@link ApprovalDeletionCallbackRequestResourceRequestAction} that the service accepts. */ +export enum KnownApprovalDeletionCallbackRequestResourceRequestAction { + /** Create */ + Create = "Create", + /** Delete */ + Delete = "Delete", + /** Update */ + Update = "Update", +} + +/** + * Defines values for ApprovalDeletionCallbackRequestResourceRequestAction. \ + * {@link KnownApprovalDeletionCallbackRequestResourceRequestAction} can be used interchangeably with ApprovalDeletionCallbackRequestResourceRequestAction, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Create** \ + * **Delete** \ + * **Update** + */ +export type ApprovalDeletionCallbackRequestResourceRequestAction = string; + +/** Optional parameters. */ +export interface ApprovalListByParentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByParent operation. */ +export type ApprovalListByParentResponse = ApprovalResourceListResult; + +/** Optional parameters. */ +export interface ApprovalGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ApprovalGetResponse = ApprovalResource; + +/** Optional parameters. */ +export interface ApprovalCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type ApprovalCreateOrUpdateResponse = ApprovalResource; + +/** Optional parameters. */ +export interface ApprovalUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ApprovalUpdateResponse = ApprovalResource; + +/** Optional parameters. */ +export interface ApprovalDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type ApprovalDeleteResponse = ApprovalDeleteHeaders; + +/** Optional parameters. */ +export interface ApprovalInitiatorCallbackOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the initiatorCallback operation. */ +export type ApprovalInitiatorCallbackResponse = InitiatorCallbackResponse; + +/** Optional parameters. */ +export interface ApprovalListByParentNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByParentNext operation. */ +export type ApprovalListByParentNextResponse = ApprovalResourceListResult; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface CommunityListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type CommunityListBySubscriptionResponse = CommunityResourceListResult; + +/** Optional parameters. */ +export interface CommunityListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type CommunityListByResourceGroupResponse = CommunityResourceListResult; + +/** Optional parameters. */ +export interface CommunityGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CommunityGetResponse = CommunityResource; + +/** Optional parameters. */ +export interface CommunityCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type CommunityCreateOrUpdateResponse = CommunityResource; + +/** Optional parameters. */ +export interface CommunityUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type CommunityUpdateResponse = CommunityResource; + +/** Optional parameters. */ +export interface CommunityDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type CommunityDeleteResponse = CommunityDeleteHeaders; + +/** Optional parameters. */ +export interface CommunityCheckAddressSpaceAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkAddressSpaceAvailability operation. */ +export type CommunityCheckAddressSpaceAvailabilityResponse = + CheckAddressSpaceAvailabilityResponse; + +/** Optional parameters. */ +export interface CommunityListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type CommunityListBySubscriptionNextResponse = + CommunityResourceListResult; + +/** Optional parameters. */ +export interface CommunityListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type CommunityListByResourceGroupNextResponse = + CommunityResourceListResult; + +/** Optional parameters. */ +export interface CommunityEndpointsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type CommunityEndpointsListBySubscriptionResponse = + CommunityEndpointResourceListResult; + +/** Optional parameters. */ +export interface CommunityEndpointsListByCommunityResourceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCommunityResource operation. */ +export type CommunityEndpointsListByCommunityResourceResponse = + CommunityEndpointResourceListResult; + +/** Optional parameters. */ +export interface CommunityEndpointsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CommunityEndpointsGetResponse = CommunityEndpointResource; + +/** Optional parameters. */ +export interface CommunityEndpointsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type CommunityEndpointsCreateOrUpdateResponse = + CommunityEndpointResource; + +/** Optional parameters. */ +export interface CommunityEndpointsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type CommunityEndpointsUpdateResponse = CommunityEndpointResource; + +/** Optional parameters. */ +export interface CommunityEndpointsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type CommunityEndpointsDeleteResponse = CommunityEndpointsDeleteHeaders; + +/** Optional parameters. */ +export interface CommunityEndpointsApprovalCallbackOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approvalCallback operation. */ +export type CommunityEndpointsApprovalCallbackResponse = + ApprovalCallbackResponse; + +/** Optional parameters. */ +export interface CommunityEndpointsApprovalDeletionCallbackOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approvalDeletionCallback operation. */ +export type CommunityEndpointsApprovalDeletionCallbackResponse = + ApprovalDeletionCallbackResponse; + +/** Optional parameters. */ +export interface CommunityEndpointsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type CommunityEndpointsListBySubscriptionNextResponse = + CommunityEndpointResourceListResult; + +/** Optional parameters. */ +export interface CommunityEndpointsListByCommunityResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCommunityResourceNext operation. */ +export type CommunityEndpointsListByCommunityResourceNextResponse = + CommunityEndpointResourceListResult; + +/** Optional parameters. */ +export interface TransitHubListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type TransitHubListBySubscriptionResponse = TransitHubResourceListResult; + +/** Optional parameters. */ +export interface TransitHubListByCommunityResourceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCommunityResource operation. */ +export type TransitHubListByCommunityResourceResponse = + TransitHubResourceListResult; + +/** Optional parameters. */ +export interface TransitHubGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type TransitHubGetResponse = TransitHubResource; + +/** Optional parameters. */ +export interface TransitHubCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type TransitHubCreateOrUpdateResponse = TransitHubResource; + +/** Optional parameters. */ +export interface TransitHubUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type TransitHubUpdateResponse = TransitHubResource; + +/** Optional parameters. */ +export interface TransitHubDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type TransitHubDeleteResponse = TransitHubDeleteHeaders; + +/** Optional parameters. */ +export interface TransitHubListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type TransitHubListBySubscriptionNextResponse = + TransitHubResourceListResult; + +/** Optional parameters. */ +export interface TransitHubListByCommunityResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCommunityResourceNext operation. */ +export type TransitHubListByCommunityResourceNextResponse = + TransitHubResourceListResult; + +/** Optional parameters. */ +export interface EnclaveConnectionListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type EnclaveConnectionListBySubscriptionResponse = + EnclaveConnectionResourceListResult; + +/** Optional parameters. */ +export interface EnclaveConnectionListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type EnclaveConnectionListByResourceGroupResponse = + EnclaveConnectionResourceListResult; + +/** Optional parameters. */ +export interface EnclaveConnectionGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type EnclaveConnectionGetResponse = EnclaveConnectionResource; + +/** Optional parameters. */ +export interface EnclaveConnectionCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type EnclaveConnectionCreateOrUpdateResponse = EnclaveConnectionResource; + +/** Optional parameters. */ +export interface EnclaveConnectionUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type EnclaveConnectionUpdateResponse = EnclaveConnectionResource; + +/** Optional parameters. */ +export interface EnclaveConnectionDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type EnclaveConnectionDeleteResponse = EnclaveConnectionDeleteHeaders; + +/** Optional parameters. */ +export interface EnclaveConnectionApprovalCallbackOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approvalCallback operation. */ +export type EnclaveConnectionApprovalCallbackResponse = + ApprovalCallbackResponse; + +/** Optional parameters. */ +export interface EnclaveConnectionApprovalDeletionCallbackOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approvalDeletionCallback operation. */ +export type EnclaveConnectionApprovalDeletionCallbackResponse = + ApprovalDeletionCallbackResponse; + +/** Optional parameters. */ +export interface EnclaveConnectionListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type EnclaveConnectionListBySubscriptionNextResponse = + EnclaveConnectionResourceListResult; + +/** Optional parameters. */ +export interface EnclaveConnectionListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type EnclaveConnectionListByResourceGroupNextResponse = + EnclaveConnectionResourceListResult; + +/** Optional parameters. */ +export interface VirtualEnclaveListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type VirtualEnclaveListBySubscriptionResponse = + EnclaveResourceListResult; + +/** Optional parameters. */ +export interface VirtualEnclaveListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type VirtualEnclaveListByResourceGroupResponse = + EnclaveResourceListResult; + +/** Optional parameters. */ +export interface VirtualEnclaveGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type VirtualEnclaveGetResponse = EnclaveResource; + +/** Optional parameters. */ +export interface VirtualEnclaveCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type VirtualEnclaveCreateOrUpdateResponse = EnclaveResource; + +/** Optional parameters. */ +export interface VirtualEnclaveUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type VirtualEnclaveUpdateResponse = EnclaveResource; + +/** Optional parameters. */ +export interface VirtualEnclaveDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type VirtualEnclaveDeleteResponse = VirtualEnclaveDeleteHeaders; + +/** Optional parameters. */ +export interface VirtualEnclaveApprovalCallbackOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approvalCallback operation. */ +export type VirtualEnclaveApprovalCallbackResponse = ApprovalCallbackResponse; + +/** Optional parameters. */ +export interface VirtualEnclaveApprovalDeletionCallbackOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approvalDeletionCallback operation. */ +export type VirtualEnclaveApprovalDeletionCallbackResponse = + ApprovalDeletionCallbackResponse; + +/** Optional parameters. */ +export interface VirtualEnclaveListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type VirtualEnclaveListBySubscriptionNextResponse = + EnclaveResourceListResult; + +/** Optional parameters. */ +export interface VirtualEnclaveListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type VirtualEnclaveListByResourceGroupNextResponse = + EnclaveResourceListResult; + +/** Optional parameters. */ +export interface EnclaveEndpointsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type EnclaveEndpointsListBySubscriptionResponse = + EnclaveEndpointResourceListResult; + +/** Optional parameters. */ +export interface EnclaveEndpointsListByEnclaveResourceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnclaveResource operation. */ +export type EnclaveEndpointsListByEnclaveResourceResponse = + EnclaveEndpointResourceListResult; + +/** Optional parameters. */ +export interface EnclaveEndpointsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type EnclaveEndpointsGetResponse = EnclaveEndpointResource; + +/** Optional parameters. */ +export interface EnclaveEndpointsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type EnclaveEndpointsCreateOrUpdateResponse = EnclaveEndpointResource; + +/** Optional parameters. */ +export interface EnclaveEndpointsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type EnclaveEndpointsUpdateResponse = EnclaveEndpointResource; + +/** Optional parameters. */ +export interface EnclaveEndpointsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type EnclaveEndpointsDeleteResponse = EnclaveEndpointsDeleteHeaders; + +/** Optional parameters. */ +export interface EnclaveEndpointsApprovalCallbackOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approvalCallback operation. */ +export type EnclaveEndpointsApprovalCallbackResponse = ApprovalCallbackResponse; + +/** Optional parameters. */ +export interface EnclaveEndpointsApprovalDeletionCallbackOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the approvalDeletionCallback operation. */ +export type EnclaveEndpointsApprovalDeletionCallbackResponse = + ApprovalDeletionCallbackResponse; + +/** Optional parameters. */ +export interface EnclaveEndpointsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type EnclaveEndpointsListBySubscriptionNextResponse = + EnclaveEndpointResourceListResult; + +/** Optional parameters. */ +export interface EnclaveEndpointsListByEnclaveResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnclaveResourceNext operation. */ +export type EnclaveEndpointsListByEnclaveResourceNextResponse = + EnclaveEndpointResourceListResult; + +/** Optional parameters. */ +export interface WorkloadListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type WorkloadListBySubscriptionResponse = WorkloadResourceListResult; + +/** Optional parameters. */ +export interface WorkloadListByEnclaveResourceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnclaveResource operation. */ +export type WorkloadListByEnclaveResourceResponse = WorkloadResourceListResult; + +/** Optional parameters. */ +export interface WorkloadGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type WorkloadGetResponse = WorkloadResource; + +/** Optional parameters. */ +export interface WorkloadCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type WorkloadCreateOrUpdateResponse = WorkloadResource; + +/** Optional parameters. */ +export interface WorkloadUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type WorkloadUpdateResponse = WorkloadResource; + +/** Optional parameters. */ +export interface WorkloadDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type WorkloadDeleteResponse = WorkloadDeleteHeaders; + +/** Optional parameters. */ +export interface WorkloadListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type WorkloadListBySubscriptionNextResponse = WorkloadResourceListResult; + +/** Optional parameters. */ +export interface WorkloadListByEnclaveResourceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByEnclaveResourceNext operation. */ +export type WorkloadListByEnclaveResourceNextResponse = + WorkloadResourceListResult; + +/** Optional parameters. */ +export interface MissionClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/mission/arm-mission/src/models/mappers.ts b/sdk/mission/arm-mission/src/models/mappers.ts new file mode 100644 index 000000000000..b2301061713d --- /dev/null +++ b/sdk/mission/arm-mission/src/models/mappers.ts @@ -0,0 +1,3298 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +export const ApprovalResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApprovalResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RequestMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RequestMetadata", + modelProperties: { + resourceAction: { + serializedName: "resourceAction", + required: true, + type: { + name: "String", + }, + }, + approvalStatus: { + serializedName: "approvalStatus", + type: { + name: "String", + }, + }, + approvalCallbackRoute: { + serializedName: "approvalCallbackRoute", + type: { + name: "String", + }, + }, + approvalCallbackPayload: { + serializedName: "approvalCallbackPayload", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Approver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Approver", + modelProperties: { + approverEntraId: { + serializedName: "approverEntraId", + required: true, + type: { + name: "String", + }, + }, + actionPerformed: { + serializedName: "actionPerformed", + required: true, + type: { + name: "String", + }, + }, + lastUpdatedAt: { + serializedName: "lastUpdatedAt", + required: true, + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + }, + }, +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String", + }, + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, + }, + }, + }, +}; + +export const ApprovalPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalPatchResource", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "UpdateApprovalProperties", + }, + }, + }, + }, +}; + +export const UpdateApprovalProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateApprovalProperties", + modelProperties: { + parent1: { + serializedName: "parent1", + type: { + name: "String", + }, + }, + parent2: { + serializedName: "parent2", + type: { + name: "String", + }, + }, + requestMetadata: { + serializedName: "requestMetadata", + type: { + name: "Composite", + className: "RequestMetadataUpdate", + }, + }, + approvers: { + serializedName: "approvers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Approver", + }, + }, + }, + }, + ticketId: { + serializedName: "ticketId", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + stateChangedAt: { + serializedName: "stateChangedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const RequestMetadataUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RequestMetadataUpdate", + modelProperties: { + resourceAction: { + serializedName: "resourceAction", + type: { + name: "String", + }, + }, + approvalStatus: { + serializedName: "approvalStatus", + type: { + name: "String", + }, + }, + approvalCallbackRoute: { + serializedName: "approvalCallbackRoute", + type: { + name: "String", + }, + }, + approvalCallbackPayload: { + serializedName: "approvalCallbackPayload", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const InitiatorCallbackRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InitiatorCallbackRequest", + modelProperties: { + approvalStatus: { + serializedName: "approvalStatus", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const InitiatorCallbackResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InitiatorCallbackResponse", + modelProperties: { + message: { + serializedName: "message", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean", + }, + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay", + }, + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String", + }, + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String", + }, + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CommunityResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommunityResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ManagedResourceGroupConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedResourceGroupConfiguration", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const GovernedServiceItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GovernedServiceItem", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + option: { + serializedName: "option", + type: { + name: "String", + }, + }, + enforcement: { + serializedName: "enforcement", + type: { + name: "String", + }, + }, + auditOnly: { + serializedName: "auditOnly", + type: { + name: "Boolean", + }, + }, + initiatives: { + serializedName: "initiatives", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const RoleAssignmentItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoleAssignmentItem", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String", + }, + }, + principals: { + serializedName: "principals", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Principal", + }, + }, + }, + }, + }, + }, +}; + +export const Principal: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Principal", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ApprovalSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalSettings", + modelProperties: { + endpointCreation: { + serializedName: "endpointCreation", + type: { + name: "String", + }, + }, + endpointUpdate: { + serializedName: "endpointUpdate", + type: { + name: "String", + }, + }, + endpointDeletion: { + serializedName: "endpointDeletion", + type: { + name: "String", + }, + }, + connectionCreation: { + serializedName: "connectionCreation", + type: { + name: "String", + }, + }, + connectionUpdate: { + serializedName: "connectionUpdate", + type: { + name: "String", + }, + }, + connectionUpdateMode: { + serializedName: "connectionUpdateMode", + type: { + name: "String", + }, + }, + connectionDeletion: { + serializedName: "connectionDeletion", + type: { + name: "String", + }, + }, + enclaveCreation: { + serializedName: "enclaveCreation", + type: { + name: "String", + }, + }, + enclaveDeletion: { + serializedName: "enclaveDeletion", + type: { + name: "String", + }, + }, + maintenanceMode: { + serializedName: "maintenanceMode", + type: { + name: "String", + }, + }, + serviceCatalogDeployment: { + serializedName: "serviceCatalogDeployment", + type: { + name: "String", + }, + }, + notificationOnApprovalCreation: { + serializedName: "notificationOnApprovalCreation", + type: { + name: "String", + }, + }, + notificationOnApprovalAction: { + serializedName: "notificationOnApprovalAction", + type: { + name: "String", + }, + }, + notificationOnApprovalDeletion: { + serializedName: "notificationOnApprovalDeletion", + type: { + name: "String", + }, + }, + mandatoryApprovers: { + serializedName: "mandatoryApprovers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MandatoryApprover", + }, + }, + }, + }, + minimumApproversRequired: { + serializedName: "minimumApproversRequired", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const MandatoryApprover: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MandatoryApprover", + modelProperties: { + approverEntraId: { + serializedName: "approverEntraId", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const MaintenanceModeConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MaintenanceModeConfiguration", + modelProperties: { + mode: { + serializedName: "mode", + required: true, + type: { + name: "String", + }, + }, + principals: { + serializedName: "principals", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Principal", + }, + }, + }, + }, + justification: { + serializedName: "justification", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid", + }, + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "Uuid", + }, + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String", + }, + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" }, + }, + }, + }, + }, + }, +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid", + }, + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid", + }, + }, + }, + }, +}; + +export const CommunityEndpointResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityEndpointResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommunityEndpointResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CommunityEndpointDestinationRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityEndpointDestinationRule", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + destination: { + serializedName: "destination", + type: { + name: "String", + }, + }, + port: { + serializedName: "port", + type: { + name: "String", + }, + }, + destinationType: { + serializedName: "destinationType", + type: { + name: "String", + }, + }, + protocols: { + serializedName: "protocols", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + transitHubResourceId: { + serializedName: "transitHubResourceId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TransitHubResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransitHubResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TransitHubResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TransitOption: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransitOption", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + params: { + serializedName: "params", + type: { + name: "Composite", + className: "TransitOptionParams", + }, + }, + }, + }, +}; + +export const TransitOptionParams: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransitOptionParams", + modelProperties: { + scaleUnits: { + serializedName: "scaleUnits", + type: { + name: "Number", + }, + }, + remoteVirtualNetworkId: { + serializedName: "remoteVirtualNetworkId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const EnclaveConnectionResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveConnectionResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnclaveConnectionResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const EnclaveResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnclaveResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const EnclaveVirtualNetwork: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveVirtualNetwork", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + networkSize: { + serializedName: "networkSize", + type: { + name: "String", + }, + }, + customCidrRange: { + serializedName: "customCidrRange", + type: { + name: "String", + }, + }, + subnetConfigurations: { + serializedName: "subnetConfigurations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubnetConfiguration", + }, + }, + }, + }, + allowSubnetCommunication: { + serializedName: "allowSubnetCommunication", + type: { + name: "Boolean", + }, + }, + connectToAzureServices: { + serializedName: "connectToAzureServices", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const SubnetConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubnetConfiguration", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + networkPrefixSize: { + serializedName: "networkPrefixSize", + required: true, + type: { + name: "Number", + }, + }, + subnetDelegation: { + serializedName: "subnetDelegation", + type: { + name: "String", + }, + }, + addressPrefix: { + serializedName: "addressPrefix", + readOnly: true, + type: { + name: "String", + }, + }, + networkSecurityGroupId: { + serializedName: "networkSecurityGroupId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const EnclaveAddressSpaces: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveAddressSpaces", + modelProperties: { + enclaveAddressSpace: { + serializedName: "enclaveAddressSpace", + type: { + name: "String", + }, + }, + managedAddressSpace: { + serializedName: "managedAddressSpace", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const EnclaveDefaultSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveDefaultSettings", + modelProperties: { + keyVaultResourceId: { + serializedName: "keyVaultResourceId", + type: { + name: "String", + }, + }, + storageAccountResourceId: { + serializedName: "storageAccountResourceId", + type: { + name: "String", + }, + }, + logAnalyticsResourceIdCollection: { + serializedName: "logAnalyticsResourceIdCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + diagnosticDestination: { + serializedName: "diagnosticDestination", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const EnclaveEndpointResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveEndpointResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnclaveEndpointResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const EnclaveEndpointDestinationRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveEndpointDestinationRule", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + destination: { + serializedName: "destination", + type: { + name: "String", + }, + }, + port: { + serializedName: "port", + type: { + name: "String", + }, + }, + protocols: { + serializedName: "protocols", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const WorkloadResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadResourceListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "WorkloadResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CommunityPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityPatchResource", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "UpdateCommunityPatchProperties", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: + "AzureResourceManagerCommonTypesManagedServiceIdentityUpdate", + }, + }, + }, + }, +}; + +export const UpdateCommunityPatchProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateCommunityPatchProperties", + modelProperties: { + addressSpace: { + serializedName: "addressSpace", + type: { + name: "String", + }, + }, + dnsServers: { + serializedName: "dnsServers", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + managedResourceGroupConfiguration: { + serializedName: "managedResourceGroupConfiguration", + type: { + name: "Composite", + className: "ManagedResourceGroupConfiguration", + }, + }, + governedServiceList: { + serializedName: "governedServiceList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GovernedServiceItem", + }, + }, + }, + }, + communityRoleAssignments: { + serializedName: "communityRoleAssignments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleAssignmentItem", + }, + }, + }, + }, + approvalSettings: { + serializedName: "approvalSettings", + type: { + name: "Composite", + className: "ApprovalSettings", + }, + }, + maintenanceModeConfiguration: { + serializedName: "maintenanceModeConfiguration", + type: { + name: "Composite", + className: "MaintenanceModeConfigurationUpdate", + }, + }, + }, + }, +}; + +export const MaintenanceModeConfigurationUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MaintenanceModeConfigurationUpdate", + modelProperties: { + mode: { + serializedName: "mode", + type: { + name: "String", + }, + }, + principals: { + serializedName: "principals", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Principal", + }, + }, + }, + }, + justification: { + serializedName: "justification", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AzureResourceManagerCommonTypesManagedServiceIdentityUpdate: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "AzureResourceManagerCommonTypesManagedServiceIdentityUpdate", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: + "Components19Kgb1NSchemasAzureResourcemanagerCommontypesManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties", + }, + }, + }, + }, + }, + }, + }; + +export const CheckAddressSpaceAvailabilityRequest: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CheckAddressSpaceAvailabilityRequest", + modelProperties: { + communityResourceId: { + serializedName: "communityResourceId", + required: true, + type: { + name: "String", + }, + }, + enclaveVirtualNetwork: { + serializedName: "enclaveVirtualNetwork", + type: { + name: "Composite", + className: "EnclaveVirtualNetwork", + }, + }, + }, + }, + }; + +export const CheckAddressSpaceAvailabilityResponse: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CheckAddressSpaceAvailabilityResponse", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Boolean", + }, + }, + }, + }, + }; + +export const CommunityEndpointPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityEndpointPatchResource", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "UpdateCommunityEndpointPatchProperties", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const UpdateCommunityEndpointPatchProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "UpdateCommunityEndpointPatchProperties", + modelProperties: { + ruleCollection: { + serializedName: "ruleCollection", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommunityEndpointDestinationRule", + }, + }, + }, + }, + resourceCollection: { + serializedName: "resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, + }; + +export const ApprovalCallbackRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalCallbackRequest", + modelProperties: { + resourceRequestAction: { + serializedName: "resourceRequestAction", + required: true, + type: { + name: "String", + }, + }, + approvalStatus: { + serializedName: "approvalStatus", + required: true, + type: { + name: "String", + }, + }, + approvalCallbackPayload: { + serializedName: "approvalCallbackPayload", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ApprovalCallbackResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalCallbackResponse", + modelProperties: { + message: { + serializedName: "message", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ApprovalDeletionCallbackRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalDeletionCallbackRequest", + modelProperties: { + resourceRequestAction: { + serializedName: "resourceRequestAction", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ApprovalDeletionCallbackResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalDeletionCallbackResponse", + modelProperties: { + message: { + serializedName: "message", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TransitHubPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransitHubPatchResource", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "UpdateTransitHubPatchProperties", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const UpdateTransitHubPatchProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateTransitHubPatchProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + state: { + serializedName: "state", + type: { + name: "String", + }, + }, + transitOption: { + serializedName: "transitOption", + type: { + name: "Composite", + className: "TransitOption", + }, + }, + resourceCollection: { + serializedName: "resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const EnclaveConnectionPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveConnectionPatchResource", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "UpdateEnclaveConnectionPatchProperties", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const UpdateEnclaveConnectionPatchProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "UpdateEnclaveConnectionPatchProperties", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String", + }, + }, + communityResourceId: { + serializedName: "communityResourceId", + type: { + name: "String", + }, + }, + sourceResourceId: { + serializedName: "sourceResourceId", + type: { + name: "String", + }, + }, + sourceCidr: { + serializedName: "sourceCidr", + type: { + name: "String", + }, + }, + ipGroup: { + serializedName: "ipGroup", + type: { + name: "String", + }, + }, + destinationEndpointId: { + serializedName: "destinationEndpointId", + type: { + name: "String", + }, + }, + resourceCollection: { + serializedName: "resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, + }; + +export const VirtualEnclavePatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualEnclavePatchResource", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "UpdateVirtualEnclavePatchProperties", + }, + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: + "AzureResourceManagerCommonTypesManagedServiceIdentityUpdate", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const UpdateVirtualEnclavePatchProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateVirtualEnclavePatchProperties", + modelProperties: { + enclaveVirtualNetwork: { + serializedName: "enclaveVirtualNetwork", + type: { + name: "Composite", + className: "EnclaveVirtualNetwork", + }, + }, + communityResourceId: { + serializedName: "communityResourceId", + type: { + name: "String", + }, + }, + enclaveDefaultSettings: { + serializedName: "enclaveDefaultSettings", + type: { + name: "Composite", + className: "EnclaveDefaultSettings", + }, + }, + resourceCollection: { + serializedName: "resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + managedResourceGroupConfiguration: { + serializedName: "managedResourceGroupConfiguration", + type: { + name: "Composite", + className: "ManagedResourceGroupConfiguration", + }, + }, + maintenanceModeConfiguration: { + serializedName: "maintenanceModeConfiguration", + type: { + name: "Composite", + className: "MaintenanceModeConfigurationUpdate", + }, + }, + bastionEnabled: { + serializedName: "bastionEnabled", + type: { + name: "Boolean", + }, + }, + enclaveRoleAssignments: { + serializedName: "enclaveRoleAssignments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleAssignmentItem", + }, + }, + }, + }, + workloadRoleAssignments: { + serializedName: "workloadRoleAssignments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleAssignmentItem", + }, + }, + }, + }, + }, + }, +}; + +export const EnclaveEndpointPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveEndpointPatchResource", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "UpdateEnclaveEndpointPatchProperties", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const UpdateEnclaveEndpointPatchProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "UpdateEnclaveEndpointPatchProperties", + modelProperties: { + ruleCollection: { + serializedName: "ruleCollection", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnclaveEndpointDestinationRule", + }, + }, + }, + }, + resourceCollection: { + serializedName: "resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, + }; + +export const WorkloadPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadPatchResource", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "UpdateWorkloadPatchProperties", + }, + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const UpdateWorkloadPatchProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateWorkloadPatchProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + resourceGroupCollection: { + serializedName: "resourceGroupCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Components19Kgb1NSchemasAzureResourcemanagerCommontypesManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: + "Components19Kgb1NSchemasAzureResourcemanagerCommontypesManagedserviceidentityupdatePropertiesUserassignedidentitiesAdditionalproperties", + modelProperties: { + ...UserAssignedIdentity.type.modelProperties, + }, + }, + }; + +export const ApprovalResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + parent1: { + serializedName: "properties.parent1", + type: { + name: "String", + }, + }, + parent2: { + serializedName: "properties.parent2", + type: { + name: "String", + }, + }, + requestMetadata: { + serializedName: "properties.requestMetadata", + type: { + name: "Composite", + className: "RequestMetadata", + }, + }, + approvers: { + serializedName: "properties.approvers", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Approver", + }, + }, + }, + }, + ticketId: { + serializedName: "properties.ticketId", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "properties.createdAt", + type: { + name: "DateTime", + }, + }, + stateChangedAt: { + serializedName: "properties.stateChangedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const CommunityResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity", + }, + }, + addressSpace: { + serializedName: "properties.addressSpace", + type: { + name: "String", + }, + }, + dnsServers: { + serializedName: "properties.dnsServers", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + resourceCollection: { + serializedName: "properties.resourceCollection", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + managedResourceGroupConfiguration: { + serializedName: "properties.managedResourceGroupConfiguration", + type: { + name: "Composite", + className: "ManagedResourceGroupConfiguration", + }, + }, + governedServiceList: { + serializedName: "properties.governedServiceList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GovernedServiceItem", + }, + }, + }, + }, + communityRoleAssignments: { + serializedName: "properties.communityRoleAssignments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleAssignmentItem", + }, + }, + }, + }, + approvalSettings: { + serializedName: "properties.approvalSettings", + type: { + name: "Composite", + className: "ApprovalSettings", + }, + }, + maintenanceModeConfiguration: { + serializedName: "properties.maintenanceModeConfiguration", + type: { + name: "Composite", + className: "MaintenanceModeConfiguration", + }, + }, + }, + }, +}; + +export const CommunityEndpointResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityEndpointResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + ruleCollection: { + serializedName: "properties.ruleCollection", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommunityEndpointDestinationRule", + }, + }, + }, + }, + resourceCollection: { + serializedName: "properties.resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TransitHubResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransitHubResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + state: { + serializedName: "properties.state", + type: { + name: "String", + }, + }, + transitOption: { + serializedName: "properties.transitOption", + type: { + name: "Composite", + className: "TransitOption", + }, + }, + resourceCollection: { + serializedName: "properties.resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const EnclaveConnectionResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveConnectionResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + state: { + serializedName: "properties.state", + type: { + name: "String", + }, + }, + communityResourceId: { + serializedName: "properties.communityResourceId", + type: { + name: "String", + }, + }, + sourceResourceId: { + serializedName: "properties.sourceResourceId", + type: { + name: "String", + }, + }, + sourceCidr: { + serializedName: "properties.sourceCidr", + type: { + name: "String", + }, + }, + ipGroup: { + serializedName: "properties.ipGroup", + type: { + name: "String", + }, + }, + destinationEndpointId: { + serializedName: "properties.destinationEndpointId", + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + resourceCollection: { + serializedName: "properties.resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const EnclaveResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + enclaveVirtualNetwork: { + serializedName: "properties.enclaveVirtualNetwork", + type: { + name: "Composite", + className: "EnclaveVirtualNetwork", + }, + }, + enclaveAddressSpaces: { + serializedName: "properties.enclaveAddressSpaces", + type: { + name: "Composite", + className: "EnclaveAddressSpaces", + }, + }, + communityResourceId: { + serializedName: "properties.communityResourceId", + type: { + name: "String", + }, + }, + enclaveDefaultSettings: { + serializedName: "properties.enclaveDefaultSettings", + type: { + name: "Composite", + className: "EnclaveDefaultSettings", + }, + }, + resourceCollection: { + serializedName: "properties.resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + managedResourceGroupConfiguration: { + serializedName: "properties.managedResourceGroupConfiguration", + type: { + name: "Composite", + className: "ManagedResourceGroupConfiguration", + }, + }, + maintenanceModeConfiguration: { + serializedName: "properties.maintenanceModeConfiguration", + type: { + name: "Composite", + className: "MaintenanceModeConfiguration", + }, + }, + bastionEnabled: { + serializedName: "properties.bastionEnabled", + type: { + name: "Boolean", + }, + }, + enclaveRoleAssignments: { + serializedName: "properties.enclaveRoleAssignments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleAssignmentItem", + }, + }, + }, + }, + workloadRoleAssignments: { + serializedName: "properties.workloadRoleAssignments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoleAssignmentItem", + }, + }, + }, + }, + }, + }, +}; + +export const EnclaveEndpointResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveEndpointResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + ruleCollection: { + serializedName: "properties.ruleCollection", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnclaveEndpointDestinationRule", + }, + }, + }, + }, + resourceCollection: { + serializedName: "properties.resourceCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const WorkloadResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + resourceGroupCollection: { + serializedName: "properties.resourceGroupCollection", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const ApprovalCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ApprovalUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ApprovalDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ApprovalInitiatorCallbackHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApprovalInitiatorCallbackHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CommunityCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CommunityUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CommunityDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CommunityEndpointsCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CommunityEndpointsCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const CommunityEndpointsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityEndpointsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CommunityEndpointsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityEndpointsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CommunityEndpointsApprovalCallbackHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CommunityEndpointsApprovalCallbackHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const CommunityEndpointsApprovalDeletionCallbackHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CommunityEndpointsApprovalDeletionCallbackHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const TransitHubCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransitHubCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const TransitHubUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransitHubUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const TransitHubDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TransitHubDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const EnclaveConnectionCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "EnclaveConnectionCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const EnclaveConnectionUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveConnectionUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const EnclaveConnectionDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveConnectionDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const EnclaveConnectionApprovalCallbackHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "EnclaveConnectionApprovalCallbackHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const EnclaveConnectionApprovalDeletionCallbackHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "EnclaveConnectionApprovalDeletionCallbackHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const VirtualEnclaveCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualEnclaveCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VirtualEnclaveUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualEnclaveUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VirtualEnclaveDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VirtualEnclaveDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const VirtualEnclaveApprovalCallbackHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "VirtualEnclaveApprovalCallbackHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const VirtualEnclaveApprovalDeletionCallbackHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "VirtualEnclaveApprovalDeletionCallbackHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const EnclaveEndpointsCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "EnclaveEndpointsCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const EnclaveEndpointsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveEndpointsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const EnclaveEndpointsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnclaveEndpointsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const EnclaveEndpointsApprovalCallbackHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "EnclaveEndpointsApprovalCallbackHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const EnclaveEndpointsApprovalDeletionCallbackHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "EnclaveEndpointsApprovalDeletionCallbackHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const WorkloadCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const WorkloadUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const WorkloadDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkloadDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; diff --git a/sdk/mission/arm-mission/src/models/parameters.ts b/sdk/mission/arm-mission/src/models/parameters.ts new file mode 100644 index 000000000000..3e7e2032aa5b --- /dev/null +++ b/sdk/mission/arm-mission/src/models/parameters.ts @@ -0,0 +1,345 @@ +/* + * 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 { + OperationParameter, + OperationURLParameter, + OperationQueryParameter, +} from "@azure/core-client"; +import { + ApprovalResource as ApprovalResourceMapper, + ApprovalPatchResource as ApprovalPatchResourceMapper, + InitiatorCallbackRequest as InitiatorCallbackRequestMapper, + CommunityResource as CommunityResourceMapper, + CommunityPatchResource as CommunityPatchResourceMapper, + CheckAddressSpaceAvailabilityRequest as CheckAddressSpaceAvailabilityRequestMapper, + CommunityEndpointResource as CommunityEndpointResourceMapper, + CommunityEndpointPatchResource as CommunityEndpointPatchResourceMapper, + ApprovalCallbackRequest as ApprovalCallbackRequestMapper, + ApprovalDeletionCallbackRequest as ApprovalDeletionCallbackRequestMapper, + TransitHubResource as TransitHubResourceMapper, + TransitHubPatchResource as TransitHubPatchResourceMapper, + EnclaveConnectionResource as EnclaveConnectionResourceMapper, + EnclaveConnectionPatchResource as EnclaveConnectionPatchResourceMapper, + EnclaveResource as EnclaveResourceMapper, + VirtualEnclavePatchResource as VirtualEnclavePatchResourceMapper, + EnclaveEndpointResource as EnclaveEndpointResourceMapper, + EnclaveEndpointPatchResource as EnclaveEndpointPatchResourceMapper, + WorkloadResource as WorkloadResourceMapper, + WorkloadPatchResource as WorkloadPatchResourceMapper, +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String", + }, + }, +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2024-12-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String", + }, + }, +}; + +export const resourceUri: OperationURLParameter = { + parameterPath: "resourceUri", + mapper: { + serializedName: "resourceUri", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const approvalName: OperationURLParameter = { + parameterPath: "approvalName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$"), + }, + serializedName: "approvalName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const resource: OperationParameter = { + parameterPath: "resource", + mapper: ApprovalResourceMapper, +}; + +export const properties: OperationParameter = { + parameterPath: "properties", + mapper: ApprovalPatchResourceMapper, +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: InitiatorCallbackRequestMapper, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "Uuid", + }, + }, +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const communityName: OperationURLParameter = { + parameterPath: "communityName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$"), + }, + serializedName: "communityName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource1: OperationParameter = { + parameterPath: "resource", + mapper: CommunityResourceMapper, +}; + +export const properties1: OperationParameter = { + parameterPath: "properties", + mapper: CommunityPatchResourceMapper, +}; + +export const checkAddressSpaceAvailabilityRequest: OperationParameter = { + parameterPath: "checkAddressSpaceAvailabilityRequest", + mapper: CheckAddressSpaceAvailabilityRequestMapper, +}; + +export const communityEndpointName: OperationURLParameter = { + parameterPath: "communityEndpointName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-_]*[a-zA-Z0-9]$"), + }, + serializedName: "communityEndpointName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource2: OperationParameter = { + parameterPath: "resource", + mapper: CommunityEndpointResourceMapper, +}; + +export const properties2: OperationParameter = { + parameterPath: "properties", + mapper: CommunityEndpointPatchResourceMapper, +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: ApprovalCallbackRequestMapper, +}; + +export const body2: OperationParameter = { + parameterPath: "body", + mapper: ApprovalDeletionCallbackRequestMapper, +}; + +export const transitHubName: OperationURLParameter = { + parameterPath: "transitHubName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-_]*[a-zA-Z0-9]$"), + }, + serializedName: "transitHubName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource3: OperationParameter = { + parameterPath: "resource", + mapper: TransitHubResourceMapper, +}; + +export const properties3: OperationParameter = { + parameterPath: "properties", + mapper: TransitHubPatchResourceMapper, +}; + +export const enclaveConnectionName: OperationURLParameter = { + parameterPath: "enclaveConnectionName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-_]*[a-zA-Z0-9]$"), + }, + serializedName: "enclaveConnectionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource4: OperationParameter = { + parameterPath: "resource", + mapper: EnclaveConnectionResourceMapper, +}; + +export const properties4: OperationParameter = { + parameterPath: "properties", + mapper: EnclaveConnectionPatchResourceMapper, +}; + +export const virtualEnclaveName: OperationURLParameter = { + parameterPath: "virtualEnclaveName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$"), + }, + serializedName: "virtualEnclaveName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource5: OperationParameter = { + parameterPath: "resource", + mapper: EnclaveResourceMapper, +}; + +export const properties5: OperationParameter = { + parameterPath: "properties", + mapper: VirtualEnclavePatchResourceMapper, +}; + +export const enclaveEndpointName: OperationURLParameter = { + parameterPath: "enclaveEndpointName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-_]*[a-zA-Z0-9]$"), + }, + serializedName: "enclaveEndpointName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource6: OperationParameter = { + parameterPath: "resource", + mapper: EnclaveEndpointResourceMapper, +}; + +export const properties6: OperationParameter = { + parameterPath: "properties", + mapper: EnclaveEndpointPatchResourceMapper, +}; + +export const workloadName: OperationURLParameter = { + parameterPath: "workloadName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$"), + }, + serializedName: "workloadName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource7: OperationParameter = { + parameterPath: "resource", + mapper: WorkloadResourceMapper, +}; + +export const properties7: OperationParameter = { + parameterPath: "properties", + mapper: WorkloadPatchResourceMapper, +}; diff --git a/sdk/mission/arm-mission/src/operations/approval.ts b/sdk/mission/arm-mission/src/operations/approval.ts new file mode 100644 index 000000000000..219698c15b13 --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/approval.ts @@ -0,0 +1,719 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Approval } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MissionClient } from "../missionClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + ApprovalResource, + ApprovalListByParentNextOptionalParams, + ApprovalListByParentOptionalParams, + ApprovalListByParentResponse, + ApprovalGetOptionalParams, + ApprovalGetResponse, + ApprovalCreateOrUpdateOptionalParams, + ApprovalCreateOrUpdateResponse, + ApprovalPatchResource, + ApprovalUpdateOptionalParams, + ApprovalUpdateResponse, + ApprovalDeleteOptionalParams, + ApprovalDeleteResponse, + InitiatorCallbackRequest, + ApprovalInitiatorCallbackOptionalParams, + ApprovalInitiatorCallbackResponse, + ApprovalListByParentNextResponse, +} from "../models"; + +/// +/** Class containing Approval operations. */ +export class ApprovalImpl implements Approval { + private readonly client: MissionClient; + + /** + * Initialize a new instance of the class Approval class. + * @param client Reference to the service client + */ + constructor(client: MissionClient) { + this.client = client; + } + + /** + * List ApprovalResource resources by parent + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param options The options parameters. + */ + public listByParent( + resourceUri: string, + options?: ApprovalListByParentOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByParentPagingAll(resourceUri, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByParentPagingPage(resourceUri, options, settings); + }, + }; + } + + private async *listByParentPagingPage( + resourceUri: string, + options?: ApprovalListByParentOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ApprovalListByParentResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByParent(resourceUri, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByParentNext( + resourceUri, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByParentPagingAll( + resourceUri: string, + options?: ApprovalListByParentOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByParentPagingPage( + resourceUri, + options, + )) { + yield* page; + } + } + + /** + * List ApprovalResource resources by parent + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param options The options parameters. + */ + private _listByParent( + resourceUri: string, + options?: ApprovalListByParentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, options }, + listByParentOperationSpec, + ); + } + + /** + * Get a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param options The options parameters. + */ + get( + resourceUri: string, + approvalName: string, + options?: ApprovalGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, approvalName, options }, + getOperationSpec, + ); + } + + /** + * Create a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceUri: string, + approvalName: string, + resource: ApprovalResource, + options?: ApprovalCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApprovalCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceUri, approvalName, resource, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + ApprovalCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceUri: string, + approvalName: string, + resource: ApprovalResource, + options?: ApprovalCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceUri, + approvalName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdate( + resourceUri: string, + approvalName: string, + properties: ApprovalPatchResource, + options?: ApprovalUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApprovalUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceUri, approvalName, properties, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + ApprovalUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceUri: string, + approvalName: string, + properties: ApprovalPatchResource, + options?: ApprovalUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceUri, + approvalName, + properties, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param options The options parameters. + */ + async beginDelete( + resourceUri: string, + approvalName: string, + options?: ApprovalDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApprovalDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceUri, approvalName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + ApprovalDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceUri: string, + approvalName: string, + options?: ApprovalDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete(resourceUri, approvalName, options); + return poller.pollUntilDone(); + } + + /** + * Upon receiving approval or rejection from approver, this facilitates actions on approval resource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param body The content of the action request + * @param options The options parameters. + */ + async beginInitiatorCallback( + resourceUri: string, + approvalName: string, + body: InitiatorCallbackRequest, + options?: ApprovalInitiatorCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApprovalInitiatorCallbackResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceUri, approvalName, body, options }, + spec: initiatorCallbackOperationSpec, + }); + const poller = await createHttpPoller< + ApprovalInitiatorCallbackResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Upon receiving approval or rejection from approver, this facilitates actions on approval resource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param body The content of the action request + * @param options The options parameters. + */ + async beginInitiatorCallbackAndWait( + resourceUri: string, + approvalName: string, + body: InitiatorCallbackRequest, + options?: ApprovalInitiatorCallbackOptionalParams, + ): Promise { + const poller = await this.beginInitiatorCallback( + resourceUri, + approvalName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListByParentNext + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param nextLink The nextLink from the previous successful call to the ListByParent method. + * @param options The options parameters. + */ + private _listByParentNext( + resourceUri: string, + nextLink: string, + options?: ApprovalListByParentNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceUri, nextLink, options }, + listByParentNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByParentOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Mission/approvals", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApprovalResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.resourceUri], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Mission/approvals/{approvalName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApprovalResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.approvalName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Mission/approvals/{approvalName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ApprovalResource, + }, + 201: { + bodyMapper: Mappers.ApprovalResource, + }, + 202: { + bodyMapper: Mappers.ApprovalResource, + }, + 204: { + bodyMapper: Mappers.ApprovalResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.approvalName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Mission/approvals/{approvalName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ApprovalResource, + }, + 201: { + bodyMapper: Mappers.ApprovalResource, + }, + 202: { + bodyMapper: Mappers.ApprovalResource, + }, + 204: { + bodyMapper: Mappers.ApprovalResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.approvalName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Mission/approvals/{approvalName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.ApprovalDeleteHeaders, + }, + 201: { + headersMapper: Mappers.ApprovalDeleteHeaders, + }, + 202: { + headersMapper: Mappers.ApprovalDeleteHeaders, + }, + 204: { + headersMapper: Mappers.ApprovalDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.approvalName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const initiatorCallbackOperationSpec: coreClient.OperationSpec = { + path: "/{resourceUri}/providers/Microsoft.Mission/approvals/{approvalName}/initiatorCallback", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.InitiatorCallbackResponse, + }, + 201: { + bodyMapper: Mappers.InitiatorCallbackResponse, + }, + 202: { + bodyMapper: Mappers.InitiatorCallbackResponse, + }, + 204: { + bodyMapper: Mappers.InitiatorCallbackResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.approvalName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByParentNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApprovalResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.resourceUri, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/mission/arm-mission/src/operations/community.ts b/sdk/mission/arm-mission/src/operations/community.ts new file mode 100644 index 000000000000..5f7fc2c7d621 --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/community.ts @@ -0,0 +1,778 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Community } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MissionClient } from "../missionClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + CommunityResource, + CommunityListBySubscriptionNextOptionalParams, + CommunityListBySubscriptionOptionalParams, + CommunityListBySubscriptionResponse, + CommunityListByResourceGroupNextOptionalParams, + CommunityListByResourceGroupOptionalParams, + CommunityListByResourceGroupResponse, + CommunityGetOptionalParams, + CommunityGetResponse, + CommunityCreateOrUpdateOptionalParams, + CommunityCreateOrUpdateResponse, + CommunityPatchResource, + CommunityUpdateOptionalParams, + CommunityUpdateResponse, + CommunityDeleteOptionalParams, + CommunityDeleteResponse, + CheckAddressSpaceAvailabilityRequest, + CommunityCheckAddressSpaceAvailabilityOptionalParams, + CommunityCheckAddressSpaceAvailabilityResponse, + CommunityListBySubscriptionNextResponse, + CommunityListByResourceGroupNextResponse, +} from "../models"; + +/// +/** Class containing Community operations. */ +export class CommunityImpl implements Community { + private readonly client: MissionClient; + + /** + * Initialize a new instance of the class Community class. + * @param client Reference to the service client + */ + constructor(client: MissionClient) { + this.client = client; + } + + /** + * List CommunityResource resources by subscription ID + * @param options The options parameters. + */ + public listBySubscription( + options?: CommunityListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + }, + }; + } + + private async *listBySubscriptionPagingPage( + options?: CommunityListBySubscriptionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: CommunityListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: CommunityListBySubscriptionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * List CommunityResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: CommunityListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: CommunityListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: CommunityListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: CommunityListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * List CommunityResource resources by subscription ID + * @param options The options parameters. + */ + private _listBySubscription( + options?: CommunityListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec, + ); + } + + /** + * List CommunityResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: CommunityListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Get a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + communityName: string, + options?: CommunityGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communityName, options }, + getOperationSpec, + ); + } + + /** + * Create a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + communityName: string, + resource: CommunityResource, + options?: CommunityCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, communityName, resource, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + CommunityCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + communityName: string, + resource: CommunityResource, + options?: CommunityCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + communityName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + communityName: string, + properties: CommunityPatchResource, + options?: CommunityUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, communityName, properties, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + CommunityUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + communityName: string, + properties: CommunityPatchResource, + options?: CommunityUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + communityName, + properties, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + communityName: string, + options?: CommunityDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, communityName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + CommunityDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + communityName: string, + options?: CommunityDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + communityName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Checks that the IP Address Space to be allocated for this Community is available. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param checkAddressSpaceAvailabilityRequest Check IP Address Space request body. + * @param options The options parameters. + */ + checkAddressSpaceAvailability( + resourceGroupName: string, + communityName: string, + checkAddressSpaceAvailabilityRequest: CheckAddressSpaceAvailabilityRequest, + options?: CommunityCheckAddressSpaceAvailabilityOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + communityName, + checkAddressSpaceAvailabilityRequest, + options, + }, + checkAddressSpaceAvailabilityOperationSpec, + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: CommunityListBySubscriptionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: CommunityListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Mission/communities", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CommunityResource, + }, + 201: { + bodyMapper: Mappers.CommunityResource, + }, + 202: { + bodyMapper: Mappers.CommunityResource, + }, + 204: { + bodyMapper: Mappers.CommunityResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.CommunityResource, + }, + 201: { + bodyMapper: Mappers.CommunityResource, + }, + 202: { + bodyMapper: Mappers.CommunityResource, + }, + 204: { + bodyMapper: Mappers.CommunityResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.properties1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.CommunityDeleteHeaders, + }, + 201: { + headersMapper: Mappers.CommunityDeleteHeaders, + }, + 202: { + headersMapper: Mappers.CommunityDeleteHeaders, + }, + 204: { + headersMapper: Mappers.CommunityDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const checkAddressSpaceAvailabilityOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/checkAddressSpaceAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckAddressSpaceAvailabilityResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.checkAddressSpaceAvailabilityRequest, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/mission/arm-mission/src/operations/communityEndpoints.ts b/sdk/mission/arm-mission/src/operations/communityEndpoints.ts new file mode 100644 index 000000000000..ae6ce687f68e --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/communityEndpoints.ts @@ -0,0 +1,1096 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { CommunityEndpoints } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MissionClient } from "../missionClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + CommunityEndpointResource, + CommunityEndpointsListBySubscriptionNextOptionalParams, + CommunityEndpointsListBySubscriptionOptionalParams, + CommunityEndpointsListBySubscriptionResponse, + CommunityEndpointsListByCommunityResourceNextOptionalParams, + CommunityEndpointsListByCommunityResourceOptionalParams, + CommunityEndpointsListByCommunityResourceResponse, + CommunityEndpointsGetOptionalParams, + CommunityEndpointsGetResponse, + CommunityEndpointsCreateOrUpdateOptionalParams, + CommunityEndpointsCreateOrUpdateResponse, + CommunityEndpointPatchResource, + CommunityEndpointsUpdateOptionalParams, + CommunityEndpointsUpdateResponse, + CommunityEndpointsDeleteOptionalParams, + CommunityEndpointsDeleteResponse, + ApprovalCallbackRequest, + CommunityEndpointsApprovalCallbackOptionalParams, + CommunityEndpointsApprovalCallbackResponse, + ApprovalDeletionCallbackRequest, + CommunityEndpointsApprovalDeletionCallbackOptionalParams, + CommunityEndpointsApprovalDeletionCallbackResponse, + CommunityEndpointsListBySubscriptionNextResponse, + CommunityEndpointsListByCommunityResourceNextResponse, +} from "../models"; + +/// +/** Class containing CommunityEndpoints operations. */ +export class CommunityEndpointsImpl implements CommunityEndpoints { + private readonly client: MissionClient; + + /** + * Initialize a new instance of the class CommunityEndpoints class. + * @param client Reference to the service client + */ + constructor(client: MissionClient) { + this.client = client; + } + + /** + * List CommunityEndpointResource resources by subscription ID + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + public listBySubscription( + communityName: string, + options?: CommunityEndpointsListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(communityName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage( + communityName, + options, + settings, + ); + }, + }; + } + + private async *listBySubscriptionPagingPage( + communityName: string, + options?: CommunityEndpointsListBySubscriptionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: CommunityEndpointsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(communityName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext( + communityName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + communityName: string, + options?: CommunityEndpointsListBySubscriptionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage( + communityName, + options, + )) { + yield* page; + } + } + + /** + * List CommunityEndpointResource resources by CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + public listByCommunityResource( + resourceGroupName: string, + communityName: string, + options?: CommunityEndpointsListByCommunityResourceOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCommunityResourcePagingAll( + resourceGroupName, + communityName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByCommunityResourcePagingPage( + resourceGroupName, + communityName, + options, + settings, + ); + }, + }; + } + + private async *listByCommunityResourcePagingPage( + resourceGroupName: string, + communityName: string, + options?: CommunityEndpointsListByCommunityResourceOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: CommunityEndpointsListByCommunityResourceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCommunityResource( + resourceGroupName, + communityName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCommunityResourceNext( + resourceGroupName, + communityName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCommunityResourcePagingAll( + resourceGroupName: string, + communityName: string, + options?: CommunityEndpointsListByCommunityResourceOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCommunityResourcePagingPage( + resourceGroupName, + communityName, + options, + )) { + yield* page; + } + } + + /** + * List CommunityEndpointResource resources by subscription ID + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + private _listBySubscription( + communityName: string, + options?: CommunityEndpointsListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { communityName, options }, + listBySubscriptionOperationSpec, + ); + } + + /** + * List CommunityEndpointResource resources by CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + private _listByCommunityResource( + resourceGroupName: string, + communityName: string, + options?: CommunityEndpointsListByCommunityResourceOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communityName, options }, + listByCommunityResourceOperationSpec, + ); + } + + /** + * Get a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + options?: CommunityEndpointsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communityName, communityEndpointName, options }, + getOperationSpec, + ); + } + + /** + * Create a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + resource: CommunityEndpointResource, + options?: CommunityEndpointsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + communityName, + communityEndpointName, + resource, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + CommunityEndpointsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + resource: CommunityEndpointResource, + options?: CommunityEndpointsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + communityName, + communityEndpointName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + properties: CommunityEndpointPatchResource, + options?: CommunityEndpointsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + communityName, + communityEndpointName, + properties, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + CommunityEndpointsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + properties: CommunityEndpointPatchResource, + options?: CommunityEndpointsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + communityName, + communityEndpointName, + properties, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + options?: CommunityEndpointsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + communityName, + communityEndpointName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + CommunityEndpointsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + options?: CommunityEndpointsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + communityName, + communityEndpointName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalCallback( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + body: ApprovalCallbackRequest, + options?: CommunityEndpointsApprovalCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsApprovalCallbackResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + communityName, + communityEndpointName, + body, + options, + }, + spec: approvalCallbackOperationSpec, + }); + const poller = await createHttpPoller< + CommunityEndpointsApprovalCallbackResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalCallbackAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + body: ApprovalCallbackRequest, + options?: CommunityEndpointsApprovalCallbackOptionalParams, + ): Promise { + const poller = await this.beginApprovalCallback( + resourceGroupName, + communityName, + communityEndpointName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalDeletionCallback( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + body: ApprovalDeletionCallbackRequest, + options?: CommunityEndpointsApprovalDeletionCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsApprovalDeletionCallbackResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + communityName, + communityEndpointName, + body, + options, + }, + spec: approvalDeletionCallbackOperationSpec, + }); + const poller = await createHttpPoller< + CommunityEndpointsApprovalDeletionCallbackResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalDeletionCallbackAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + body: ApprovalDeletionCallbackRequest, + options?: CommunityEndpointsApprovalDeletionCallbackOptionalParams, + ): Promise { + const poller = await this.beginApprovalDeletionCallback( + resourceGroupName, + communityName, + communityEndpointName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param communityName The name of the communityResource Resource + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + communityName: string, + nextLink: string, + options?: CommunityEndpointsListBySubscriptionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { communityName, nextLink, options }, + listBySubscriptionNextOperationSpec, + ); + } + + /** + * ListByCommunityResourceNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param nextLink The nextLink from the previous successful call to the ListByCommunityResource + * method. + * @param options The options parameters. + */ + private _listByCommunityResourceNext( + resourceGroupName: string, + communityName: string, + nextLink: string, + options?: CommunityEndpointsListByCommunityResourceNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communityName, nextLink, options }, + listByCommunityResourceNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Mission/communities/{communityName}/communityEndpoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityEndpointResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCommunityResourceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/communityEndpoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityEndpointResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/communityEndpoints/{communityEndpointName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityEndpointResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.communityEndpointName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/communityEndpoints/{communityEndpointName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CommunityEndpointResource, + }, + 201: { + bodyMapper: Mappers.CommunityEndpointResource, + }, + 202: { + bodyMapper: Mappers.CommunityEndpointResource, + }, + 204: { + bodyMapper: Mappers.CommunityEndpointResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.communityEndpointName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/communityEndpoints/{communityEndpointName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.CommunityEndpointResource, + }, + 201: { + bodyMapper: Mappers.CommunityEndpointResource, + }, + 202: { + bodyMapper: Mappers.CommunityEndpointResource, + }, + 204: { + bodyMapper: Mappers.CommunityEndpointResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.properties2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.communityEndpointName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/communityEndpoints/{communityEndpointName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.CommunityEndpointsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.CommunityEndpointsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.CommunityEndpointsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.CommunityEndpointsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.communityEndpointName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const approvalCallbackOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/communityEndpoints/{communityEndpointName}/approvalCallback", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 201: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 202: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 204: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.communityEndpointName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const approvalDeletionCallbackOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/communityEndpoints/{communityEndpointName}/approvalDeletionCallback", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 201: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 202: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 204: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.communityEndpointName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityEndpointResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCommunityResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityEndpointResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/mission/arm-mission/src/operations/enclaveConnection.ts b/sdk/mission/arm-mission/src/operations/enclaveConnection.ts new file mode 100644 index 000000000000..209840a11563 --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/enclaveConnection.ts @@ -0,0 +1,988 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { EnclaveConnection } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MissionClient } from "../missionClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + EnclaveConnectionResource, + EnclaveConnectionListBySubscriptionNextOptionalParams, + EnclaveConnectionListBySubscriptionOptionalParams, + EnclaveConnectionListBySubscriptionResponse, + EnclaveConnectionListByResourceGroupNextOptionalParams, + EnclaveConnectionListByResourceGroupOptionalParams, + EnclaveConnectionListByResourceGroupResponse, + EnclaveConnectionGetOptionalParams, + EnclaveConnectionGetResponse, + EnclaveConnectionCreateOrUpdateOptionalParams, + EnclaveConnectionCreateOrUpdateResponse, + EnclaveConnectionPatchResource, + EnclaveConnectionUpdateOptionalParams, + EnclaveConnectionUpdateResponse, + EnclaveConnectionDeleteOptionalParams, + EnclaveConnectionDeleteResponse, + ApprovalCallbackRequest, + EnclaveConnectionApprovalCallbackOptionalParams, + EnclaveConnectionApprovalCallbackResponse, + ApprovalDeletionCallbackRequest, + EnclaveConnectionApprovalDeletionCallbackOptionalParams, + EnclaveConnectionApprovalDeletionCallbackResponse, + EnclaveConnectionListBySubscriptionNextResponse, + EnclaveConnectionListByResourceGroupNextResponse, +} from "../models"; + +/// +/** Class containing EnclaveConnection operations. */ +export class EnclaveConnectionImpl implements EnclaveConnection { + private readonly client: MissionClient; + + /** + * Initialize a new instance of the class EnclaveConnection class. + * @param client Reference to the service client + */ + constructor(client: MissionClient) { + this.client = client; + } + + /** + * List EnclaveConnectionResource resources by subscription ID + * @param options The options parameters. + */ + public listBySubscription( + options?: EnclaveConnectionListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + }, + }; + } + + private async *listBySubscriptionPagingPage( + options?: EnclaveConnectionListBySubscriptionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: EnclaveConnectionListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: EnclaveConnectionListBySubscriptionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * List EnclaveConnectionResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: EnclaveConnectionListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: EnclaveConnectionListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: EnclaveConnectionListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: EnclaveConnectionListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * List EnclaveConnectionResource resources by subscription ID + * @param options The options parameters. + */ + private _listBySubscription( + options?: EnclaveConnectionListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec, + ); + } + + /** + * List EnclaveConnectionResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: EnclaveConnectionListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Get a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + enclaveConnectionName: string, + options?: EnclaveConnectionGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, enclaveConnectionName, options }, + getOperationSpec, + ); + } + + /** + * Create a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + enclaveConnectionName: string, + resource: EnclaveConnectionResource, + options?: EnclaveConnectionCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, enclaveConnectionName, resource, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveConnectionCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + resource: EnclaveConnectionResource, + options?: EnclaveConnectionCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + enclaveConnectionName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + enclaveConnectionName: string, + properties: EnclaveConnectionPatchResource, + options?: EnclaveConnectionUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, enclaveConnectionName, properties, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveConnectionUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + properties: EnclaveConnectionPatchResource, + options?: EnclaveConnectionUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + enclaveConnectionName, + properties, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + enclaveConnectionName: string, + options?: EnclaveConnectionDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, enclaveConnectionName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveConnectionDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + options?: EnclaveConnectionDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + enclaveConnectionName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalCallback( + resourceGroupName: string, + enclaveConnectionName: string, + body: ApprovalCallbackRequest, + options?: EnclaveConnectionApprovalCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionApprovalCallbackResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, enclaveConnectionName, body, options }, + spec: approvalCallbackOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveConnectionApprovalCallbackResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalCallbackAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + body: ApprovalCallbackRequest, + options?: EnclaveConnectionApprovalCallbackOptionalParams, + ): Promise { + const poller = await this.beginApprovalCallback( + resourceGroupName, + enclaveConnectionName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalDeletionCallback( + resourceGroupName: string, + enclaveConnectionName: string, + body: ApprovalDeletionCallbackRequest, + options?: EnclaveConnectionApprovalDeletionCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionApprovalDeletionCallbackResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, enclaveConnectionName, body, options }, + spec: approvalDeletionCallbackOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveConnectionApprovalDeletionCallbackResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalDeletionCallbackAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + body: ApprovalDeletionCallbackRequest, + options?: EnclaveConnectionApprovalDeletionCallbackOptionalParams, + ): Promise { + const poller = await this.beginApprovalDeletionCallback( + resourceGroupName, + enclaveConnectionName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: EnclaveConnectionListBySubscriptionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: EnclaveConnectionListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Mission/enclaveConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveConnectionResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/enclaveConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveConnectionResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/enclaveConnections/{enclaveConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveConnectionResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.enclaveConnectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/enclaveConnections/{enclaveConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.EnclaveConnectionResource, + }, + 201: { + bodyMapper: Mappers.EnclaveConnectionResource, + }, + 202: { + bodyMapper: Mappers.EnclaveConnectionResource, + }, + 204: { + bodyMapper: Mappers.EnclaveConnectionResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.enclaveConnectionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/enclaveConnections/{enclaveConnectionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.EnclaveConnectionResource, + }, + 201: { + bodyMapper: Mappers.EnclaveConnectionResource, + }, + 202: { + bodyMapper: Mappers.EnclaveConnectionResource, + }, + 204: { + bodyMapper: Mappers.EnclaveConnectionResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.properties4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.enclaveConnectionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/enclaveConnections/{enclaveConnectionName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.EnclaveConnectionDeleteHeaders, + }, + 201: { + headersMapper: Mappers.EnclaveConnectionDeleteHeaders, + }, + 202: { + headersMapper: Mappers.EnclaveConnectionDeleteHeaders, + }, + 204: { + headersMapper: Mappers.EnclaveConnectionDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.enclaveConnectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const approvalCallbackOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/enclaveConnections/{enclaveConnectionName}/approvalCallback", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 201: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 202: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 204: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.enclaveConnectionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const approvalDeletionCallbackOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/enclaveConnections/{enclaveConnectionName}/approvalDeletionCallback", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 201: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 202: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 204: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.enclaveConnectionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveConnectionResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveConnectionResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/mission/arm-mission/src/operations/enclaveEndpoints.ts b/sdk/mission/arm-mission/src/operations/enclaveEndpoints.ts new file mode 100644 index 000000000000..20f362bd4891 --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/enclaveEndpoints.ts @@ -0,0 +1,1095 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { EnclaveEndpoints } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MissionClient } from "../missionClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + EnclaveEndpointResource, + EnclaveEndpointsListBySubscriptionNextOptionalParams, + EnclaveEndpointsListBySubscriptionOptionalParams, + EnclaveEndpointsListBySubscriptionResponse, + EnclaveEndpointsListByEnclaveResourceNextOptionalParams, + EnclaveEndpointsListByEnclaveResourceOptionalParams, + EnclaveEndpointsListByEnclaveResourceResponse, + EnclaveEndpointsGetOptionalParams, + EnclaveEndpointsGetResponse, + EnclaveEndpointsCreateOrUpdateOptionalParams, + EnclaveEndpointsCreateOrUpdateResponse, + EnclaveEndpointPatchResource, + EnclaveEndpointsUpdateOptionalParams, + EnclaveEndpointsUpdateResponse, + EnclaveEndpointsDeleteOptionalParams, + EnclaveEndpointsDeleteResponse, + ApprovalCallbackRequest, + EnclaveEndpointsApprovalCallbackOptionalParams, + EnclaveEndpointsApprovalCallbackResponse, + ApprovalDeletionCallbackRequest, + EnclaveEndpointsApprovalDeletionCallbackOptionalParams, + EnclaveEndpointsApprovalDeletionCallbackResponse, + EnclaveEndpointsListBySubscriptionNextResponse, + EnclaveEndpointsListByEnclaveResourceNextResponse, +} from "../models"; + +/// +/** Class containing EnclaveEndpoints operations. */ +export class EnclaveEndpointsImpl implements EnclaveEndpoints { + private readonly client: MissionClient; + + /** + * Initialize a new instance of the class EnclaveEndpoints class. + * @param client Reference to the service client + */ + constructor(client: MissionClient) { + this.client = client; + } + + /** + * List EnclaveEndpointResource resources by subscription ID + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + public listBySubscription( + virtualEnclaveName: string, + options?: EnclaveEndpointsListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(virtualEnclaveName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage( + virtualEnclaveName, + options, + settings, + ); + }, + }; + } + + private async *listBySubscriptionPagingPage( + virtualEnclaveName: string, + options?: EnclaveEndpointsListBySubscriptionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: EnclaveEndpointsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(virtualEnclaveName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext( + virtualEnclaveName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + virtualEnclaveName: string, + options?: EnclaveEndpointsListBySubscriptionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage( + virtualEnclaveName, + options, + )) { + yield* page; + } + } + + /** + * List EnclaveEndpointResource resources by EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + public listByEnclaveResource( + resourceGroupName: string, + virtualEnclaveName: string, + options?: EnclaveEndpointsListByEnclaveResourceOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByEnclaveResourcePagingAll( + resourceGroupName, + virtualEnclaveName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByEnclaveResourcePagingPage( + resourceGroupName, + virtualEnclaveName, + options, + settings, + ); + }, + }; + } + + private async *listByEnclaveResourcePagingPage( + resourceGroupName: string, + virtualEnclaveName: string, + options?: EnclaveEndpointsListByEnclaveResourceOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: EnclaveEndpointsListByEnclaveResourceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByEnclaveResource( + resourceGroupName, + virtualEnclaveName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByEnclaveResourceNext( + resourceGroupName, + virtualEnclaveName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByEnclaveResourcePagingAll( + resourceGroupName: string, + virtualEnclaveName: string, + options?: EnclaveEndpointsListByEnclaveResourceOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByEnclaveResourcePagingPage( + resourceGroupName, + virtualEnclaveName, + options, + )) { + yield* page; + } + } + + /** + * List EnclaveEndpointResource resources by subscription ID + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + private _listBySubscription( + virtualEnclaveName: string, + options?: EnclaveEndpointsListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { virtualEnclaveName, options }, + listBySubscriptionOperationSpec, + ); + } + + /** + * List EnclaveEndpointResource resources by EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + private _listByEnclaveResource( + resourceGroupName: string, + virtualEnclaveName: string, + options?: EnclaveEndpointsListByEnclaveResourceOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualEnclaveName, options }, + listByEnclaveResourceOperationSpec, + ); + } + + /** + * Get a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + options?: EnclaveEndpointsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualEnclaveName, enclaveEndpointName, options }, + getOperationSpec, + ); + } + + /** + * Create a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + resource: EnclaveEndpointResource, + options?: EnclaveEndpointsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + resource, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveEndpointsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + resource: EnclaveEndpointResource, + options?: EnclaveEndpointsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + properties: EnclaveEndpointPatchResource, + options?: EnclaveEndpointsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + properties, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveEndpointsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + properties: EnclaveEndpointPatchResource, + options?: EnclaveEndpointsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + properties, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + options?: EnclaveEndpointsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveEndpointsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + options?: EnclaveEndpointsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalCallback( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + body: ApprovalCallbackRequest, + options?: EnclaveEndpointsApprovalCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsApprovalCallbackResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + body, + options, + }, + spec: approvalCallbackOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveEndpointsApprovalCallbackResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalCallbackAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + body: ApprovalCallbackRequest, + options?: EnclaveEndpointsApprovalCallbackOptionalParams, + ): Promise { + const poller = await this.beginApprovalCallback( + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalDeletionCallback( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + body: ApprovalDeletionCallbackRequest, + options?: EnclaveEndpointsApprovalDeletionCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsApprovalDeletionCallbackResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + body, + options, + }, + spec: approvalDeletionCallbackOperationSpec, + }); + const poller = await createHttpPoller< + EnclaveEndpointsApprovalDeletionCallbackResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalDeletionCallbackAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + body: ApprovalDeletionCallbackRequest, + options?: EnclaveEndpointsApprovalDeletionCallbackOptionalParams, + ): Promise { + const poller = await this.beginApprovalDeletionCallback( + resourceGroupName, + virtualEnclaveName, + enclaveEndpointName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + virtualEnclaveName: string, + nextLink: string, + options?: EnclaveEndpointsListBySubscriptionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { virtualEnclaveName, nextLink, options }, + listBySubscriptionNextOperationSpec, + ); + } + + /** + * ListByEnclaveResourceNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param nextLink The nextLink from the previous successful call to the ListByEnclaveResource method. + * @param options The options parameters. + */ + private _listByEnclaveResourceNext( + resourceGroupName: string, + virtualEnclaveName: string, + nextLink: string, + options?: EnclaveEndpointsListByEnclaveResourceNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualEnclaveName, nextLink, options }, + listByEnclaveResourceNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/enclaveEndpoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveEndpointResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByEnclaveResourceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/enclaveEndpoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveEndpointResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/enclaveEndpoints/{enclaveEndpointName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveEndpointResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.enclaveEndpointName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/enclaveEndpoints/{enclaveEndpointName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.EnclaveEndpointResource, + }, + 201: { + bodyMapper: Mappers.EnclaveEndpointResource, + }, + 202: { + bodyMapper: Mappers.EnclaveEndpointResource, + }, + 204: { + bodyMapper: Mappers.EnclaveEndpointResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.enclaveEndpointName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/enclaveEndpoints/{enclaveEndpointName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.EnclaveEndpointResource, + }, + 201: { + bodyMapper: Mappers.EnclaveEndpointResource, + }, + 202: { + bodyMapper: Mappers.EnclaveEndpointResource, + }, + 204: { + bodyMapper: Mappers.EnclaveEndpointResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.properties6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.enclaveEndpointName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/enclaveEndpoints/{enclaveEndpointName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.EnclaveEndpointsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.EnclaveEndpointsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.EnclaveEndpointsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.EnclaveEndpointsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.enclaveEndpointName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const approvalCallbackOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/enclaveEndpoints/{enclaveEndpointName}/approvalCallback", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 201: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 202: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 204: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.enclaveEndpointName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const approvalDeletionCallbackOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/enclaveEndpoints/{enclaveEndpointName}/approvalDeletionCallback", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 201: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 202: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 204: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.enclaveEndpointName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveEndpointResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByEnclaveResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveEndpointResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/mission/arm-mission/src/operations/index.ts b/sdk/mission/arm-mission/src/operations/index.ts new file mode 100644 index 000000000000..3d00d2a3c05b --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export * from "./approval"; +export * from "./operations"; +export * from "./community"; +export * from "./communityEndpoints"; +export * from "./transitHub"; +export * from "./enclaveConnection"; +export * from "./virtualEnclave"; +export * from "./enclaveEndpoints"; +export * from "./workload"; diff --git a/sdk/mission/arm-mission/src/operations/operations.ts b/sdk/mission/arm-mission/src/operations/operations.ts new file mode 100644 index 000000000000..49cb03c683d3 --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/operations.ts @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MissionClient } from "../missionClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse, +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: MissionClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: MissionClient) { + this.client = client; + } + + /** + * List the operations for the provider + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List the operations for the provider + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams, + ): 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?: OperationsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Mission/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult, + }, + 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.OperationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/mission/arm-mission/src/operations/transitHub.ts b/sdk/mission/arm-mission/src/operations/transitHub.ts new file mode 100644 index 000000000000..1918adb21910 --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/transitHub.ts @@ -0,0 +1,807 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { TransitHub } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MissionClient } from "../missionClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + TransitHubResource, + TransitHubListBySubscriptionNextOptionalParams, + TransitHubListBySubscriptionOptionalParams, + TransitHubListBySubscriptionResponse, + TransitHubListByCommunityResourceNextOptionalParams, + TransitHubListByCommunityResourceOptionalParams, + TransitHubListByCommunityResourceResponse, + TransitHubGetOptionalParams, + TransitHubGetResponse, + TransitHubCreateOrUpdateOptionalParams, + TransitHubCreateOrUpdateResponse, + TransitHubPatchResource, + TransitHubUpdateOptionalParams, + TransitHubUpdateResponse, + TransitHubDeleteOptionalParams, + TransitHubDeleteResponse, + TransitHubListBySubscriptionNextResponse, + TransitHubListByCommunityResourceNextResponse, +} from "../models"; + +/// +/** Class containing TransitHub operations. */ +export class TransitHubImpl implements TransitHub { + private readonly client: MissionClient; + + /** + * Initialize a new instance of the class TransitHub class. + * @param client Reference to the service client + */ + constructor(client: MissionClient) { + this.client = client; + } + + /** + * List TransitHubResource resources by subscription ID + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + public listBySubscription( + communityName: string, + options?: TransitHubListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(communityName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage( + communityName, + options, + settings, + ); + }, + }; + } + + private async *listBySubscriptionPagingPage( + communityName: string, + options?: TransitHubListBySubscriptionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TransitHubListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(communityName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext( + communityName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + communityName: string, + options?: TransitHubListBySubscriptionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage( + communityName, + options, + )) { + yield* page; + } + } + + /** + * List TransitHubResource resources by CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + public listByCommunityResource( + resourceGroupName: string, + communityName: string, + options?: TransitHubListByCommunityResourceOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCommunityResourcePagingAll( + resourceGroupName, + communityName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByCommunityResourcePagingPage( + resourceGroupName, + communityName, + options, + settings, + ); + }, + }; + } + + private async *listByCommunityResourcePagingPage( + resourceGroupName: string, + communityName: string, + options?: TransitHubListByCommunityResourceOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: TransitHubListByCommunityResourceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCommunityResource( + resourceGroupName, + communityName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCommunityResourceNext( + resourceGroupName, + communityName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCommunityResourcePagingAll( + resourceGroupName: string, + communityName: string, + options?: TransitHubListByCommunityResourceOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCommunityResourcePagingPage( + resourceGroupName, + communityName, + options, + )) { + yield* page; + } + } + + /** + * List TransitHubResource resources by subscription ID + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + private _listBySubscription( + communityName: string, + options?: TransitHubListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { communityName, options }, + listBySubscriptionOperationSpec, + ); + } + + /** + * List TransitHubResource resources by CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + private _listByCommunityResource( + resourceGroupName: string, + communityName: string, + options?: TransitHubListByCommunityResourceOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communityName, options }, + listByCommunityResourceOperationSpec, + ); + } + + /** + * Get a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + communityName: string, + transitHubName: string, + options?: TransitHubGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communityName, transitHubName, options }, + getOperationSpec, + ); + } + + /** + * Create a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + communityName: string, + transitHubName: string, + resource: TransitHubResource, + options?: TransitHubCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TransitHubCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + communityName, + transitHubName, + resource, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + TransitHubCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + communityName: string, + transitHubName: string, + resource: TransitHubResource, + options?: TransitHubCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + communityName, + transitHubName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + communityName: string, + transitHubName: string, + properties: TransitHubPatchResource, + options?: TransitHubUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TransitHubUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + communityName, + transitHubName, + properties, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + TransitHubUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + communityName: string, + transitHubName: string, + properties: TransitHubPatchResource, + options?: TransitHubUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + communityName, + transitHubName, + properties, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + communityName: string, + transitHubName: string, + options?: TransitHubDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TransitHubDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, communityName, transitHubName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + TransitHubDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + communityName: string, + transitHubName: string, + options?: TransitHubDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + communityName, + transitHubName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param communityName The name of the communityResource Resource + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + communityName: string, + nextLink: string, + options?: TransitHubListBySubscriptionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { communityName, nextLink, options }, + listBySubscriptionNextOperationSpec, + ); + } + + /** + * ListByCommunityResourceNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param nextLink The nextLink from the previous successful call to the ListByCommunityResource + * method. + * @param options The options parameters. + */ + private _listByCommunityResourceNext( + resourceGroupName: string, + communityName: string, + nextLink: string, + options?: TransitHubListByCommunityResourceNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, communityName, nextLink, options }, + listByCommunityResourceNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Mission/communities/{communityName}/transitHubs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransitHubResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCommunityResourceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/transitHubs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransitHubResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/transitHubs/{transitHubName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransitHubResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.transitHubName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/transitHubs/{transitHubName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TransitHubResource, + }, + 201: { + bodyMapper: Mappers.TransitHubResource, + }, + 202: { + bodyMapper: Mappers.TransitHubResource, + }, + 204: { + bodyMapper: Mappers.TransitHubResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.transitHubName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/transitHubs/{transitHubName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.TransitHubResource, + }, + 201: { + bodyMapper: Mappers.TransitHubResource, + }, + 202: { + bodyMapper: Mappers.TransitHubResource, + }, + 204: { + bodyMapper: Mappers.TransitHubResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.properties3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.transitHubName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/communities/{communityName}/transitHubs/{transitHubName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.TransitHubDeleteHeaders, + }, + 201: { + headersMapper: Mappers.TransitHubDeleteHeaders, + }, + 202: { + headersMapper: Mappers.TransitHubDeleteHeaders, + }, + 204: { + headersMapper: Mappers.TransitHubDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + Parameters.transitHubName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransitHubResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByCommunityResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TransitHubResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.communityName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/mission/arm-mission/src/operations/virtualEnclave.ts b/sdk/mission/arm-mission/src/operations/virtualEnclave.ts new file mode 100644 index 000000000000..b40d887e58a4 --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/virtualEnclave.ts @@ -0,0 +1,988 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { VirtualEnclave } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MissionClient } from "../missionClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + EnclaveResource, + VirtualEnclaveListBySubscriptionNextOptionalParams, + VirtualEnclaveListBySubscriptionOptionalParams, + VirtualEnclaveListBySubscriptionResponse, + VirtualEnclaveListByResourceGroupNextOptionalParams, + VirtualEnclaveListByResourceGroupOptionalParams, + VirtualEnclaveListByResourceGroupResponse, + VirtualEnclaveGetOptionalParams, + VirtualEnclaveGetResponse, + VirtualEnclaveCreateOrUpdateOptionalParams, + VirtualEnclaveCreateOrUpdateResponse, + VirtualEnclavePatchResource, + VirtualEnclaveUpdateOptionalParams, + VirtualEnclaveUpdateResponse, + VirtualEnclaveDeleteOptionalParams, + VirtualEnclaveDeleteResponse, + ApprovalCallbackRequest, + VirtualEnclaveApprovalCallbackOptionalParams, + VirtualEnclaveApprovalCallbackResponse, + ApprovalDeletionCallbackRequest, + VirtualEnclaveApprovalDeletionCallbackOptionalParams, + VirtualEnclaveApprovalDeletionCallbackResponse, + VirtualEnclaveListBySubscriptionNextResponse, + VirtualEnclaveListByResourceGroupNextResponse, +} from "../models"; + +/// +/** Class containing VirtualEnclave operations. */ +export class VirtualEnclaveImpl implements VirtualEnclave { + private readonly client: MissionClient; + + /** + * Initialize a new instance of the class VirtualEnclave class. + * @param client Reference to the service client + */ + constructor(client: MissionClient) { + this.client = client; + } + + /** + * List EnclaveResource resources by subscription ID + * @param options The options parameters. + */ + public listBySubscription( + options?: VirtualEnclaveListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + }, + }; + } + + private async *listBySubscriptionPagingPage( + options?: VirtualEnclaveListBySubscriptionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: VirtualEnclaveListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: VirtualEnclaveListBySubscriptionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * List EnclaveResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: VirtualEnclaveListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: VirtualEnclaveListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: VirtualEnclaveListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: VirtualEnclaveListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * List EnclaveResource resources by subscription ID + * @param options The options parameters. + */ + private _listBySubscription( + options?: VirtualEnclaveListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec, + ); + } + + /** + * List EnclaveResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: VirtualEnclaveListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Get a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualEnclaveName: string, + options?: VirtualEnclaveGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualEnclaveName, options }, + getOperationSpec, + ); + } + + /** + * Create a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + resource: EnclaveResource, + options?: VirtualEnclaveCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualEnclaveName, resource, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + VirtualEnclaveCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + resource: EnclaveResource, + options?: VirtualEnclaveCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + virtualEnclaveName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + properties: VirtualEnclavePatchResource, + options?: VirtualEnclaveUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualEnclaveName, properties, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + VirtualEnclaveUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + properties: VirtualEnclavePatchResource, + options?: VirtualEnclaveUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + virtualEnclaveName, + properties, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualEnclaveName: string, + options?: VirtualEnclaveDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualEnclaveName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + VirtualEnclaveDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + options?: VirtualEnclaveDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualEnclaveName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalCallback( + resourceGroupName: string, + virtualEnclaveName: string, + body: ApprovalCallbackRequest, + options?: VirtualEnclaveApprovalCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveApprovalCallbackResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualEnclaveName, body, options }, + spec: approvalCallbackOperationSpec, + }); + const poller = await createHttpPoller< + VirtualEnclaveApprovalCallbackResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalCallbackAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + body: ApprovalCallbackRequest, + options?: VirtualEnclaveApprovalCallbackOptionalParams, + ): Promise { + const poller = await this.beginApprovalCallback( + resourceGroupName, + virtualEnclaveName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalDeletionCallback( + resourceGroupName: string, + virtualEnclaveName: string, + body: ApprovalDeletionCallbackRequest, + options?: VirtualEnclaveApprovalDeletionCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveApprovalDeletionCallbackResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualEnclaveName, body, options }, + spec: approvalDeletionCallbackOperationSpec, + }); + const poller = await createHttpPoller< + VirtualEnclaveApprovalDeletionCallbackResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param body The content of the action request + * @param options The options parameters. + */ + async beginApprovalDeletionCallbackAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + body: ApprovalDeletionCallbackRequest, + options?: VirtualEnclaveApprovalDeletionCallbackOptionalParams, + ): Promise { + const poller = await this.beginApprovalDeletionCallback( + resourceGroupName, + virtualEnclaveName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: VirtualEnclaveListBySubscriptionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: VirtualEnclaveListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Mission/virtualEnclaves", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.EnclaveResource, + }, + 201: { + bodyMapper: Mappers.EnclaveResource, + }, + 202: { + bodyMapper: Mappers.EnclaveResource, + }, + 204: { + bodyMapper: Mappers.EnclaveResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.EnclaveResource, + }, + 201: { + bodyMapper: Mappers.EnclaveResource, + }, + 202: { + bodyMapper: Mappers.EnclaveResource, + }, + 204: { + bodyMapper: Mappers.EnclaveResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.properties5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.VirtualEnclaveDeleteHeaders, + }, + 201: { + headersMapper: Mappers.VirtualEnclaveDeleteHeaders, + }, + 202: { + headersMapper: Mappers.VirtualEnclaveDeleteHeaders, + }, + 204: { + headersMapper: Mappers.VirtualEnclaveDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const approvalCallbackOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/approvalCallback", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 201: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 202: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + 204: { + bodyMapper: Mappers.ApprovalCallbackResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const approvalDeletionCallbackOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/approvalDeletionCallback", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 201: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 202: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + 204: { + bodyMapper: Mappers.ApprovalDeletionCallbackResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnclaveResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/mission/arm-mission/src/operations/workload.ts b/sdk/mission/arm-mission/src/operations/workload.ts new file mode 100644 index 000000000000..4af1535eeee4 --- /dev/null +++ b/sdk/mission/arm-mission/src/operations/workload.ts @@ -0,0 +1,806 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Workload } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MissionClient } from "../missionClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + WorkloadResource, + WorkloadListBySubscriptionNextOptionalParams, + WorkloadListBySubscriptionOptionalParams, + WorkloadListBySubscriptionResponse, + WorkloadListByEnclaveResourceNextOptionalParams, + WorkloadListByEnclaveResourceOptionalParams, + WorkloadListByEnclaveResourceResponse, + WorkloadGetOptionalParams, + WorkloadGetResponse, + WorkloadCreateOrUpdateOptionalParams, + WorkloadCreateOrUpdateResponse, + WorkloadPatchResource, + WorkloadUpdateOptionalParams, + WorkloadUpdateResponse, + WorkloadDeleteOptionalParams, + WorkloadDeleteResponse, + WorkloadListBySubscriptionNextResponse, + WorkloadListByEnclaveResourceNextResponse, +} from "../models"; + +/// +/** Class containing Workload operations. */ +export class WorkloadImpl implements Workload { + private readonly client: MissionClient; + + /** + * Initialize a new instance of the class Workload class. + * @param client Reference to the service client + */ + constructor(client: MissionClient) { + this.client = client; + } + + /** + * List WorkloadResource resources by subscription ID + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + public listBySubscription( + virtualEnclaveName: string, + options?: WorkloadListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(virtualEnclaveName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage( + virtualEnclaveName, + options, + settings, + ); + }, + }; + } + + private async *listBySubscriptionPagingPage( + virtualEnclaveName: string, + options?: WorkloadListBySubscriptionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: WorkloadListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(virtualEnclaveName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext( + virtualEnclaveName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + virtualEnclaveName: string, + options?: WorkloadListBySubscriptionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage( + virtualEnclaveName, + options, + )) { + yield* page; + } + } + + /** + * List WorkloadResource resources by EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + public listByEnclaveResource( + resourceGroupName: string, + virtualEnclaveName: string, + options?: WorkloadListByEnclaveResourceOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByEnclaveResourcePagingAll( + resourceGroupName, + virtualEnclaveName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByEnclaveResourcePagingPage( + resourceGroupName, + virtualEnclaveName, + options, + settings, + ); + }, + }; + } + + private async *listByEnclaveResourcePagingPage( + resourceGroupName: string, + virtualEnclaveName: string, + options?: WorkloadListByEnclaveResourceOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: WorkloadListByEnclaveResourceResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByEnclaveResource( + resourceGroupName, + virtualEnclaveName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByEnclaveResourceNext( + resourceGroupName, + virtualEnclaveName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByEnclaveResourcePagingAll( + resourceGroupName: string, + virtualEnclaveName: string, + options?: WorkloadListByEnclaveResourceOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByEnclaveResourcePagingPage( + resourceGroupName, + virtualEnclaveName, + options, + )) { + yield* page; + } + } + + /** + * List WorkloadResource resources by subscription ID + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + private _listBySubscription( + virtualEnclaveName: string, + options?: WorkloadListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { virtualEnclaveName, options }, + listBySubscriptionOperationSpec, + ); + } + + /** + * List WorkloadResource resources by EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + private _listByEnclaveResource( + resourceGroupName: string, + virtualEnclaveName: string, + options?: WorkloadListByEnclaveResourceOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualEnclaveName, options }, + listByEnclaveResourceOperationSpec, + ); + } + + /** + * Get a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + options?: WorkloadGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualEnclaveName, workloadName, options }, + getOperationSpec, + ); + } + + /** + * Create a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + resource: WorkloadResource, + options?: WorkloadCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + WorkloadCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualEnclaveName, + workloadName, + resource, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + WorkloadCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + resource: WorkloadResource, + options?: WorkloadCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + virtualEnclaveName, + workloadName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + properties: WorkloadPatchResource, + options?: WorkloadUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + WorkloadUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + virtualEnclaveName, + workloadName, + properties, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + WorkloadUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + properties: WorkloadPatchResource, + options?: WorkloadUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + virtualEnclaveName, + workloadName, + properties, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + options?: WorkloadDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + WorkloadDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, virtualEnclaveName, workloadName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + WorkloadDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + options?: WorkloadDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + virtualEnclaveName, + workloadName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + virtualEnclaveName: string, + nextLink: string, + options?: WorkloadListBySubscriptionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { virtualEnclaveName, nextLink, options }, + listBySubscriptionNextOperationSpec, + ); + } + + /** + * ListByEnclaveResourceNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param nextLink The nextLink from the previous successful call to the ListByEnclaveResource method. + * @param options The options parameters. + */ + private _listByEnclaveResourceNext( + resourceGroupName: string, + virtualEnclaveName: string, + nextLink: string, + options?: WorkloadListByEnclaveResourceNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, virtualEnclaveName, nextLink, options }, + listByEnclaveResourceNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/workloads", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkloadResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByEnclaveResourceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/workloads", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkloadResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/workloads/{workloadName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkloadResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.workloadName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/workloads/{workloadName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.WorkloadResource, + }, + 201: { + bodyMapper: Mappers.WorkloadResource, + }, + 202: { + bodyMapper: Mappers.WorkloadResource, + }, + 204: { + bodyMapper: Mappers.WorkloadResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.workloadName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/workloads/{workloadName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.WorkloadResource, + }, + 201: { + bodyMapper: Mappers.WorkloadResource, + }, + 202: { + bodyMapper: Mappers.WorkloadResource, + }, + 204: { + bodyMapper: Mappers.WorkloadResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.properties7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.workloadName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Mission/virtualEnclaves/{virtualEnclaveName}/workloads/{workloadName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.WorkloadDeleteHeaders, + }, + 201: { + headersMapper: Mappers.WorkloadDeleteHeaders, + }, + 202: { + headersMapper: Mappers.WorkloadDeleteHeaders, + }, + 204: { + headersMapper: Mappers.WorkloadDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + Parameters.workloadName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkloadResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByEnclaveResourceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkloadResourceListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.virtualEnclaveName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/approval.ts b/sdk/mission/arm-mission/src/operationsInterfaces/approval.ts new file mode 100644 index 000000000000..46e22ecbec51 --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/approval.ts @@ -0,0 +1,171 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + ApprovalResource, + ApprovalListByParentOptionalParams, + ApprovalGetOptionalParams, + ApprovalGetResponse, + ApprovalCreateOrUpdateOptionalParams, + ApprovalCreateOrUpdateResponse, + ApprovalPatchResource, + ApprovalUpdateOptionalParams, + ApprovalUpdateResponse, + ApprovalDeleteOptionalParams, + ApprovalDeleteResponse, + InitiatorCallbackRequest, + ApprovalInitiatorCallbackOptionalParams, + ApprovalInitiatorCallbackResponse, +} from "../models"; + +/// +/** Interface representing a Approval. */ +export interface Approval { + /** + * List ApprovalResource resources by parent + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param options The options parameters. + */ + listByParent( + resourceUri: string, + options?: ApprovalListByParentOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param options The options parameters. + */ + get( + resourceUri: string, + approvalName: string, + options?: ApprovalGetOptionalParams, + ): Promise; + /** + * Create a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceUri: string, + approvalName: string, + resource: ApprovalResource, + options?: ApprovalCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApprovalCreateOrUpdateResponse + > + >; + /** + * Create a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceUri: string, + approvalName: string, + resource: ApprovalResource, + options?: ApprovalCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdate( + resourceUri: string, + approvalName: string, + properties: ApprovalPatchResource, + options?: ApprovalUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApprovalUpdateResponse + > + >; + /** + * Update a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceUri: string, + approvalName: string, + properties: ApprovalPatchResource, + options?: ApprovalUpdateOptionalParams, + ): Promise; + /** + * Delete a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param options The options parameters. + */ + beginDelete( + resourceUri: string, + approvalName: string, + options?: ApprovalDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApprovalDeleteResponse + > + >; + /** + * Delete a ApprovalResource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceUri: string, + approvalName: string, + options?: ApprovalDeleteOptionalParams, + ): Promise; + /** + * Upon receiving approval or rejection from approver, this facilitates actions on approval resource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param body The content of the action request + * @param options The options parameters. + */ + beginInitiatorCallback( + resourceUri: string, + approvalName: string, + body: InitiatorCallbackRequest, + options?: ApprovalInitiatorCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ApprovalInitiatorCallbackResponse + > + >; + /** + * Upon receiving approval or rejection from approver, this facilitates actions on approval resource + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param approvalName The name of the approvals resource. + * @param body The content of the action request + * @param options The options parameters. + */ + beginInitiatorCallbackAndWait( + resourceUri: string, + approvalName: string, + body: InitiatorCallbackRequest, + options?: ApprovalInitiatorCallbackOptionalParams, + ): Promise; +} diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/community.ts b/sdk/mission/arm-mission/src/operationsInterfaces/community.ts new file mode 100644 index 000000000000..d68b530ceba5 --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/community.ts @@ -0,0 +1,161 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + CommunityResource, + CommunityListBySubscriptionOptionalParams, + CommunityListByResourceGroupOptionalParams, + CommunityGetOptionalParams, + CommunityGetResponse, + CommunityCreateOrUpdateOptionalParams, + CommunityCreateOrUpdateResponse, + CommunityPatchResource, + CommunityUpdateOptionalParams, + CommunityUpdateResponse, + CommunityDeleteOptionalParams, + CommunityDeleteResponse, + CheckAddressSpaceAvailabilityRequest, + CommunityCheckAddressSpaceAvailabilityOptionalParams, + CommunityCheckAddressSpaceAvailabilityResponse, +} from "../models"; + +/// +/** Interface representing a Community. */ +export interface Community { + /** + * List CommunityResource resources by subscription ID + * @param options The options parameters. + */ + listBySubscription( + options?: CommunityListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List CommunityResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: CommunityListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + communityName: string, + options?: CommunityGetOptionalParams, + ): Promise; + /** + * Create a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + communityName: string, + resource: CommunityResource, + options?: CommunityCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityCreateOrUpdateResponse + > + >; + /** + * Create a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + communityName: string, + resource: CommunityResource, + options?: CommunityCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + communityName: string, + properties: CommunityPatchResource, + options?: CommunityUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityUpdateResponse + > + >; + /** + * Update a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + communityName: string, + properties: CommunityPatchResource, + options?: CommunityUpdateOptionalParams, + ): Promise; + /** + * Delete a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + communityName: string, + options?: CommunityDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityDeleteResponse + > + >; + /** + * Delete a CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + communityName: string, + options?: CommunityDeleteOptionalParams, + ): Promise; + /** + * Checks that the IP Address Space to be allocated for this Community is available. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param checkAddressSpaceAvailabilityRequest Check IP Address Space request body. + * @param options The options parameters. + */ + checkAddressSpaceAvailability( + resourceGroupName: string, + communityName: string, + checkAddressSpaceAvailabilityRequest: CheckAddressSpaceAvailabilityRequest, + options?: CommunityCheckAddressSpaceAvailabilityOptionalParams, + ): Promise; +} diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/communityEndpoints.ts b/sdk/mission/arm-mission/src/operationsInterfaces/communityEndpoints.ts new file mode 100644 index 000000000000..8ef690dd4230 --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/communityEndpoints.ts @@ -0,0 +1,239 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + CommunityEndpointResource, + CommunityEndpointsListBySubscriptionOptionalParams, + CommunityEndpointsListByCommunityResourceOptionalParams, + CommunityEndpointsGetOptionalParams, + CommunityEndpointsGetResponse, + CommunityEndpointsCreateOrUpdateOptionalParams, + CommunityEndpointsCreateOrUpdateResponse, + CommunityEndpointPatchResource, + CommunityEndpointsUpdateOptionalParams, + CommunityEndpointsUpdateResponse, + CommunityEndpointsDeleteOptionalParams, + CommunityEndpointsDeleteResponse, + ApprovalCallbackRequest, + CommunityEndpointsApprovalCallbackOptionalParams, + CommunityEndpointsApprovalCallbackResponse, + ApprovalDeletionCallbackRequest, + CommunityEndpointsApprovalDeletionCallbackOptionalParams, + CommunityEndpointsApprovalDeletionCallbackResponse, +} from "../models"; + +/// +/** Interface representing a CommunityEndpoints. */ +export interface CommunityEndpoints { + /** + * List CommunityEndpointResource resources by subscription ID + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + listBySubscription( + communityName: string, + options?: CommunityEndpointsListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List CommunityEndpointResource resources by CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + listByCommunityResource( + resourceGroupName: string, + communityName: string, + options?: CommunityEndpointsListByCommunityResourceOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + options?: CommunityEndpointsGetOptionalParams, + ): Promise; + /** + * Create a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + resource: CommunityEndpointResource, + options?: CommunityEndpointsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsCreateOrUpdateResponse + > + >; + /** + * Create a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + resource: CommunityEndpointResource, + options?: CommunityEndpointsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + properties: CommunityEndpointPatchResource, + options?: CommunityEndpointsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsUpdateResponse + > + >; + /** + * Update a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + properties: CommunityEndpointPatchResource, + options?: CommunityEndpointsUpdateOptionalParams, + ): Promise; + /** + * Delete a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + options?: CommunityEndpointsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsDeleteResponse + > + >; + /** + * Delete a CommunityEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + options?: CommunityEndpointsDeleteOptionalParams, + ): Promise; + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalCallback( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + body: ApprovalCallbackRequest, + options?: CommunityEndpointsApprovalCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsApprovalCallbackResponse + > + >; + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalCallbackAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + body: ApprovalCallbackRequest, + options?: CommunityEndpointsApprovalCallbackOptionalParams, + ): Promise; + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalDeletionCallback( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + body: ApprovalDeletionCallbackRequest, + options?: CommunityEndpointsApprovalDeletionCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CommunityEndpointsApprovalDeletionCallbackResponse + > + >; + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param communityEndpointName The name of the Community Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalDeletionCallbackAndWait( + resourceGroupName: string, + communityName: string, + communityEndpointName: string, + body: ApprovalDeletionCallbackRequest, + options?: CommunityEndpointsApprovalDeletionCallbackOptionalParams, + ): Promise; +} diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/enclaveConnection.ts b/sdk/mission/arm-mission/src/operationsInterfaces/enclaveConnection.ts new file mode 100644 index 000000000000..bba8d7d6ef12 --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/enclaveConnection.ts @@ -0,0 +1,213 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + EnclaveConnectionResource, + EnclaveConnectionListBySubscriptionOptionalParams, + EnclaveConnectionListByResourceGroupOptionalParams, + EnclaveConnectionGetOptionalParams, + EnclaveConnectionGetResponse, + EnclaveConnectionCreateOrUpdateOptionalParams, + EnclaveConnectionCreateOrUpdateResponse, + EnclaveConnectionPatchResource, + EnclaveConnectionUpdateOptionalParams, + EnclaveConnectionUpdateResponse, + EnclaveConnectionDeleteOptionalParams, + EnclaveConnectionDeleteResponse, + ApprovalCallbackRequest, + EnclaveConnectionApprovalCallbackOptionalParams, + EnclaveConnectionApprovalCallbackResponse, + ApprovalDeletionCallbackRequest, + EnclaveConnectionApprovalDeletionCallbackOptionalParams, + EnclaveConnectionApprovalDeletionCallbackResponse, +} from "../models"; + +/// +/** Interface representing a EnclaveConnection. */ +export interface EnclaveConnection { + /** + * List EnclaveConnectionResource resources by subscription ID + * @param options The options parameters. + */ + listBySubscription( + options?: EnclaveConnectionListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List EnclaveConnectionResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: EnclaveConnectionListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + enclaveConnectionName: string, + options?: EnclaveConnectionGetOptionalParams, + ): Promise; + /** + * Create a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + enclaveConnectionName: string, + resource: EnclaveConnectionResource, + options?: EnclaveConnectionCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionCreateOrUpdateResponse + > + >; + /** + * Create a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + resource: EnclaveConnectionResource, + options?: EnclaveConnectionCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + enclaveConnectionName: string, + properties: EnclaveConnectionPatchResource, + options?: EnclaveConnectionUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionUpdateResponse + > + >; + /** + * Update a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + properties: EnclaveConnectionPatchResource, + options?: EnclaveConnectionUpdateOptionalParams, + ): Promise; + /** + * Delete a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + enclaveConnectionName: string, + options?: EnclaveConnectionDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionDeleteResponse + > + >; + /** + * Delete a EnclaveConnectionResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + options?: EnclaveConnectionDeleteOptionalParams, + ): Promise; + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalCallback( + resourceGroupName: string, + enclaveConnectionName: string, + body: ApprovalCallbackRequest, + options?: EnclaveConnectionApprovalCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionApprovalCallbackResponse + > + >; + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalCallbackAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + body: ApprovalCallbackRequest, + options?: EnclaveConnectionApprovalCallbackOptionalParams, + ): Promise; + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalDeletionCallback( + resourceGroupName: string, + enclaveConnectionName: string, + body: ApprovalDeletionCallbackRequest, + options?: EnclaveConnectionApprovalDeletionCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveConnectionApprovalDeletionCallbackResponse + > + >; + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param enclaveConnectionName The name of the Enclave Connection Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalDeletionCallbackAndWait( + resourceGroupName: string, + enclaveConnectionName: string, + body: ApprovalDeletionCallbackRequest, + options?: EnclaveConnectionApprovalDeletionCallbackOptionalParams, + ): Promise; +} diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/enclaveEndpoints.ts b/sdk/mission/arm-mission/src/operationsInterfaces/enclaveEndpoints.ts new file mode 100644 index 000000000000..9b77e691cd34 --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/enclaveEndpoints.ts @@ -0,0 +1,239 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + EnclaveEndpointResource, + EnclaveEndpointsListBySubscriptionOptionalParams, + EnclaveEndpointsListByEnclaveResourceOptionalParams, + EnclaveEndpointsGetOptionalParams, + EnclaveEndpointsGetResponse, + EnclaveEndpointsCreateOrUpdateOptionalParams, + EnclaveEndpointsCreateOrUpdateResponse, + EnclaveEndpointPatchResource, + EnclaveEndpointsUpdateOptionalParams, + EnclaveEndpointsUpdateResponse, + EnclaveEndpointsDeleteOptionalParams, + EnclaveEndpointsDeleteResponse, + ApprovalCallbackRequest, + EnclaveEndpointsApprovalCallbackOptionalParams, + EnclaveEndpointsApprovalCallbackResponse, + ApprovalDeletionCallbackRequest, + EnclaveEndpointsApprovalDeletionCallbackOptionalParams, + EnclaveEndpointsApprovalDeletionCallbackResponse, +} from "../models"; + +/// +/** Interface representing a EnclaveEndpoints. */ +export interface EnclaveEndpoints { + /** + * List EnclaveEndpointResource resources by subscription ID + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + listBySubscription( + virtualEnclaveName: string, + options?: EnclaveEndpointsListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List EnclaveEndpointResource resources by EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + listByEnclaveResource( + resourceGroupName: string, + virtualEnclaveName: string, + options?: EnclaveEndpointsListByEnclaveResourceOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + options?: EnclaveEndpointsGetOptionalParams, + ): Promise; + /** + * Create a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + resource: EnclaveEndpointResource, + options?: EnclaveEndpointsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsCreateOrUpdateResponse + > + >; + /** + * Create a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + resource: EnclaveEndpointResource, + options?: EnclaveEndpointsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + properties: EnclaveEndpointPatchResource, + options?: EnclaveEndpointsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsUpdateResponse + > + >; + /** + * Update a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + properties: EnclaveEndpointPatchResource, + options?: EnclaveEndpointsUpdateOptionalParams, + ): Promise; + /** + * Delete a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + options?: EnclaveEndpointsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsDeleteResponse + > + >; + /** + * Delete a EnclaveEndpointResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + options?: EnclaveEndpointsDeleteOptionalParams, + ): Promise; + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalCallback( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + body: ApprovalCallbackRequest, + options?: EnclaveEndpointsApprovalCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsApprovalCallbackResponse + > + >; + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalCallbackAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + body: ApprovalCallbackRequest, + options?: EnclaveEndpointsApprovalCallbackOptionalParams, + ): Promise; + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalDeletionCallback( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + body: ApprovalDeletionCallbackRequest, + options?: EnclaveEndpointsApprovalDeletionCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + EnclaveEndpointsApprovalDeletionCallbackResponse + > + >; + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param enclaveEndpointName The name of the Enclave Endpoint Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalDeletionCallbackAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + enclaveEndpointName: string, + body: ApprovalDeletionCallbackRequest, + options?: EnclaveEndpointsApprovalDeletionCallbackOptionalParams, + ): Promise; +} diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/index.ts b/sdk/mission/arm-mission/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..3d00d2a3c05b --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export * from "./approval"; +export * from "./operations"; +export * from "./community"; +export * from "./communityEndpoints"; +export * from "./transitHub"; +export * from "./enclaveConnection"; +export * from "./virtualEnclave"; +export * from "./enclaveEndpoints"; +export * from "./workload"; diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/operations.ts b/sdk/mission/arm-mission/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..251f5f582e64 --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * 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 { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List the operations for the provider + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams, + ): PagedAsyncIterableIterator; +} diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/transitHub.ts b/sdk/mission/arm-mission/src/operationsInterfaces/transitHub.ts new file mode 100644 index 000000000000..3bf7dfbd8506 --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/transitHub.ts @@ -0,0 +1,163 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + TransitHubResource, + TransitHubListBySubscriptionOptionalParams, + TransitHubListByCommunityResourceOptionalParams, + TransitHubGetOptionalParams, + TransitHubGetResponse, + TransitHubCreateOrUpdateOptionalParams, + TransitHubCreateOrUpdateResponse, + TransitHubPatchResource, + TransitHubUpdateOptionalParams, + TransitHubUpdateResponse, + TransitHubDeleteOptionalParams, + TransitHubDeleteResponse, +} from "../models"; + +/// +/** Interface representing a TransitHub. */ +export interface TransitHub { + /** + * List TransitHubResource resources by subscription ID + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + listBySubscription( + communityName: string, + options?: TransitHubListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List TransitHubResource resources by CommunityResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param options The options parameters. + */ + listByCommunityResource( + resourceGroupName: string, + communityName: string, + options?: TransitHubListByCommunityResourceOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + communityName: string, + transitHubName: string, + options?: TransitHubGetOptionalParams, + ): Promise; + /** + * Create a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + communityName: string, + transitHubName: string, + resource: TransitHubResource, + options?: TransitHubCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TransitHubCreateOrUpdateResponse + > + >; + /** + * Create a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + communityName: string, + transitHubName: string, + resource: TransitHubResource, + options?: TransitHubCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + communityName: string, + transitHubName: string, + properties: TransitHubPatchResource, + options?: TransitHubUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TransitHubUpdateResponse + > + >; + /** + * Update a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + communityName: string, + transitHubName: string, + properties: TransitHubPatchResource, + options?: TransitHubUpdateOptionalParams, + ): Promise; + /** + * Delete a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + communityName: string, + transitHubName: string, + options?: TransitHubDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TransitHubDeleteResponse + > + >; + /** + * Delete a TransitHubResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param communityName The name of the communityResource Resource + * @param transitHubName The name of the TransitHub Resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + communityName: string, + transitHubName: string, + options?: TransitHubDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/virtualEnclave.ts b/sdk/mission/arm-mission/src/operationsInterfaces/virtualEnclave.ts new file mode 100644 index 000000000000..4f012b3f6378 --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/virtualEnclave.ts @@ -0,0 +1,213 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + EnclaveResource, + VirtualEnclaveListBySubscriptionOptionalParams, + VirtualEnclaveListByResourceGroupOptionalParams, + VirtualEnclaveGetOptionalParams, + VirtualEnclaveGetResponse, + VirtualEnclaveCreateOrUpdateOptionalParams, + VirtualEnclaveCreateOrUpdateResponse, + VirtualEnclavePatchResource, + VirtualEnclaveUpdateOptionalParams, + VirtualEnclaveUpdateResponse, + VirtualEnclaveDeleteOptionalParams, + VirtualEnclaveDeleteResponse, + ApprovalCallbackRequest, + VirtualEnclaveApprovalCallbackOptionalParams, + VirtualEnclaveApprovalCallbackResponse, + ApprovalDeletionCallbackRequest, + VirtualEnclaveApprovalDeletionCallbackOptionalParams, + VirtualEnclaveApprovalDeletionCallbackResponse, +} from "../models"; + +/// +/** Interface representing a VirtualEnclave. */ +export interface VirtualEnclave { + /** + * List EnclaveResource resources by subscription ID + * @param options The options parameters. + */ + listBySubscription( + options?: VirtualEnclaveListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List EnclaveResource resources by resource group + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: VirtualEnclaveListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualEnclaveName: string, + options?: VirtualEnclaveGetOptionalParams, + ): Promise; + /** + * Create a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + resource: EnclaveResource, + options?: VirtualEnclaveCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveCreateOrUpdateResponse + > + >; + /** + * Create a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + resource: EnclaveResource, + options?: VirtualEnclaveCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + properties: VirtualEnclavePatchResource, + options?: VirtualEnclaveUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveUpdateResponse + > + >; + /** + * Update a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + properties: VirtualEnclavePatchResource, + options?: VirtualEnclaveUpdateOptionalParams, + ): Promise; + /** + * Delete a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualEnclaveName: string, + options?: VirtualEnclaveDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveDeleteResponse + > + >; + /** + * Delete a EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + options?: VirtualEnclaveDeleteOptionalParams, + ): Promise; + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalCallback( + resourceGroupName: string, + virtualEnclaveName: string, + body: ApprovalCallbackRequest, + options?: VirtualEnclaveApprovalCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveApprovalCallbackResponse + > + >; + /** + * Callback that triggers on approval state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalCallbackAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + body: ApprovalCallbackRequest, + options?: VirtualEnclaveApprovalCallbackOptionalParams, + ): Promise; + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalDeletionCallback( + resourceGroupName: string, + virtualEnclaveName: string, + body: ApprovalDeletionCallbackRequest, + options?: VirtualEnclaveApprovalDeletionCallbackOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + VirtualEnclaveApprovalDeletionCallbackResponse + > + >; + /** + * Callback that triggers on approval deletion state change. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param body The content of the action request + * @param options The options parameters. + */ + beginApprovalDeletionCallbackAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + body: ApprovalDeletionCallbackRequest, + options?: VirtualEnclaveApprovalDeletionCallbackOptionalParams, + ): Promise; +} diff --git a/sdk/mission/arm-mission/src/operationsInterfaces/workload.ts b/sdk/mission/arm-mission/src/operationsInterfaces/workload.ts new file mode 100644 index 000000000000..259afe77c196 --- /dev/null +++ b/sdk/mission/arm-mission/src/operationsInterfaces/workload.ts @@ -0,0 +1,163 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + WorkloadResource, + WorkloadListBySubscriptionOptionalParams, + WorkloadListByEnclaveResourceOptionalParams, + WorkloadGetOptionalParams, + WorkloadGetResponse, + WorkloadCreateOrUpdateOptionalParams, + WorkloadCreateOrUpdateResponse, + WorkloadPatchResource, + WorkloadUpdateOptionalParams, + WorkloadUpdateResponse, + WorkloadDeleteOptionalParams, + WorkloadDeleteResponse, +} from "../models"; + +/// +/** Interface representing a Workload. */ +export interface Workload { + /** + * List WorkloadResource resources by subscription ID + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + listBySubscription( + virtualEnclaveName: string, + options?: WorkloadListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List WorkloadResource resources by EnclaveResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param options The options parameters. + */ + listByEnclaveResource( + resourceGroupName: string, + virtualEnclaveName: string, + options?: WorkloadListByEnclaveResourceOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + options?: WorkloadGetOptionalParams, + ): Promise; + /** + * Create a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + resource: WorkloadResource, + options?: WorkloadCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + WorkloadCreateOrUpdateResponse + > + >; + /** + * Create a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + resource: WorkloadResource, + options?: WorkloadCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + properties: WorkloadPatchResource, + options?: WorkloadUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + WorkloadUpdateResponse + > + >; + /** + * Update a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + properties: WorkloadPatchResource, + options?: WorkloadUpdateOptionalParams, + ): Promise; + /** + * Delete a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + options?: WorkloadDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + WorkloadDeleteResponse + > + >; + /** + * Delete a WorkloadResource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualEnclaveName The name of the enclaveResource Resource + * @param workloadName The name of the workloadResource Resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + virtualEnclaveName: string, + workloadName: string, + options?: WorkloadDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/mission/arm-mission/src/pagingHelper.ts b/sdk/mission/arm-mission/src/pagingHelper.ts new file mode 100644 index 000000000000..205cccc26592 --- /dev/null +++ b/sdk/mission/arm-mission/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined, +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/mission/arm-mission/test/sampleTest.ts b/sdk/mission/arm-mission/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/mission/arm-mission/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/mission/arm-mission/test/snippets.spec.ts b/sdk/mission/arm-mission/test/snippets.spec.ts new file mode 100644 index 000000000000..06df84c7561f --- /dev/null +++ b/sdk/mission/arm-mission/test/snippets.spec.ts @@ -0,0 +1,38 @@ +/* + * 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 { MissionClient } from "../src/index.js"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; +import { setLogLevel } from "@azure/logger"; +import { describe, it } from "vitest"; + +describe("snippets", () => { + it("ReadmeSampleCreateClient_Node", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new MissionClient( + new DefaultAzureCredential(), + subscriptionId, + ); + }); + + it("ReadmeSampleCreateClient_Browser", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", + }); + const client = new MissionClient(credential, subscriptionId); + }); + + it("SetLogLevel", async () => { + setLogLevel("info"); + }); +}); diff --git a/sdk/mission/arm-mission/tsconfig.json b/sdk/mission/arm-mission/tsconfig.json new file mode 100644 index 000000000000..59ea83c046bf --- /dev/null +++ b/sdk/mission/arm-mission/tsconfig.json @@ -0,0 +1,10 @@ +{ + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.test.json" + } + ] +} \ No newline at end of file diff --git a/sdk/mission/arm-mission/tsconfig.src.json b/sdk/mission/arm-mission/tsconfig.src.json new file mode 100644 index 000000000000..bae70752dd38 --- /dev/null +++ b/sdk/mission/arm-mission/tsconfig.src.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.lib.json" +} diff --git a/sdk/mission/arm-mission/tsconfig.test.json b/sdk/mission/arm-mission/tsconfig.test.json new file mode 100644 index 000000000000..290ca214aebc --- /dev/null +++ b/sdk/mission/arm-mission/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] +}